04-24-2013 08:30 PM
I am running a growth model with longitudinal person data and have been reading the following article:
I would like to calculate the skewness of both level 1 and level 2 for my model like they do in this article but currently using ods graphics and outp i only get one measure of skewness. I am working at the RDC so cannot input my exact syntax.
Can anyone help? It would be much appreciated.
University of Toronto
04-24-2013 09:32 PM
Unless I am missing something, it should be enough to add option OUTP=myL1Resid to your MODEL statement in PROC MIXED and then do:
proc univariate data=myL1Resid normal ;
to get the skewness of residuals and a whole lot of other distribution measures.
Same thing for L2.
04-25-2013 09:34 AM
Thanks for your response.
However, the article I am referencing provides different calculations of skewness at each level - which is what I would assume.
However, when I do as you say above I get identical output when I put L1 versus L2 - I assume I am just changing the name of the dataset, right? Am I supposed to put the OUTP statement somewhere different in the proc mixed statement to get the residual output for level2?
04-25-2013 11:16 AM
You're right, Level-2 will probably be a bit more complicated. It would help us a lot if you posted a (simplified or disguised if necessary) version of your SAS code.
04-25-2013 11:30 AM
OK sure, it's something like this:
proc mixed noclprint poitprint data = work.slid;
model index = vismin vismin*t cborn cborn*t (etc.) / residual solution ddfm = btw notest cl;
random intercept t/sub=personid;
04-25-2013 12:13 PM
random intercept t/sub=personid s;
ods output SolutionR=Level_2R;
proc univariate data=Level_2R(where=(lowcase(Effect)="t")) normal;
Not sure about the part in blue. Check the Level_2R dataset to select the proper rows.
04-25-2013 05:17 PM
Thank you - this did work but I'm not exactly sure I understand what it's doing. what is "s"?
It is now calculating a new skewness measure which I can take to be the Level 2 measure?
I appreciate all your help.
04-25-2013 06:32 PM
Option s is for requesting the printing of random effect estimates (solutions). It is required to get the SolutionR output dataset.
What I understand in the referenced article is that Level-2 residuals are the estimated random effects associated with individuals, i.e. the variation between individuals. Level-1 residuals are the random variation of measurements within individuals.
I hope somebody better versed in MIXED modelling than I am will be able to help you further.
04-26-2013 08:41 AM
Hi everybody (for those of you who are Simpsons fans, that's Dr Nick's entering line),
Go with the answers that PG offered. The OUTP= dataset will have the level 1 residuals, the ODS output statement for the solution of the random effects will give the level 2 residuals. NOTE WELL: The level 2 residuals are meaningful only if you are working with a normal distribution in PROC MIXED. If you were fitting a generalized linear mixed model using PROC GLIMMIX, the values are not really residuals in the traditional sense. They are deviations, but unless an overdispersion effect is added, the model does not include residual error.