help twopm postestimation (SJ15-1: st0368)

Title

twopm postestimation -- Postestimation tools for twopm

Description

The following postestimation commands are available for twopm:

command description

estat AIC, BIC, VCE, and estimation sample summary

predict predictions

Syntax for predict

predict [type] newvar [if] [in], [options]

predict [type] {stub*|newvar1 ... newvarq}
[if] [in], scores

options

normal normal theory retransformation to obtain fitted values

duan Duan's smearing retransformation to obtain fitted values

scores calculate first derivative of the log likelihood with respect to xb

nooffset ignore any offset() or exposure() variable

Description

predict returns E(depvar|indepvar). In particular, the
combined prediction is computed as the product of the probability of a
positive outcome (first part) and the expected value of Y | Y>0 (second
part). This statistic is available both in and out of sample; type
predict ... if e(sample) ... if wanted only for the
estimation sample.

Options for predict

normal uses normal theory retransformation to obtain fitted
values. Either normal or duan must be specified when a
linear regression of the log of the second-part outcome is
estimated.

duan uses Duan's smearing retransformation to obtain fitted
values. Either normal or duan must be specified when a
linear regression of the log of the second-part outcome is
estimated.

scores creates a score variable for each part in the
model. Because the score for the second part of the model makes sense only
for the estimation subsample (where Y>0), the calculation is
automatically restricted to the estimation subsample.

nooffset specifies that the calculation should be made ignoring
any offset or exposure variable specified when fitting the model. This
may be used with most statistics.

If neither the offset(varname) option nor the
exposure(varname) option is specified when fitting the model,
specifying nooffset does nothing.

Remarks

Retransformation after ordinary least-squares regression of ln(depvar) is
needed to obtain consistent predictions of depvar. twopm
implements this using normal theory and smearing retransformations, but both
assume that the errors in the regression are homoskedastic. Retransformation
with heteroskedastic errors is conceptually complex, and we have not
implemented it in twopm. We suggest the gamma generalized linear model
(glm) with log link as an alternative to a regression of
ln(depvar).

Examples

Setup

. webuse womenwk

. replace wage = 0 if wage==.

Two-part model with logit and glm with Gaussian family and identity link

. twopm wage educ age married children, firstpart(logit) secondpart(glm)

. predict wagehat1

Two-part model with probit and glm with gamma family and log link

. twopm wage educ age married children, firstpart(probit) secondpart(glm, family(gamma) link(log))

. margins, dydx(*)

Two-part model with probit and linear regression

. twopm wage educ age married children, firstpart(probit) secondpart(regress)

. margins, dydx(*)

Two-part model with probit and linear regression of log(depvar>0)

. twopm wage educ age married children, firstpart(probit) secondpart(regress, log)

. margins, predict(duan) dydx(*)

Authors

Federico Belotti

Centre for Economic and International Studies

University of Rome Tor Vergata

Rome, Italy

federico.belotti@uniroma2.it

Partha Deb

Hunter College and Graduate Center, CUNY

New York, NY

and National Bureau of Economic Research

Cambridge, MA

partha.deb@hunter.cuny.edu

Willard G. Manning

University of Chicago

Chicago, IL

w-manning@uchicago.edu

Edward C. Norton

University of Michigan

Ann Arbor, MI

and National Bureau of Economic Research

Cambridge, MA

ecnorton@umich.edu

Also see

Article: Stata Journal, volume 15, number 1: st0368

Help: twopm (if installed)