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

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. 

Factors: 

 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:

homsitegenotypeindtagblockvisitsurvival
HF13563411
HF14381211
HF156111
HF17195311
HF1042231311
HF1043578411
HF104761111
HF1048444211
HF1053584411

 

 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;

RUN;

QUIT;

 

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. 

 

Dimensions

G-side Cov. Parameters

3

R-side Cov. Parameters

1

Columns in X

15

Columns in Z

168

Subjects (Blocks in V)

1

Max Obs per Subject

6512

 

 

thank you for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

A lot going on here.  Some things are important, some are not, and some require looking at something other than what you might think have the results.

 

First, look at the test of type 3 effects, and at the denominator degrees of freedom--is that giving expected results?  If so, don't worry so much about the table with subjects=1.  That merely indicates that you have not parameterized the first random statement with a subject= option.

 

Next, PROC GLIMMIX does not provide p values for testing individual variance components.   There are a couple reasons that spring to mind--distributional assumptions for testing are not easily input is the most important, and if there is more than a single covariance parameter, the tests involve mixtures of chi squared distributions.  However, you can use the COVTEST statement to get a variety of likelihood ratio tests that compare full and reduced models.  Alternatively, you might fit the data in separate runs, with different covariance structures or elements and compare information criteria to see which model best captures the information in the raw data.

 

Thre is more that I might suggest here, but getting the subject= issue sorted out is the most important, and has to be done before moving to a conditional model--which I think is strongly suggested if you are considering genotype as a random effect, rather than as a fixed effect.

 

Steve Denham

View solution in original post

1 REPLY 1
SteveDenham
Jade | Level 19

A lot going on here.  Some things are important, some are not, and some require looking at something other than what you might think have the results.

 

First, look at the test of type 3 effects, and at the denominator degrees of freedom--is that giving expected results?  If so, don't worry so much about the table with subjects=1.  That merely indicates that you have not parameterized the first random statement with a subject= option.

 

Next, PROC GLIMMIX does not provide p values for testing individual variance components.   There are a couple reasons that spring to mind--distributional assumptions for testing are not easily input is the most important, and if there is more than a single covariance parameter, the tests involve mixtures of chi squared distributions.  However, you can use the COVTEST statement to get a variety of likelihood ratio tests that compare full and reduced models.  Alternatively, you might fit the data in separate runs, with different covariance structures or elements and compare information criteria to see which model best captures the information in the raw data.

 

Thre is more that I might suggest here, but getting the subject= issue sorted out is the most important, and has to be done before moving to a conditional model--which I think is strongly suggested if you are considering genotype as a random effect, rather than as a fixed effect.

 

Steve Denham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 1660 views
  • 2 likes
  • 2 in conversation