help tpm postestimation also see: tpm -------------------------------------------------------------------------------

tpm postestimation -- Postestimation tools for tpm

Description

The following postestimation commands are available for tpm:

command description ------------------------------------------------------------------------- predict predictions INCLUDE help post_estat INCLUDE help post_estimates INCLUDE help post_lincom INCLUDE help post_lrtest INCLUDE help post_margins INCLUDE help post_nlcom INCLUDE help post_predictnl INCLUDE help post_test INCLUDE help post_testnl -------------------------------------------------------------------------

Syntax for predict

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

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

options Description ------------------------------------------------------------------------- Main normal uses normal theory retransformation to obtain fitted values. duan uses Duan's smearing retransformation to obtain fitted values. scores calculate first derivative of the log likelihood with respect to xb

Options 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

+------+ ----+ Main +-------------------------------------------------------------

normal uses normal theory retransformation to obtain fitted values when a linear regression of the log of the second part outcome is estimated. It is the default if no option is specified.

duan uses Duan's smearing retransformation to obtain fitted values when a linear regression of the log of the second part outcome is estimated.

scores create a score variable for each equation (part) in the model. Since the score for the second part of the model make sense only with respect to the estimation subsample (where Y>0), the calculation is automatically restricted to the estimation subsample.

+---------+ ----+ Options +----------------------------------------------------------

nooffset may be combined with most statistics and specifies that the calculation should be made, ignoring any offset or exposure variable specified when the model was fit.

If neither the offset(varname_o) option nor the exposure(varname_e) option was specified when the model was fit, specifying nooffset does nothing.

Remarks Retransformation after OLS regression of ln(depvar) is needed to obtain consistent predictions of depvar. tpm implements this using normal theory and smearing retransformations but both assume that the errors in the regression are homoscedastic. Retransformation in the case of heteroscedastic errors is conceptually complex and we have not implemented it in tpm. We suggest the gamma GLM with log link as an alternative to a regression of ln(depvar).

Examples

Setup . webuse womenwk, clear . replace wage = 0 if wage==.

Two part model with logit and glm with Gaussian family and identity link . tpm wage educ age married children, first(logit) second(glm) . predict wagehat1 Two part model with probit and glm with gamma family and log link . tpm wage educ age married children, f(probit) s(glm, fam(gamma) link(log)) . margins, dydx(*)

Two part model with probit and linear regression . tpm wage educ age married children, f(probit) s(regress) . margins, dydx(*)

Two part model with probit and linear regression of log(depvar>0) . tpm wage educ age married children, f(probit) s(regress, log) . margins, dydx(*) . margins, predict(duan) dydx(*)