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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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