Programming the statistical procedures from SAS

Repeated measures proc glimmix - observations/subjects not correct in random statement

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Repeated measures proc glimmix - observations/subjects not correct in random statement

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!


Accepted Solutions
Solution
‎08-02-2016 10:25 AM
Respected Advisor
Posts: 2,655

Re: Repeated measures proc glimmix - observations/subjects not correct in random statement

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


All Replies
Solution
‎08-02-2016 10:25 AM
Respected Advisor
Posts: 2,655

Re: Repeated measures proc glimmix - observations/subjects not correct in random statement

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 222 views
  • 2 likes
  • 2 in conversation