0% found this document useful (0 votes)
108 views9 pages

Xtxttobit

Uploaded by

Guivis Zeufack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views9 pages

Xtxttobit

Uploaded by

Guivis Zeufack
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Title stata.

com
xttobit — Random-effects tobit models

Description Quick start Menu Syntax


Options Remarks and examples Stored results Methods and formulas
References Also see

Description
xttobit fits random-effects tobit models for panel data where the outcome variable is censored.
Censoring limits may be fixed for all observations or vary across observations. The user can request
that a likelihood-ratio test comparing the panel tobit model with the pooled tobit model be conducted
at estimation time.

Quick start
Tobit model of y on x where y is censored at a lower limit of 5 using xtset data
xttobit y x, ll(5)
Add indicators for levels of categorical variable a
xttobit y x i.a, ll(5)
As above, but specify that censoring occurs at 5 and 25
xttobit y x i.a, ll(5) ul(25)
As above, but where lower and upper are variables containing the censoring limits
xttobit y x i.a, ll(lower) ul(upper)
Add likelihood-ratio test comparing the random-effects model with the pooled model
xttobit y x i.a, ll(lower) ul(upper) tobit

Menu
Statistics > Longitudinal/panel data > Censored outcomes > Tobit regression (RE)

1
2 xttobit — Random-effects tobit models

Syntax
         
xttobit depvar indepvars if in weight , options

options Description
Model
noconstant
  suppress constant term
