* Chapter 6: Model Diagnostics using Stata . * Fit Model 6.3 (final model) using REML estimation . xi: xtmixed vsae i.sicdegp*age_2 age_2sq, || childid: age_2 age_2sq, noconst covariance(unstruct) variance **************************************************************************************. * Plot standardized conditional residuals vs. fitted values for each level of SICDEGP . **************************************************************************************. predict stresid, rstandard predict fitted, fitted twoway (scatter stresid fitted), by(sicdegp) **************************************************************************. * Assess whether variance of conditional residuals is constant across ages. **************************************************************************. predict resid, resid scatter resid age_2 ******************************************************. * Assess normality of residuals within each SICD group. ******************************************************. qnorm resid if sicdegp == 1 qnorm resid if sicdegp == 2 qnorm resid if sicdegp == 3 ******************************************************. * Generate Q-Q plots of EBLUPs of random child effects. ******************************************************. predict raneffs*, reffects qnorm raneffs1 qnorm raneffs2 ********************************************************. * Generate scatterplots of EBLUPs within each SICD group. ********************************************************. twoway (scatter raneffs2 raneffs1), by(sicdegp) ***********************************************************. * Plot conditional predicted values vs. actual VSAE values, * within each SICD group. ***********************************************************. twoway (scatter vsae fitted), by(sicdegp)