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-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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