Hi All
I am writting a model to estimate the varaince components, and I am not sure of the correct model to estimate the components I need. Please help me.
So I have 60 patients, who each got scanned on 6 days, and 6 times everyday. Each scan contains 20 images. I want to estimate intraday, interday and intrascan variance. With my model my residual variance is higher than the intraday varaince, which is causing doubts. 20 images within a scan should be very close and should have least variability. scans within a day should than have less varaibility than variability between days. Please help me with correct model writing.
proc mixed data=p2.req;
class pt_nbr day_nbr scan_nbr image_nbr ;
model Y= ;
random day_nbr pt_nbr day_nbr*pt_nbr scan_nbr(day_nbr) ;
run;
SAS Output
Covariance Parameter Estimates | |
---|---|
Cov Parm | Estimate |
day_nbr | 0 |
pt_nbr | 1078.39 |
pt_nbr*day_nbr | 12.7373 |
scan_nbr(day_nbr) | 2.1783 |
Residual | 13.0825 |
You may wish to fit a fully factorial random model. I have a hunch that the missing terms are falling to the residual error, and consequently inflating it. What happens if you try:
proc mixed data=p2.req;
class pt_nbr day_nbr scan_nbr image_nbr ;
model Y= ;
random pt_nbr|day_nbr|scan_nbr ;
run;
I used the pipe notation to get all main effects, the three first order interactions and the second order interaction. You could also delete image_nbr from the class statement.
The problem I see here is that these repeated measurements mean that the actual experimental unit is the scan_nbr, and the residual error is pseudo-replication. With that in mind, what happens with:
proc mixed data=p2.req;
class pt_nbr day_nbr scan_nbr image_nbr ;
model Y= ;
random pt_nbr|day_nbr|scan_nbr@2 ;
repeated image_nbr/subject=pt_nbr*day_nbr*scan_nbr;
run;
Have to admit I am spitballing at this.
Steve Denham
You may wish to fit a fully factorial random model. I have a hunch that the missing terms are falling to the residual error, and consequently inflating it. What happens if you try:
proc mixed data=p2.req;
class pt_nbr day_nbr scan_nbr image_nbr ;
model Y= ;
random pt_nbr|day_nbr|scan_nbr ;
run;
I used the pipe notation to get all main effects, the three first order interactions and the second order interaction. You could also delete image_nbr from the class statement.
The problem I see here is that these repeated measurements mean that the actual experimental unit is the scan_nbr, and the residual error is pseudo-replication. With that in mind, what happens with:
proc mixed data=p2.req;
class pt_nbr day_nbr scan_nbr image_nbr ;
model Y= ;
random pt_nbr|day_nbr|scan_nbr@2 ;
repeated image_nbr/subject=pt_nbr*day_nbr*scan_nbr;
run;
Have to admit I am spitballing at this.
Steve Denham
Hello Steve
Thanks for your quick reply. I tried your both models. I personally think first one is better, I think because I understand it better :).FYI, I don't have missing data.
Fit statistics are also better with the first model. From the sas output that follows , I think the highlighted portions of the data will give me the required estimates I need. Please let me know if you think I am thinking correct?
SAS Output
Covariance Parameter Estimates | |
---|---|
Cov Parm | Estimate |
pt_nbr | 1042.21 |
day_nbr | 0.1685 |
pt_nbr*day_nbr | 13.0275 (interday) |
scan_nbr | 0.2490 |
pt_nbr*scan_nbr | 0.3753 |
day_nbr*scan_nbr | 0 |
pt_nbr*day_nb*scan_n | 9.9088(Intraday) |
Residual | 4.3063(intrascan) |
Covariance Parameter Estimates | ||
---|---|---|
Cov Parm | Subject | Estimate |
pt_nbr | 1041.89 | |
day_nbr | 0.1569 | |
pt_nbr*day_nbr | 14.5853 | |
scan_nbr | 0.2367 | |
pt_nbr*scan_nbr | 2.2446 | |
day_nbr*scan_nbr | 0.07033 | |
image_nbr | pt_nbr*day_nb*scan_n | 11.0527 |
I agree--the first model is more easily interpreted (and since it was my first thought, that says something as well). Sometimes, overthinking a model will lead to trouble. I did see a zero estimate, so you probably saw something about the G matrix not being positive definite. In this case, that is not a problem--the REML estimates of variance components are better estimators.
Steve Denham
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.