ll (varname | #) left-censoring variable or limit
 
ul (varname | #) right-censoring variable or limit
offset(varname) include varname in model with coefficient constrained to 1
constraints(constraints) apply specified linear constraints
SE
vce(vcetype) vcetype may be oim, bootstrap, or jackknife
Reporting
level(#) set confidence level; default is level(95)
tobit perform likelihood-ratio test comparing against pooled tobit model
lrmodel perform the likelihood-ratio model test instead of the default Wald test
nocnsreport do not display constraints
display options control columns and column formats, row spacing, line width,
display of omitted variables and base and empty cells, and
factor-variable labeling
Integration
intmethod(intmethod) integration method; intmethod may be mvaghermite (the default) or
ghermite
intpoints(#) use # quadrature points; default is intpoints(12)
Maximization
maximize options control the maximization process; seldom used
collinear keep collinear variables
coeflegend display legend instead of statistics
A panel variable must be specified; use xtset; see [XT] xtset.
indepvars may contain factor variables; see [U] 11.4.3 Factor variables.
depvar and indepvars may contain time-series operators; see [U] 11.4.4 Time-series varlists.
by, fp, and statsby are allowed; see [U] 11.1.10 Prefix commands.
iweights are allowed; see [U] 11.1.6 weight. Weights must be constant within panel.
collinear and coeflegend do not appear in the dialog box.
See [U] 20 Estimation and postestimation commands for more capabilities of estimation commands.

Options

 Model
noconstant; see [R] Estimation options.
   
ll (varname | #) and ul (varname | #) indicate the lower and upper limits for censoring, re-
spectively. Observations with depvar ≤ ll() are left-censored; observations with depvar ≥ ul()
are right-censored; and remaining observations are not censored. You do not have to specify the
xttobit — Random-effects tobit models 3

censoring values. If you specify ll, the lower limit is the minimum of depvar. If you specify ul,
the upper limit is the maximum of depvar.
offset(varname), constraints(constraints); see [R] Estimation options.

 SE
vce(vcetype) specifies the type of standard error reported, which includes types that are derived from
asymptotic theory (oim) and that use bootstrap or jackknife methods (bootstrap, jackknife);
see [XT] vce options.

 Reporting
level(#); see [R] Estimation options.
tobit specifies that a likelihood-ratio test comparing the random-effects model with the pooled (tobit)
model be included in the output.
lrmodel, nocnsreport; see [R] Estimation options.
display options: noci, nopvalues, noomitted, vsquish, noemptycells, baselevels,
allbaselevels, nofvlabel, fvwrap(#), fvwrapon(style), cformat(% fmt), pformat(% fmt),
sformat(% fmt), and nolstretch; see [R] Estimation options.

 Integration
intmethod(intmethod), intpoints(#); see [R] Estimation options.

 Maximization
 
maximize options: difficult, technique(algorithm spec), iterate(#), no log, trace,
gradient, showstep, hessian, showtolerance, tolerance(#), ltolerance(#),
nrtolerance(#), nonrtolerance, and from(init specs); see [R] Maximize. These options are
seldom used.

The following options are available with xttobit but are not shown in the dialog box:
collinear, coeflegend; see [R] Estimation options.

Remarks and examples stata.com


xttobit fits random-effects tobit models. There is no command for a fixed-effects model, because
there does not exist a sufficient statistic allowing the fixed effects to be conditioned out of the
likelihood.
Consider the linear regression model with panel-level random effects

yit = xit β + νi + it

for i = 1, . . . , n panels, where t = 1, . . . , ni . The random effects, νi , are i.i.d., N (0, σν2 ), and it
are i.i.d. N (0, σ2 ) independently of νi .
o
The observed data, yit , represent possibly censored versions of yit . If they are left-censored, all
o o
that is known is that yit ≤ yit . If they are right-censored, all that is known is that yit ≥ yit . If
o o
they are uncensored, yit = yit . If they are left-censored, yit is determined by ll(). If they are
o o
right-censored, yit is determined by ul(). If they are uncensored, yit is determined by depvar.
4 xttobit — Random-effects tobit models

Example 1: Random-effects tobit regression


Using the nlswork data described in [XT] xt, we fit a random-effects tobit model of adjusted (log)
wages. We use the ul() option to impose an upper limit on the recorded log of wages.
. use https://www.stata-press.com/data/r16/nlswork3
(National Longitudinal Survey. Young Women 14-26 years of age in 1968)
. xttobit ln_wage i.union age grade not_smsa south##c.year, ul(1.9) tobit
(output omitted )
Random-effects tobit regression Number of obs = 19,224
Uncensored = 12,334
Limits: lower = -inf Left-censored = 0
upper = 1.90 Right-censored = 6,890
Group variable: idcode Number of groups = 4,148
Random effects u_i ~ Gaussian Obs per group:
min = 1
avg = 4.6
max = 12
Integration method: mvaghermite Integration pts. = 12
Wald chi2(7) = 2925.68
Log likelihood = -6814.4606 Prob > chi2 = 0.0000

ln_wage Coef. Std. Err. z P>|z| [95% Conf. Interval]

1.union .1430527 .0069718 20.52 0.000 .1293883 .1567171


age .0099132 .0017516 5.66 0.000 .0064801 .0133464
grade .0784855 .0022764 34.48 0.000 .0740239 .0829472
not_smsa -.1339978 .009206 -14.56 0.000 -.1520413 -.1159544
1.south -.3507188 .0695554 -5.04 0.000 -.4870449 -.2143928
year -.0008285 .0018371 -0.45 0.652 -.0044292 .0027721

south#c.year
1 .0031938 .0008606 3.71 0.000 .0015071 .0048805

_cons .5101956 .1006646 5.07 0.000 .3128966 .7074946

/sigma_u .3045992 .0048344 63.01 0.000 .2951239 .3140745


/sigma_e .2488678 .0018254 136.34 0.000 .24529 .2524455

rho .5996844 .0084095 .583118 .6160734

LR test of sigma_u=0: chibar2(01) = 6650.63 Prob >= chibar2 = 0.000

The results from a tobit regression can be interpreted as we would those from a linear regression.
Because the dependent variable is log transformed, the coefficients can be interpreted in terms of a
percentage change. We see, for example, that on average, union members make 14.3% more than
nonunion members.
The output also includes the overall and panel-level variance components (labeled sigma e and
sigma u, respectively) together with ρ (labeled rho)
σν2
ρ=
σ2 + σν2
which is the percent contribution to the total variance of the panel-level variance component.
When rho is zero, the panel-level variance component is unimportant, and the panel estimator is
not different from the pooled estimator. A likelihood-ratio test of this is included at the bottom of
the output. This test formally compares the pooled estimator (tobit) with the panel estimator. In this
case, we reject the null hypothesis that there are no panel-level effects.
xttobit — Random-effects tobit models 5

Technical note
The random-effects model is calculated using quadrature, which is an approximation whose accuracy
depends partially on the number of integration points used. We can use the quadchk command to see
if changing the number of integration points affects the results. If the results change, the quadrature
approximation is not accurate given the number of integration points. Try increasing the number
of integration points using the intpoints() option and run quadchk again. Do not attempt to
interpret the results of estimates when the coefficients reported by quadchk differ substantially. See
[XT] quadchk for details and [XT] xtprobit for an example.
Because the xttobit likelihood function is calculated by Gauss–Hermite quadrature, on large
problems the computations can be slow. Computation time is roughly proportional to the number of
points used for the quadrature.

Stored results
xttobit stores the following in e():
Scalars
e(N) number of observations
e(N g) number of groups
e(N unc) number of uncensored observations
e(N lc) number of left-censored observations
e(N rc) number of right-censored observations
e(N cd) number of completely determined observations
e(k) number of parameters
e(k eq) number of equations in e(b)
e(k eq model) number of equations in overall model test
e(k dv) number of dependent variables
e(df m) model degrees of freedom
e(ll) log likelihood
e(ll 0) log likelihood, constant-only model
e(ll c) log likelihood, comparison model
e(chi2) χ2
e(chi2 c) χ2 for comparison test
e(rho) ρ
e(sigma u) panel-level standard deviation
e(sigma e) standard deviation of it
e(n quad) number of quadrature points
e(g min) smallest group size
e(g avg) average group size
e(g max) largest group size
e(p) p-value for model test
e(rank) rank of e(V)
e(rank0) rank of e(V) for constant-only model
e(ic) number of iterations
e(rc) return code
e(converged) 1 if converged, 0 otherwise
6 xttobit — Random-effects tobit models

Macros
e(cmd) xttobit
e(cmdline) command as typed
e(depvar) names of dependent variables
e(ivar) variable denoting groups
e(llopt) contents of ll()
e(ulopt) contents of ul()
e(k aux) number of auxiliary parameters
e(wtype) weight type
e(wexp) weight expression
e(title) title in estimation output
e(offset1) offset
e(chi2type) Wald or LR; type of model χ2 test
e(chi2 ct) Wald or LR; type of model χ2 test corresponding to e(chi2 c)
e(vce) vcetype specified in vce()
e(intmethod) integration method
e(distrib) Gaussian; the distribution of the random effect
e(opt) type of optimization
e(which) max or min; whether optimizer is to perform maximization or minimization
e(ml method) type of ml method
e(user) name of likelihood-evaluator program
e(technique) maximization technique
e(properties) b V
e(predict) program used to implement predict
e(marginsok) predictions allowed by margins
e(asbalanced) factor variables fvset as asbalanced
e(asobserved) factor variables fvset as asobserved
Matrices
e(b) coefficient vector
e(Cns) constraints matrix
e(ilog) iteration log
e(gradient) gradient vector
e(V) variance–covariance matrix of the estimators
Functions
e(sample) marks estimation sample

In addition to the above, the following is stored in r():


Matrices
r(table) matrix containing the coefficients with their standard errors, test statistics, p-values,
and confidence intervals

Note that results stored in r() are updated when the command is replayed and will be replaced when
any r-class command is run after the estimation command.

Methods and formulas


Assuming a normal distribution, N (0, σν2 ), for the random effects νi , we have the joint (unconditional
of νi ) density of the observed data from the ith panel
Z ∞ −ν 2 /2σ2 (Yni
)
o o e i ν
o
f (yi1 , . . . , yini
|xi1 , . . . , xini ) = √ F (yit , xit β + νi ) dνi
−∞ 2πσν t=1

where  √ −1 −(yo −∆ )2 /(2σ2 ) o



 2πσ e it it  if yit ∈C


  yo −∆ 
it o
o
F (yit , ∆it ) = Φ it σ if yit ∈L


  o 
 1 − Φ yit
 −∆it o
σ if yit ∈R
xttobit — Random-effects tobit models 7

where C is the set of noncensored observations, L is the set of left-censored observations, R is the
set of right-censored observations, and Φ() is the cumulative normal distribution.
The panel level likelihood li is given by
2 2
(n )

e−νi /2σν i
Z Y
o
li = √ F (yit , xit β + νi ) dνi
−∞ 2πσν t=1
Z ∞
o
≡ g(yit , xit , νi )dνi
−∞

This integral can be approximated with M -point Gauss–Hermite quadrature


Z ∞ M
2 X
e−x h(x)dx ≈ ∗
wm h(a∗m )
−∞ m=1

This is equivalent to
Z ∞ M
X

exp (a∗m )2 f (a∗m )

f (x)dx ≈ wm
−∞ m=1

where the wm denote the quadrature weights and the a∗m denote the quadrature abscissas. The log
likelihood, L, is the sum of the logs of the panel level likelihoods li .
The default approximation of the log likelihood is by adaptive Gauss–Hermite quadrature, which
approximates the panel level likelihood with
M
√ X


exp (a∗m )2 g(yit
o
σi a∗m + µ

li ≈ 2b
σi wm , xit , 2b bi )
m=1

o
where σbi and µbi are the adaptive parameters for panel i. Therefore, with the definition of g(yit , xit , νi ),
the total log likelihood is approximated by
n M  √
√ σi a∗m + µ

 ∗ 2 exp −( 2b bi )2 /2σν2
X  X

L≈ wi log 2b
σi wm exp (am ) √
i=1 m=1
2πσν
ni

Y 
o
F (yit , xit β + σi a∗m
2b +µ
bi ) (1)
t=1

where wi is the user-specified weight for panel i; if no weights are specified, wi = 1.


The default method of adaptive Gauss–Hermite quadrature is to calculate the posterior mean and
variance and use those parameters for µ
bi and σ
bi by following the method of Naylor and Smith (1982),
further discussed in Skrondal and Rabe-Hesketh (2004). We start with σ bi,0 = 1 and µ bi,0 = 0, and
the posterior means and variances are updated in the k th iteration. That is, at the k th iteration of the
optimization for li we use

M
X √ ∗

exp a∗m )2 g(yit σi,k−1 a∗m + µ
 o
li,k ≈ 2b
σi,k−1 wm , xit , 2b bi,k−1 )
m=1
8 xttobit — Random-effects tobit models

Letting √
τi,m,k−1 = σi,k−1 a∗m + µ
2b bi,k−1

M √ ∗
exp (a∗m )2 g(yit
 o
X 2b
σi,k−1 wm , xit , τi,m,k−1 )
µ
bi,k = (τi,m,k−1 )
m=1
l i,k

and √
M ∗
exp (a∗m )2 g(yit
 o
X
2 2b
σi,k−1 wm , xit , τi,m,k−1 ) 2
σ
bi,k = (τi,m,k−1 ) − (b
µi,k )
m=1
li,k

and this is repeated until µ


bi,k and σ
bi,k have converged for this iteration of the maximization algorithm.
This adaptation is applied on every iteration until the log-likelihood change from the preceding iteration
is less than a relative difference of 1e–6; after this, the quadrature parameters are fixed.
The log likelihood can also be calculated by nonadaptive Gauss–Hermite quadrature if the
intmethod(ghermite) option is specified. For nonadaptive Gauss–Hermite quadrature, the following
formula for the log likelihood is used in place of (1).
n
X n o
L= wi log Pr(yi1 , . . . , yini |xi1 , . . . , xini )
i=1
n
" M ni
#
X 1 X ∗ Y n √ o
≈ wi log √ wm o
F yit , xit β + 2σν a∗m
i=1
π m=1 t=1

Both quadrature formulas require that the integrated function be well approximated by a polynomial
of degree equal to the number of quadrature points. Panel size can affect whether
ni
Y
o
F (yit , xit β + νi )
t=1

is well approximated by a polynomial. As panel size and ρ increase, the quadrature approximation can
become less accurate. For large ρ, the random-effects model can also become unidentified. Adaptive
quadrature gives better results for correlated data and large panels than nonadaptive quadrature;
however, we recommend that you use the quadchk command (see [XT] quadchk) to verify the
quadrature approximation used in this command, whichever approximation you choose.

References
Naylor, J. C., and A. F. M. Smith. 1982. Applications of a method for the efficient computation of posterior
distributions. Journal of the Royal Statistical Society, Series C 31: 214–225.
Pendergast, J. F., S. J. Gange, M. A. Newton, M. J. Lindstrom, M. Palta, and M. R. Fisher. 1996. A survey of
methods for analyzing clustered binary response data. International Statistical Review 64: 89–118.
Skrondal, A., and S. Rabe-Hesketh. 2004. Generalized Latent Variable Modeling: Multilevel, Longitudinal, and
Structural Equation Models. Boca Raton, FL: Chapman & Hall/CRC.
xttobit — Random-effects tobit models 9

Also see
[XT] xttobit postestimation — Postestimation tools for xttobit
[XT] quadchk — Check sensitivity of quadrature approximation
[XT] xteintreg — Extended random-effects interval regression
[XT] xtintreg — Random-effects interval-data regression models
[XT] xtreg — Fixed-, between-, and random-effects and population-averaged linear models
[XT] xtset — Declare data to be panel data
[ME] metobit — Multilevel mixed-effects tobit regression
[R] tobit — Tobit regression
[U] 20 Estimation and postestimation commands

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy