如果是stata14,已经有hurdle模型命令了
www.stata.com/manuals14/rchurdle.pdf
Title
[R] churdle -- Cragg hurdle regression
Syntax
Basic syntax
churdle linear depvar, select(varlist_s) {ll(...) | ul(...)}
churdle exponential depvar, select(varlist_s) ll(...)
Full syntax for churdle linear
churdle linear depvar [indepvars] [if] [in] [weight], select(varlist_s[, noconstant het(varlist_o)]) {ll(#|varname) | ul(#|varname)} [options]
Full syntax for churdle exponential
churdle exponential depvar [indepvars] [if] [in] [weight], select(varlist_s[, noconstant het(varlist_o)]) ll(#|varname) [options]
options Description
-----------------------------------------------------------------------------------------------------------------------------------------------------
Model
* select() specify independent variables and options for selection model
+ ll(#|varname) lower truncation limit
+ ul(#|varname) upper truncation limit
noconstant suppress constant term
constraints(constraints) apply specified linear constraints
het(varlist) specify variables to model the variance
SE/Robust
vce(vcetype) vcetype may be oim, robust, cluster clustvar, bootstrap, or jackknife
Reporting
level(#) set confidence level; default is level(95)
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
Maximization
maximize_options control the maximization process; seldom used
coeflegend display legend instead of statistics
-----------------------------------------------------------------------------------------------------------------------------------------------------
* select() is required. The full specification is
select(varlist_s[, noconstant het(varlist_o)])
noconstant specifies that the constant be excluded from the selection model. het(varlist_o) specifies the variables in the error-variance function
of the selection model.
+ You must specify at least one of ul(#|varname) or ll(#|varname) for the linear model and must specify ll(#|varname) for the exponential model.
indepvars, varlist_s, and varlist_o may contain factor variables; see fvvarlist.
bootstrap, by, fp, jackknife, rolling, statsby, and svy are allowed; see prefix.
Weights are not allowed with the bootstrap prefix.
vce() and weights are not allowed with the svy prefix.
fweights, iweights, and pweights are allowed; see weight.
coeflegend does not appear in the dialog box.
See [R] churdle postestimation for features available after estimation.
Menu
Statistics > Linear models and related > Hurdle regression
Description
churdle fits a linear or exponential hurdle model for a bounded dependent variable. The hurdle model combines a selection model that determines the
boundary points of the dependent variable with an outcome model that determines its nonbounded values. Separate independent covariates are permitted
for each model.
Options
+-------+
----+ Model +----------------------------------------------------------------------------------------------------------------------------------------
select(varlist_s[, noconstant het(varlist_o)]) specifies the variables and options for the selection model. select() is required.
ll(#|varname) and ul(#|varname) indicate the lower and upper limits, respectively, for the dependent variable. You must specify one or both for the
linear model and must specify a lower limit for the exponential model. Observations with depvar <= ll() have a lower bound; observations with
depvar >= ul() have an upper bound; and the remaining observations are in the continuous region.
noconstant, constraints(constraints); see [R] estimation options.
het(varlist) specifies the variables in the error-variance function of the outcome model.
+-----------+
----+ SE/Robust +------------------------------------------------------------------------------------------------------------------------------------
vce(vcetype) specifies the type of standard error reported, which includes types that are derived from asymptotic theory (oim), that are robust to
some kinds of misspecification (robust), that allow for intragroup correlation (cluster, clustvar), and that use bootstrap or jackknife methods
(bootstrap, jackknife); see [R] vce_option.
+-----------+
----+ Reporting +------------------------------------------------------------------------------------------------------------------------------------
level(#), 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.
+--------------+
----+ 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 option is available with churdle but is not shown in the dialog box:
coeflegend; see [R] estimation options.
Examples
-------------------------------------------------------------------------------------------------------------------------------------------------------
Setup
. webuse fitness
Cragg hurdle linear regression
. churdle linear hours age i.smoke distance i.single, select(commute whours age) ll(0)
Average marginal effect of age
. margins, dydx(age)
Cragg hurdle linear regression with a model for the variance
. churdle linear hours age i.smoke distance i.single, select(commute whours age, het(age single)) ll(0)
Cragg hurdle exponential regression
. churdle exponential hours age i.smoke distance i.single, select(commute whours age) ll(0) nolog
Average marginal effect of age
. margins, dydx(age)
-------------------------------------------------------------------------------------------------------------------------------------------------------
Setup
. webuse nhanes2f, clear
. svyset psuid [pweight=finalwgt], strata(stratid)
Cragg hurdle linear regression with survey data
. svy: churdle linear finalwgt i.female copper, ll(2000) select(highbp agegrp)
-------------------------------------------------------------------------------------------------------------------------------------------------------