-------------------------------------------------------------------------------
help stjm11 postestimation                          also see: stjm11, stjmgraph
-------------------------------------------------------------------------------

Title

stjm11 postestimation -- Post-estimation tools for stjm11

Description

The following standard post-estimation commands are available:

command description ------------------------------------------------------------------------- INCLUDE help post_estat INCLUDE help post_estimates INCLUDE help post_lincom INCLUDE help post_lrtest INCLUDE help post_nlcom predict predictions, residuals etc INCLUDE help post_predictnl INCLUDE help post_test INCLUDE help post_testnl -------------------------------------------------------------------------

Syntax for predict

Syntax for obtaining best linear unbiased predictions (BLUPs) of random effects, or the BLUPs' standard errors

predict {stub*|newvarlist} , {reffects | reses}

Syntax for obtaining other predictions

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

statistic Description ------------------------------------------------------------------------- Longitudinal longitudinal longitudinal submodel residuals longitudinal residuals, response minus fitted values rstandard standardised residuals

Survival hazard hazard survival survival S(t) cumhazard cumulative hazard martingale martingale-like residuals deviance deviance residuals

Random effects reffects best linear unbiased predictions (BLUPS) of the random effects reses standard errors of the best linear unbiased predictions (BLUPS) of the random effects -------------------------------------------------------------------------

options Description ------------------------------------------------------------------------- xb see description below fitted fitted values, linear predictor of the fixed portion plus contributions based on predicted random effects m(#) number of draws from the estimated random effects variance-covariance matrix in survival sub-model predictions at(varname # [varname # ...]) predict at values of specified covariates ci calculate confidence intervals timevar(varname) time variable used for predictions (defaults: _t0 for longitudinal sub-model, _t for survival sub-model) meastime evaluate predictions at measurements, _t0 survtime evaluate predictions at survival times, _t zeros sets all covariates to zero (baseline prediction) level(#) sets confidence level (default 95) ------------------------------------------------------------------------- Statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted only for the estimation sample.

Options for predict

+--------------+ ----+ Longitudinal +-----------------------------------------------------

longitudinal predicts the fitted values for the longitudinal submodel. If xb is specified (the default) then only contributions from the fixed portion of the model are included. If fitted is specified then estimates of the random effects are also included.

residuals calculates residuals, equal to the longitudinal response minus fitted values. By default, the fitted values take into account the random effects.

rstandard calculates standardized residuals, equal to the residuals multiplied by the inverse square root of the estimated error covariance matrix.

+----------+ ----+ Survival +---------------------------------------------------------

hazard calculates the predicted hazard.

survival calculates each observation's predicted survival probability.

cumhazard calculates the predicted cumulative hazard.

martingale calculates martingale-like residuals.

deviance calculates deviance residuals.

+----------------+ ----+ Random effects +---------------------------------------------------

reffects calculates best linear unbiased predictions (BLUPs) of the random effects. You must specify q new variables, where q is the number of random effects terms in the model (or level). However, it is much easier to just specify stub* and let Stata name the variables stub1...stubq for you.

reffects calculates the standard errors of the best linear unbiased predictions (BLUPs) of the random effects. You must specify q new variables, where q is the number of random effects terms in the model (or level). However, it is much easier to just specify stub* and let Stata name the variables stub1...stubq for you.

+------------+ ----+ Subsidiary +-------------------------------------------------------

xb specifies predictions based on the fixed portion of the model when a longitudinal option is chosen. When the prediction option is hazard, survival or cumhazard, the predictions are based on the average of the fixed portion plus m draws from the estimated random effects variance-covariance matrix.

fitted linear predictor of the fixed portion plus contributions based on predicted random effects.

m specifies the number of draws from the estimated random effects variance-covariance matrix in survival sub-model predictions when xb is chosen.

at(varname # [ varname # ...]) requests that the covariates specified by the listed varname(s) be set to the listed # values. For example, at(x1 1 x3 50) would evaluate predictions at x1 = 1 and x3 = 50. This is a useful way to obtain out of sample predictions. Note that if at() is used together with zeros all covariates not listed in at() are set to zero. If at() is used without zeros then all covariates not listed in at() are set to their sample values. See also zeros.

ci calculate a confidence interval for the requested statistic and stores the confidence limits in newvar_lci and newvar_uci.

timevar(varname) defines the variable used as time in the predictions. This is useful for large datasets where for plotting purposes predictions are only needed for 200 observations for example. Note that some caution should be taken when using this option as predictions may be made at whatever covariate values are in the first 200 rows of data. This can be avoided by using the at() option and/or the zeros option to define the covariate patterns for which you require the predictions.

meastime evaluate predictions at measurement times i.e. _t0.

survtime evaluate predictions at survival times i.e. _t.

zeros sets all covariates to zero (baseline prediction). For example, predict s0, survival zeros calculates the baseline survival function. See also at().

level(#) sets the confidence level; default is level(95) or as set by set level.

Example

Load simulated example dataset: . use http://fmwww.bc.edu/repec/bocode/s/stjm_example

stset the data: . stset stop, enter(start) f(event=1) id(id)

Joint model with a random intercept in the longitudinal submodel, and association based on the current value. No covariates in either submodel. . stjm11 long_response, panel(id) survmodel(weibull) gh(5) ffracpoly(1)

Predict the marginal survival function. . predict s1, survival

Predict the longitudinal fitted values including fixed effects and contributions from the random effects. . predict longfitvals, longitudinal fitted

Also see

Online: stjm11; stjmgraph