Title

stjm postestimation-- Post-estimation tools for stjm

DescriptionThe 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

predictpredictions, residuals etc INCLUDE help post_predictnl INCLUDE help post_test INCLUDE help post_testnl -------------------------------------------------------------------------

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

predictnewvar[if] [in] [,statisticoptions]

statisticDescription ------------------------------------------------------------------------- Longitudinallongitudinallongitudinal submodelresidualslongitudinal residuals, response minus fitted valuesrstandardstandardised residualsSurvival

hazardhazardsurvivalsurvival S(t)cumhazardcumulative hazardmartingalemartingale-like residualsdeviancedeviance residualsRandom effects

reffectsbest linear unbiased predictions (BLUPS) of the random effectsresesstandard errors of the best linear unbiased predictions (BLUPS) of the random effects -------------------------------------------------------------------------

optionsDescription -------------------------------------------------------------------------xbsee description belowfittedfitted values, linear predictor of the fixed portion plus contributions based on predicted random effectsm(#)number of draws from the estimated random effects variance-covariance matrix in survival sub-model predictionsat(varname #[varname #...])predict at values of specified covariatescicalculate confidence intervalstimevar(varname)time variable used for predictions (defaults:_t0for longitudinal sub-model,_tfor survival sub-model)meastimeevaluate predictions at measurements,_t0survtimeevaluate predictions at survival times,_tzerossets all covariates to zero (baseline prediction)level(#)sets confidence level (default 95) ------------------------------------------------------------------------- Statistics are available both in and out of sample; typepredict...ife(sample)...if wanted only for the estimation sample.

Options for predict+--------------+ ----+ Longitudinal +-----------------------------------------------------

longitudinalpredicts the fitted values for the longitudinal submodel. Ifxbis specified (the default) then only contributions from the fixed portion of the model are included. Iffittedis specified then estimates of the random effects are also included.

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

rstandardcalculates standardized residuals, equal to the residuals multiplied by the inverse square root of the estimated error covariance matrix.+----------+ ----+ Survival +---------------------------------------------------------

hazardcalculates the predicted hazard.

survivalcalculates each observation's predicted survival probability.

cumhazardcalculates the predicted cumulative hazard.

martingalecalculates martingale-like residuals.

deviancecalculates deviance residuals.+----------------+ ----+ Random effects +---------------------------------------------------

reffectscalculates 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.

reffectscalculates 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 +-------------------------------------------------------

xbspecifies predictions based on the fixed portion of the model when a longitudinal option is chosen. When the prediction option ishazard,survivalorcumhazard, the predictions are based on the average of the fixed portion plusmdraws from the estimated random effects variance-covariance matrix.

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

mspecifies the number of draws from the estimated random effects variance-covariance matrix in survival sub-model predictions whenxbis chosen.

at(varname #[varname #...])requests that the covariates specified by the listedvarname(s) be set to the listed#values. For example,at(x1 1 x3 50)would evaluate predictions atx1= 1 andx3= 50. This is a useful way to obtain out of sample predictions. Note that ifat()is used together withzerosall covariates not listed inat()are set to zero. Ifat()is used withoutzerosthen all covariates not listed inat()are set to their sample values. See alsozeros.

cicalculate a confidence interval for the requested statistic and stores the confidence limits innewvar_lciandnewvar_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 theat()option and/or thezerosoption to define the covariate patterns for which you require the predictions.

meastimeevaluate predictions at measurement times i.e._t0.

survtimeevaluate predictions at survival times i.e._t.

zerossets all covariates to zero (baseline prediction). For example,predict s0, survival zeroscalculates the baseline survival function. See alsoat().

level(#)sets the confidence level; default islevel(95)or as set bysetlevel.

ExampleLoad 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. . stjm long_response, panel(id) survmodel(weibull) gh(5) ffp(1)

Predict survival. . predict s1, survival

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