12.3 - Using Technology: Psychiatry Example

The SAS code given below will run a repeated measures ANCOVA in SAS for the psychiatry example from section 12.2. 

data FCS;
infile datalines delimiter='09'x;
input per seq drug $ pat FCS x1 x2;
datalines;
1	1	A	1	41	0	0
1	1	A	2	46	0	0
1	2	B	1	35	0	0
1	2	B	2	42	0	0
1	3	C	1	46	0	0
1	3	C	2	52	0	0
1	4	A	1	65	0	0
1	4	A	2	69	0	0
1	5	B	1	61	0	0
1	5	B	2	66	0	0
1	6	C	1	52	0	0
1	6	C	2	37	0	0
2	1	B	1	52	1	0
2	1	B	2	54	1	0
2	2	C	1	33	0	1
2	2	C	2	36	0	1
2	3	A	1	46	-1	-1
2	3	A	2	47	-1	-1
2	4	C	1	39	1	0
2	4	C	2	42	1	0
2	5	A	1	48	0	1
2	5	A	2	50	0	1
2	6	B	1	47	-1	-1
2	6	B	2	49	-1	-1
3	1	C	1	44	0	1
3	1	C	2	48	0	1
3	2	A	1	48	-1	-1
3	2	A	2	50	-1	-1
3	3	B	1	38	1	0
3	3	B	2	41	1	0
3	4	B	1	42	-1	-1
3	4	B	2	45	-1	-1
3	5	C	1	42	1	0
3	5	C	2	46	1	0
3	6	A	1	49	0	1
3	6	A	2	52	0	1
;
run;
 
/*Obtaining fit Statistics*/
proc mixed data=FCS;
  class per seq drug pat;
  model FCS = per drug seq x1 x2/ddfm=kr;
  repeated per / subject=pat(seq) type=cs rcorr;
  ods output FitStatistics=FitCS (rename=(value=CS)) FitStatistics=FitCSp; 
  title 'Compound Symmetry'; 
run; 
 
proc mixed data=FCS;
  class per seq drug pat;
  model FCS = per drug seq x1 x2/ddfm=kr;
  repeated per / subject=pat(seq) type=AR(1) rcorr;
  ods output FitStatistics=FitAR1 (rename=(value=AR1)) FitStatistics=FitAR1p; 
  title 'Autoregressive Lag 1'; 
run; 
 
proc mixed data=FCS;
  class per seq drug pat;
  model FCS = per drug seq x1 x2/ddfm=kr;
  repeated per / subject=pat(seq) type=UN rcorr;
  ods output FitStatistics=FitUN (rename=(value=UN)) FitStatistics=FitUNp; 
 title 'Unstructured'; 
run; 
 
proc mixed data=FCS;
  class per seq drug pat;
  model FCS = per drug seq x1 x2/ddfm=kr;
  repeated per / subject=pat(seq) type=CSH rcorr;
  ods output FitStatistics=FitCSH (rename=(value=CSH)) FitStatistics=FitCSHp; 
  title 'HETEROGENOUS COMPOUND SYMMETRY'; 
run; 
 
data fits; 
 merge FitCS FitAR1 FitUN FITCSH; 
 by descr; 
run; 
ods listing; title 'Summerized Fit Statistics'; run;
proc print data=fits; run;
 
/* Model Adjusting for carryover effects */
proc mixed data= FCS;
  class per seq drug pat;
  model FCS = per drug seq x1 x2/ddfm=kr;
  repeated per / subject=pat(seq) type=UN;
  store out_FCS;
 run;
 
proc plm restore=out_FCS;
  lsmeans drug / adjust=tukey plot=meanplot cl lines;
  ods exclude diffs diffplot;
run;
 
/* Reduced Model, Ignoring carryover effects */
proc mixed data= FCS;
  class per seq drug pat;
  model FCS = per drug seq/ddfm=kr;
  repeated per / subject=pat(seq) type=UN;
  lsmeans drug / pdiff adjust=tukey;
run;

The results of the fit statistics are as follows:

 
Obs Descr CS AR1 UN CSH
1 -2 Res Log Likelihood 184.1 186.7 148.1 155.6
2 AIC (Smaller is Better) 188.1 190.7 160.1 163.6
3 AICC (Smaller is Better) 188.7 191.3 165.0 165.7
4 BIC (Smaller is Better) 189.1 191.7 163.0 165.5

 

Notice we consider an additional covariance structure, CSH. The CSH covariance structure is similar to CS in that is also has a constant correlation in the off-diagonal elements. However, the diagonal elements (the variance at each time point) can be different.

Based on the fit statistic AIC (also AICC and BIC) the unstructured covariance structure (type=UN) is better compared to CS, CSH or AR(1).

Here is the output that is generated for the full model:

Type 3 Tests of Fixed Effects
Effect Num DF Den DF F Value Pr > F
per 2 5.49 1.08 0.4027
drug 2 7.04 148.74 <.0001
seq 5 6.79 5.37  0.0255
x1 1 6.98 18.88 0.0034
x2 1 6.98 83.96 <.0001

The Type 3 tests shown above are 'model dependent' meaning that the sum of squares for each of the effects are adjusted for the other effects in the model. In this case, we have adjusted for the presence of carry-over effects. As the drug is significant, it is appropriate to generate LSmeans and the Tukey-Kramer mean comparisons for the drug factor.

drug Least Squares Means
DIET Estimate Standard Error DF t Value Pr > |t| Alpha Lower upper
A 52.7336 1.3810 4.113 38.18 < 0.0001 0.05 48.9404 56.5268
B 45.8350 1.3810 4.113 33.19 < 0.0001 0.05 42.0418 49.6283
C 43.0980 1.3810 4.113 31.21 < 0.0001 0.05 39.3048 46.8913

To see the adjustment on the treatment means, we can compare the LSmeans for a reduced model that does not contain the carry-over covariates.

LSmeans

Full Model with Covariates
Effect DIET Estimate
DIET A 52.7336
DIET B 45.8350
DIET C 43.0980
Reduced Model (without carry-over covariates)
Effect DIET Estimate
DIET A 52.1625
DIET B 46.9760
DIET C 42.5282

Although the differences in the LSmeans between the two models are small in this particular example, these carry-over effect adjustments can be very important in many research situations.