Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How to interpret or change the number of observations and max obs per ...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-29-2020 08:03 PM
(6700 views)

Hello. I am performing multiple mixed models using proc mixed in SAS version 9.4 for the first time. The original dataset was reshaped from a wide to long format. There are 336 participants total and repeated measures at baseline, 6 months, and 12 months. In the Results Viewer, the number of observations shows 1008 and the max obs per subject shows 1. How do I interpret or change the number of observations and max obs per participant? There are not 1008 individuals in the study.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Lori,

You need to add studyID to the CLASS statement. Your code treats it as a continuous variable, so time is not blocked by subjectID. I think you will be much happier with the other results (R matrix, the covariance parameter estimates and standard errors) as well.

You probably ought to include the interaction between time and group in your model, and consider looking at the time*group lsmeans using the slice approach. This would enable you to test for differences between groups at each time point. Your current model assumes that differences between groups is identical at each time point.

If you want to test particular groups against one another at a particular time point, you have two options. In PROC MIXED, you would have to write several LSMESTIMATE statements. However, if you shifted to PROC GLIMMIX, you would have the advantage of the SLICEDIFF and SLICEDIFFTYPE options in the LSMEANS statement.

SteveDenham

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

However there are 1008 observations, so it appears that the blocking by subject isn't being accomplished. Could you share your PROC MIXED code? I suspect that you need a subject= option in the REPEATED statement.

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you for replying to my post.

Here is my SAS code:

proc mixed data=projectlong2;

Class group time ;

Model wellbeing= group time;

Repeated time / Subject=studyID Type=UN R RCorr;

LSMeans group / PDiff cl;

RUN;

It looks like I do have the subject=option in the repeated statement but something is still not right.

Lori

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Lori,

You need to add studyID to the CLASS statement. Your code treats it as a continuous variable, so time is not blocked by subjectID. I think you will be much happier with the other results (R matrix, the covariance parameter estimates and standard errors) as well.

You probably ought to include the interaction between time and group in your model, and consider looking at the time*group lsmeans using the slice approach. This would enable you to test for differences between groups at each time point. Your current model assumes that differences between groups is identical at each time point.

If you want to test particular groups against one another at a particular time point, you have two options. In PROC MIXED, you would have to write several LSMESTIMATE statements. However, if you shifted to PROC GLIMMIX, you would have the advantage of the SLICEDIFF and SLICEDIFFTYPE options in the LSMEANS statement.

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Steve,

Thanks so much! I added studyID to the class statement and it worked. I am happier with the results.

Thank you for the suggestions. I plan to include a two way and three way interaction (group by time by race) in the model. I would like to test specific groups against one another at different time points. There are four groups (3 treatment and 1 control). I will probably use several LSMESTIMATE statements. Am I on the right track (please see below)?

Here is an example of a partial code:

lsmeans group/ cl;

estimate group 1-1;

estimate group 1-2;

estimate group 1-3;

estimate group 1-4;

estimate group 2-4;

estimate group 3-4;

Lori

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You will probably be happier using LSMESTIMATE statements than ESTIMATE statements as the LSMESTIMATE allows for multiple lines so you can apply adjustments for multiple comparisons.

SteveDenham

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Ok, thank you. I will try that.

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.