The new metobit command fits multilevel and panel-data models for which the outcome is censored. Censored means that rather than the outcome \(y\) being observed precisely in all observations, it is known only that \(y \leq y_l\) (left-censoring) or \(y \geq y_u\) (right-censoring) in some of the observations. For instance, the amount of a pollutant may be left-censored because the measurement instrument has a lower limit of detection. The number of attendees at an event may be right-censored because the stadium has a limited number of seats.
Multilevel means that the fitted model accounts for lack of independence within groups of observations, such as people who live near each other or students who attend the same school or students who are tested repeatedly. metobit can also fit models with multiple levels of nesting. You can fit models with data on students within school districts within cities and even have random effects for each level!
Tobit models, whether multilevel or one-level, can be used for two types of inference—for the entire population as if it were not censored and for the censored population.
We have been hired to analyze data on attendance at 500 soccer stadiums. The data are censored when the stadium is sold out. In such cases, it is likely that attendance would have been greater had there been more seats.
Clients who run stadiums, who could increase the number of seats at a cost, would be interested in analysis of the uncensored population. Clients who rent and cannot increase the number of seats are interested in analysis of the censored population.
We can use metobit to answer questions for both types of clients. In fact, we will fit the model once and use different predictions to answer different questions.
The data we have include attend, stadium attendance in thousands for each game played during the season. We will model attendance as a function of
We could fit this model with a linear multilevel estimator but for the fact that each stadium has a seating limit. That limit is recorded in the variable max.
Using metobit, we will type
. metobit attend winp inter cost i.weather || stadium: winp, ul(max)
Option ul(max) specifies the upper-censoring point.
Right of the ||
is the level-2 ID variable, stadium. We are specifying
that we want random intercepts for each stadium and random coefficients for winning
percentage.
We fit our desired model:
. metobit attend winp inter cost i.weather || stadium: winp, ul(max) Mixed-effects tobit regression Number of obs = 8,643 Uncensored = 6,735 Limits: lower = -inf Left-censored = 0 upper = max Right-censored = 1,908 Group variable: stadium Number of groups = 500 Obs per group: min = 12 avg = 17.3 max = 20 Integration method: mvaghermite Integration pts. = 7 Wald chi2(4) = 29846.04 Log likelihood = -21447.366 Prob > chi2 = 0.0000
attend | Coef. Std. Err. z P>|z| [95% Conf. Interval] | |
winp | .7125553 .0657861 10.83 0.000 .583617 .8414936 | |
inter | .7572882 .0043945 172.33 0.000 .7486752 .7659013 | |
cost | -.0075386 .0004743 -15.89 0.000 -.0084683 -.006609 | |
1.weather | .1346941 .2741321 0.49 0.623 -.402595 .6719832 | |
_cons | 7.608423 .2590445 29.37 0.000 7.100705 8.116141 | |
stadium | ||
var(winp) | 1.379988 .1280754 1.150472 1.655291 | |
var(_cons) | 14.77107 1.306585 12.4199 17.56732 | |
var(e.attend) | 22.31481 .4019761 21.5407 23.11674 | |
From the model, we can obtain estimates of average attendance. There are many ways to calculate average attendance. What would be the uncensored average attendance if max had not been in effect? What is the predicted average attendance given max? What would be average attendance if seating was increased by 1,000 in all stadiums having more than 90% average attendance? 2,000? 3,000?
In a world where max was not relevant, average attendance would have been about 23,510:
. margins Predictive margins Number of obs = 8,131 Model VCE : OIM Expression : Marginal linear prediction, predict()
Delta-method | ||
Margin Std. Err. z P>|z| [95% Conf. Interval] | ||
_cons | 23.50981 .3189898 73.70 0.000 22.8846 24.13502 | |
In the real world where the current value of max is binding, it would be about 18,712:
. margins, predict(ystar(.,max)) Predictive margins Number of obs = 8,131 Model VCE : OIM Expression : E(attend*|attend<max), predict(ystar(.,max))
Delta-method | ||
Margin Std. Err. z P>|z| [95% Conf. Interval] | ||
_cons | 18.7123 .1790272 104.52 0.000 18.36141 19.06319 | |
We could also use margins to answer what attendance would be if max was increased by 1,000 in stadiums with over 90% attendance.
. generate new_max = max + 1 . margins if attend_rate>.90, predict(ystar(.,new_max)) Predictive margins Number of obs = 5,284 Model VCE : OIM Expression : E(attend*|attend<new_max), predict(ystar(.,new_max))
Delta-method | ||
Margin Std. Err. z P>|z| [95% Conf. Interval] | ||
_cons | 26.81172 .3243089 82.67 0.000 26.17608 27.44735 | |
Average attendance would be 26,812 in stadiums with attendance rate greater than 90%. This seems like a large number, but the stadiums in our sample with more than 90% attendance are the larger stadiums with teams with the highest winning percentage.
You can also fit Bayesian multilevel tobit models using the bayes prefix.
Learn more about Stata's multilevel mixed-effects models features.
Read more about multilevel tobit models in the Stata Multilevel Mixed-Effects Reference Manual; see [ME] metobit.