07-25-2016 11:59 AM - edited 07-25-2016 12:00 PM
I'm running a repeated measures analysis in proc glimmix, but the analysis keeps is incorrectly assigning the number of observations per subject.
The experiment measured survival of individual blocks from four different geographic locations that were all grown in one location. I measured whether an individual plant was still alive (survival 1, 0 dead) every week over the summer until all plants died naturally.
Home site - geographic locations a plant is from (fixed effect)
Block - one of four locations at the site an individual was grown at (random effect)
Genotype - family that a seed came from (family structure) - (random effect)
Visit - week 1 through 11 that I took a census of each plant (random repeated measure effect)
Tag - unique id for each individual plant
This is a sample of the data:
PROC GLIMMIX data = survival;
CLASS homesite genotype block visit tag;
MODEL survival(event='1') = homesite /dist=binary ddfm = kr;
RANDOM genotype(homesite) block homesite*block;
RANDOM visit/subject=tag type=vc residual;
When I run the above code and include a random statement for the repeated measures factor of visit with tag as the subject, the output shows that proc glimmix is only registering one subject which has 6512 observations. There should be 11 observations per 592 subjects. Furthermore the random effects (covariance parameters) do not have any significance level only estimates/se.
G-side Cov. Parameters
R-side Cov. Parameters
Columns in X
Columns in Z
Subjects (Blocks in V)
Max Obs per Subject
thank you for any help!
08-24-2016 07:36 AM
I am going to start with the last problem first and work back from there.
Furthermore the random effects (covariance parameters) do not have any significance level only estimates/se.
If you wanted to, you could create asymptotic tests from the estimates and standard errors. I would strongly recommend against doing so, as you have no evidence that the estimates come from a normal, or even asymptotically normal, distribution. This is one of the reasons that the p values were removed as default output for the covariance parameters in PROC MIXED.
When I run the above code and include a random statement for the repeated measures factor of visit with tag as the subject, the output shows that proc glimmix is only registering one subject which has 6512 observations. There should be 11 observations per 592 subjects.
Look at the degrees of freedom associated with the fixed effect parameter estimates and least squares means to get an idea of how many observations are being attributed. The output presented merely indicates that you have not included visit and homesite*visit as fixed effects in the model, which they are if they are modeled with the residual option in the RANDOM statement.
Try including those effects in the MODEL statement and see what happens to Max Obs. you might also get something that looks like what you expect if you changed the subject= to subject=tag*block*homesite.
08-24-2016 09:20 AM
Just to add to Steve's comments.... You have two random statements, but only the second one (for residual) is written with explicit subject= syntax. Thus, for the overall model fit, observations are not processed by subject, because there is no unique (single) subject designation (there are, implicitly, different levels of subjects). In the output table under these circumstances, you get the number of subjects you mentioned. But your results should be correct.