I'm trying to model a group level attribute that is only measured once during study using individual level predictor that was measured anywhere from 1 to 111 times/per person with 660 observations and 60 people. How do I specify that my outcome is a group level attribute that has only been measured once per subject? I think with code my outcome is being analyzed as if it were dis-aggregated across all time points.
proc mixed data = analysis.labshmp9 noclprint empirical ;
class subjectid ;
model sspg = shannon | shannon /solution ;
repeated / subject = subjectid ;
run;
So after thinking about it some more I realized the repeated statement did not make sense in the context because my outcome was not repeated. That meant to specify my subgroups I needed to use the random statement. The only thing that could randomly varies in the model are the level 1 observations. So I ended up fitting a model like this:
proc mixed data = dataset noclprint namelen=32 covtest plots = all ;
class subjectid ;
model SSPG = shannonc /solution ddfm = bw cl ;
random shannonc /subject = subjectid;
run;
the degrees of freedom were reasonable.
So after thinking about it some more I realized the repeated statement did not make sense in the context because my outcome was not repeated. That meant to specify my subgroups I needed to use the random statement. The only thing that could randomly varies in the model are the level 1 observations. So I ended up fitting a model like this:
proc mixed data = dataset noclprint namelen=32 covtest plots = all ;
class subjectid ;
model SSPG = shannonc /solution ddfm = bw cl ;
random shannonc /subject = subjectid;
run;
the degrees of freedom were reasonable.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.