BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ruhi
Obsidian | Level 7

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
1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

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

 

 

 

 

 

 

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

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

 

 

 

 

 

 

Ruhi
Obsidian | Level 7

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)
 
SAS output form the second model you suggested.
SAS Output
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
SteveDenham
Jade | Level 19

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 1391 views
  • 0 likes
  • 2 in conversation