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

Hello,

I would like to use the linear mixed effects model to estimate the mean difference of the variable Y between 2 treatments. I use the treatment, baseline value, time (as a continuous variable) and treatment by time interaction term as fixed effects, and subject as a random effect. I tried to use the following codes in the Proc Mixed model, but could not find the example in the manual how to write ESTIMATE or LSMEANS statement to derive the point estimate of mean difference.

/* treatment has 2 levels, the continuous variable time ranges from day 30 to day 70, variable y has measurements from week 5 to week 10. */

Proc Mixed data=test;
class Treatment subject;
model y=Treatment baseline Time Treatment*Time / solution;
random  /subject= subject;

Estimate………???

Run;

The point estimate of the mean difference for Y at week 10 need to be estimated. The corresponding variable time during week 10 is a continuous variable, with the mean 69 days for those records during week 10.

can I use this statement as below?

Estimate 'Treatment 1' Intercept 1 Treatment 1 0  Time 69;
Estimate 'Treatment 2' Intercept 1 Treatment 0 1  Time 69;

But I am not sure if the above is correct or not. Could you help me with an example code if you have? Should the interaction term Treatment*Time be considered too? Another question is, how to specify the Y at week 10 in the ESTIMATE statement?

 

any help will be appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I don't know if ok to use TIME a continuous variable in LSMEANS?

 

SAS will tell you if you try to do something that is not allowed. Try it.

 

The documentation that I gave a link to also answers your question.

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I wouldn't even try it with the ESTIMATE statement. Your question is easily answered by LSMEANS statement with the DIFF option and using AT TIME=10

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_mixed_syntax08.htm

--
Paige Miller
chou123
Fluorite | Level 6

thank you very much Paige for the reply.

the tricky thing is, the TIME is a continuous variable, which has values such 65, 66, 67, 68, etc. the WEEK is another variable that has values of 5, 6,7,8,9,10 means WEEK 5 to WEEK 10. I don't know if ok to use TIME a continuous variable in LSMEANS? or use WEEK? but WEEK categorical variable is not in the model statement.

 

Christine

 

PaigeMiller
Diamond | Level 26

I don't know if ok to use TIME a continuous variable in LSMEANS?

 

SAS will tell you if you try to do something that is not allowed. Try it.

 

The documentation that I gave a link to also answers your question.

--
Paige Miller
chou123
Fluorite | Level 6

thank you very much, 🙂 

it works now.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 4 replies
  • 3647 views
  • 4 likes
  • 2 in conversation