To use PROC MIANALYZE to combine the covariance parameter estimates from PROC MIXED, sort the CovParms data set by the variable COVPARM before invoking MIANALYZE. If you use the SUBJECT= option in the RANDOM statement of PROC MIXED, use a DATA step to create a variable that concatenates the COVPARM and SUBJECT variables, then sort the data set by this new variable before invoking MIANALYZE.
This example comes from a pharmaceutical stability data simulation performed by Obenchain (1990). The observed responses are replicate assay results (in percent of label claim) at various shelf ages (in months).
data rc;
input Batch Month @@;
do i = 1 to 6;
input Y @@;
output;
end;
datalines;
1 0 101.2 103.3 103.3 102.1 104.4 102.4
1 1 98.8 99.4 99.7 99.5 . .
1 3 98.4 99.0 97.3 99.8 . .
1 6 101.5 100.2 101.7 102.7 . .
1 9 96.3 97.2 97.2 96.3 . .
1 12 97.3 97.9 96.8 97.7 97.7 96.7
2 0 102.6 102.7 102.4 102.1 102.9 102.6
2 1 99.1 99.0 99.9 100.6 . .
2 3 105.7 103.3 103.4 104.0 . .
2 6 101.3 101.5 100.9 101.4 . .
2 9 94.1 96.5 97.2 95.6 . .
2 12 93.1 92.8 95.4 92.2 92.2 93.0
3 0 105.1 103.9 106.1 104.1 103.7 104.6
3 1 102.2 102.0 100.8 99.8 . .
3 3 101.2 101.8 100.8 102.6 . .
3 6 101.1 102.0 100.1 100.2 . .
3 9 100.9 99.5 102.2 100.8 . .
3 12 97.8 98.3 96.9 98.4 96.9 96.5
;
PROC MI is invoked to perform mutiple imputation of Y using the monotone regression method.
proc mi data=rc out=rc_impute seed=123;
class batch;
monotone regression(y=month batch);
var batch month y;
run;
In this example of PROC MIXED, the SUBJECT= option in the RANDOM statement is not used.
proc mixed data=rc_impute covtest;
by _imputation_;
model Y =;
random Month;
ods output covparms=cvparms1;
run;
The following step sorts the CovParms data set by the COVPARM variable.
proc sort data=cvparms1; by covparm; run;
PROC MIANALYZE can then be invoked using the COVPARM variable in the BY statement.
proc mianalyze data=cvparms1;
by covparm;
modeleffects estimate;
stderr stderr;
run;
In this example, the model in PROC MIXED uses the SUBJECT= option in the RANDOM statement.
proc mixed data=rc_impute covtest;
by _imputation_;
class Batch;
model y = Month;
random Int Month / type=un sub=Batch s;
ods output covparms=cvparms;
run;
The following DATA step creates a new variable, COVPARM2, that concatenates the COVPARM and SUBJECT variables. The resulting data set is then sorted by the new variable.
data cvparms;
set cvparms;
covparm2=covparm||subject;
run;
proc sort data=cvparms;
by covparm2;
run;
PROC MIANALYZE can then be invoked using the new variable in the BY statement.
proc mianalyze data=cvparms;
by covparm2;
modeleffects estimate;
stderr stderr;
run;