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

Hi,

 

Does anyone know who to get the total number of subjects within each level of a specific CLASS variable from a mixed model (PROC MIXED)?

 

Note, this is not in reference to ods output=nobs or ods output=dim...but rather a more granular/extended version of ods output=dim that can actually provide how many unique subjects are in each group from a CLASS variable of interest.

1 ACCEPTED SOLUTION

Accepted Solutions
aaumez
Fluorite | Level 6

Agreed. SAS support confirmed there is no option for this.

 

Since I am only interested in the number of subjects with complete data (sufficient information) to predict Y at a given visit for each treatment group, I am using a simple descriptive frequency (proc sql and/or proc freq) of the count of unique subjects with non-missing data across all the variables included in the mixed model (excluding the outcome/dependent variable).

 

According to SAS:

"PROC MIXED does require non-missing values for the dependent variable for the model estimation. In other words, if an observation has a missing value for Y, it will not be included in the model estimation. However, you might obtain the predicted value for this observation, as long as all the independent variables in the model are non-missing. So you might want to modify how you count the subjects in your program, if the count is for the model estimation purpose."

 

 

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Maybe there's a way to do this in PROC MIXED, but the first thing that comes to mind is that PROC FREQ will provide the answer easily.

--
Paige Miller
aaumez
Fluorite | Level 6

Agreed. SAS support confirmed there is no option for this.

 

Since I am only interested in the number of subjects with complete data (sufficient information) to predict Y at a given visit for each treatment group, I am using a simple descriptive frequency (proc sql and/or proc freq) of the count of unique subjects with non-missing data across all the variables included in the mixed model (excluding the outcome/dependent variable).

 

According to SAS:

"PROC MIXED does require non-missing values for the dependent variable for the model estimation. In other words, if an observation has a missing value for Y, it will not be included in the model estimation. However, you might obtain the predicted value for this observation, as long as all the independent variables in the model are non-missing. So you might want to modify how you count the subjects in your program, if the count is for the model estimation purpose."

 

 

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

This blog by Rick Wicklin ("Examine patterns of missing data in SAS") might be of interest to you

 

https://blogs.sas.com/content/iml/2016/04/18/patterns-of-missing-data-in-sas.html

aaumez
Fluorite | Level 6

Thank you for sharing. This will be a useful cross-check against proc sql and/or proc freq when getting the CLASS levels Ns.

Ready to join fellow brilliant minds for the SAS Hackathon?

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

Register today!
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
  • 1942 views
  • 1 like
  • 3 in conversation