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

Dear All, 
I did some analysis using a mixed model (code below). Now I want to look for the effect of site i.e. if there's difference between sites where the data were collected because a site has about 70% subjects than the other two sites. I want to know if this would affect my analysis and where do I put the site variable in my model.  Do you know how I could test for the effect of the site in the model?
Thanks for helping.
trt is the the treatment grp
sub is the subject
time is the different time point
and site is the different site that the subject data is collected.

proc mixed data=data;
class trt sub time (ref=first);
model Y = time trt time*trt/ s chisq;
repeated / type=un subject=sub r;
run;

 Thank again.
~Sammy

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

I assume there are two sites you want to handle.  Try the following code:

 

proc mixed data=data;
class trt sub time (ref=first) site;
model Y = time|trt|site/ s chisq;
repeated time / type=un subject=sub r;
run;

The F tests for time*site, trt*site, and time*trt*site are key to your question.  If any of these are significant, you need to think about comparing factors within site (see SLICE in the documentation).  If none are significant, then you can check the test for 'site' to look for systematic differences between sites, regardless of treatment or time - the equivalent of a change in intercept in a regression model.

 

SteveDenham

 

View solution in original post

2 REPLIES 2
SteveDenham
Jade | Level 19

I assume there are two sites you want to handle.  Try the following code:

 

proc mixed data=data;
class trt sub time (ref=first) site;
model Y = time|trt|site/ s chisq;
repeated time / type=un subject=sub r;
run;

The F tests for time*site, trt*site, and time*trt*site are key to your question.  If any of these are significant, you need to think about comparing factors within site (see SLICE in the documentation).  If none are significant, then you can check the test for 'site' to look for systematic differences between sites, regardless of treatment or time - the equivalent of a change in intercept in a regression model.

 

SteveDenham

 

twix17
Obsidian | Level 7
Thank you sir for the response and direction.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 700 views
  • 0 likes
  • 2 in conversation