BookmarkSubscribeRSS Feed
ArthurMa
Calcite | Level 5

Dear friends of SAS community

 

I am confused by how to output the corrected original data set in covariance anlysis using proc mixed. I need the corrected original data for further repeated meassure and factorial analysis, as I carried out the covariance anlysis using one way treatment design, but the experiment is carried out as factorial design with repeated meassure. I believe a slight change of my code should do it. here is my code below:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

data exercise;
 
input trt$ adg iwt; /*iwt is the covariance*/
 
cards;
 
hfhs 23.21 38.92
hfhs 1.18 39.65
hfhs 8.09 38.8
hfhs 29.84 39.7
hfhs 89.89 38.45
hfhs 5.86 39.61
hfhs 1.67 39.1
hfhs 88.98 38.77
hfhs null null
hfhs 21.88 39.42
hfcon 95.81 37.76
hfcon 97.89 37.68
hfcon 97.88 38.14
hfcon 99.67 38.08
hfcon 99.58 37.42
hfcon 97.63 37.93
hfcon 96.74 38.32
 
hfcon 97.15 38.1
hfcon 91.10 38.26
lfhs 96.03 39.13
lfhs 59.53 38.98
lfhs 7.74 38.71
lfhs 9.92 38.8
lfhs 93.85 38.44
lfhs 6.79 38.84
lfhs 94.77 38.16
lfhs 6.37 39.18
lfhs 92.64 38.31
lfhs 16.74 38.64
lfcon 95.05 37.7
lfcon 97.29 38.46
lfcon 94.11 38.7
lfcon 98.08 38.88
lfcon 99.69 38.16
lfcon 99.62 38.11
lfcon 82.47 38.44
lfcon 98.20 37.94
lfcon 99.66 38.24
lfcon 98.52 37.95
 
;
 
proc mixed data=exercise covtest;/*check if covariance is significant, the answer is yes*/
 
class trt;
 
model adg=trt trt*iwt/noint solution;
 
run;
proc mixed data=exercise covtest;/*check if equal slope or not, the answer is yes*/
 
class trt;
 
model adg=trt iwt trt*iwt/solution;
 
run;
proc mixed data=exercise covtest;/*apply covariacne correction*/
 
class trt;
 
model adg=trt iwt/solution ;
 
lsmeans trt/adjust=tukey;
 
ods output diffs=ppp lsmeans=mmm;
ods listing exclude diffs lsmeans;
 
run;
%include'd:\pdmix800.sas';
%pdmix800(ppp,mmm,alpha=.05,sort=yes);/*apply sas macro*/
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I sincerely appreciate all the assistance you are about to offer!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 131 views
  • 0 likes
  • 1 in conversation