Analysis of the dental study data by fitting a random coefficient model in time using PROC MIXED. - the repeated measurement factor is age (time) - there is one "treatment" factor, gender The model for each child is assumed to be a straight line. The intercepts and slopes may have different means depending on gender, with the same covariance matrix D for each gender. We use the RANDOM and REPEATED statements to fit models that make several different assumptions about the forms of the matrices Ri and D. *******************************************************************/ options ls=80 ps=59 nodate; run; /****************************************************************** Read in the data set (See Example 1 of Chapter 4) *******************************************************************/ data dent1; infile 'dental.dat'; input obsno child age distance gender; run; /******************************************************************* Use PROC MIXED to fit the random coefficient model via the RANDOM statement. For all of the fits, we use usual normal ML rather than REML (the default). In all cases, we use the usual parameterization for the mean model. The SOLUTION option in the MODEL statement requests that the estimates of the regression parameters be printed. The G and GCORR options in the RANDOM statement asks that the D matrix and the corresponding correlation matrix it implies be printed. The V and VCORR options ask that the overall Sigma matrix be printed (for the first subject or particular subjects). To fit a random coefficient model, we must specify that both intercept and slope are random in the RANDOM statement. If no REPEATED statement appears, then PROC MIXED assumes that Ri = sigma^2*I. Otherwise, we use a REPEATED statement to set a structure for Ri with the TYPE = option. *******************************************************************/ * MODEL (i); * Ri = diagonal with constant variance sigma^2 same in both genders; * No REPEATED statement necessary to fit this Ri (default); * D = (2x2) unstructured matrix same for both genders; * Specified in the RANDOM statement; title 'RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD'; title2 'COVARIANCE MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER'; title3 'SAME D MATRIX FOR BOTH GENDERS'; proc mixed method=ml data=dent1; class gender child; model distance = gender gender*age / noint solution; random intercept age / type=un subject=child g gcorr v vcorr; estimate 'diff in mean slope' gender 0 0 gender*age 1 -1; contrast 'overall gender diff' gender 1 -1, gender*age 1 -1 /chisq; run; * MODEL (ii); * Fit the same model but with a separate diagonal Ri matrix for; * each gender. Thus, there are 2 separate variances sigma^2_(G and B); * D still = (2x2) unstructured matrix same for both genders; * Specified in the RANDOM statement; title 'RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD'; title2 'COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER'; title3 'SAME D MATRIX FOR BOTH GENDERS'; proc mixed method=ml data=dent1; class child gender; model distance = gender gender*age / noint solution; repeated / group=gender subject=child; random intercept age / type=un subject=child g gcorr v vcorr; estimate 'diff in mean slope' gender 0 0 gender*age 1 -1; contrast 'overall gender diff' gender 1 -1, gender*age 1 -1 /chisq; run; * MODEL (iii); * Ri is AR(1) with the same variance and rho value for each gender; * Specified in the REPEATED statement; * D still = (2x2) unstructured matrix same for both genders; * Specified in the RANDOM statement; title 'RANDOM COEFFICIENT MODEL WITH AR(1) WITHIN-CHILD'; title2 'CORRELATION MATRIX WITH CONSTANT VARIANCE SAME FOR EACH GENDER'; title3 'SAME D MATRIX FOR BOTH GENDERS'; proc mixed method=ml data=dent1; class gender child ; model distance = gender gender*age / noint solution ; random intercept age / type=un subject=child g gcorr v vcorr; repeated / type=ar(1) subject=child rcorr; estimate 'diff in mean slope' gender 0 0 gender*age 1 -1; contrast 'overall gender diff' gender 1 -1, gender*age 1 -1 /chisq; run; * MODEL (iv); * Fit the same model but with a separate diagonal Ri matrix for; * each gender. Thus, there are 2 separate variances sigma^2_(G and B); * D still = (2x2) unstructured matrix differs across genders; * Specified in the RANDOM statement by the GROUP=GENDER option; title 'RANDOM COEFFICIENT MODEL WITH DIAGONAL WITHIN-CHILD'; title2 'COVARIANCE MATRIX WITH SEPARATE CONSTANT VARIANCE FOR EACH GENDER'; title3 'DIFFERENT D MATRIX FOR BOTH GENDERS'; proc mixed method=ml data=dent1; class child gender; model distance = gender gender*age / noint solution; repeated / group=gender subject=child; random intercept age / type=un group=gender subject=child g gcorr v vcorr; estimate 'diff in mean slope' gender 0 0 gender*age 1 -1; contrast 'overall gender diff' gender 1 -1, gender*age 1 -1 /chisq; run;