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

Hi,

 

I have three variables which I need to have nested under each other in proc GLIMMIX.

 

I have the variable DAD nested under the variable MOM, and MOM is nested under the variable year - there are three different levels.

 

Is the following statement correct?

 

random int/ subject = mom;

random int/ subject = dad(mom);

random int/ subject = mom(dad year);

covtest 'var (mom)= 0' 0 / est parms ;

covtest 'var (dad(mom)) = 0' . 0 / est parms;

covtest 'var (mom (dad year)) = 0' . 0/ est parms;

run;

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I would not say that dad and mom as random effects factors have an effect on the intercept. Random effects factors affect the variance of the response variable, but not the mean of the response variable (and the intercept is the overall mean). I'd give this objective more thought.

 

The COVTEST syntax is the same regardless. It's all about the order of the covariance parameter estimates.

 

If you have a continuous covariate (JSH) measured at the individual offspring level, then you will have to embed that regression in a mixed model because offspring are nested with matings. Be sure you look at plots of the data to assess linearity (on the logit scale for the binary distribution), look for influential observations, etc.

 

Particularly if you are planning to add more covariates to your model, you should seek out a statistician at your institution/company with whom you can discuss statistical issues vis-a-vis your study issues. 

View solution in original post

8 REPLIES 8
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

There's not enough detail here to allow anyone to make any subtantial comments. If you want input, provide a description of your experiment, something like a (concise) Methods section for a manuscript that defines each variable and describes the experimental design. Plus provide the entire MIXED or GLIMMIX code, not just a few extracted statements that are out of context.

 

I will note that it is not possible for dad to be nested within mom ["dad(mom)"] and mom to be nested within both dad and year ["mom(dad year)"].

boban
Calcite | Level 5

Thanks for the feedback,

I am analysing the effect of dad, mom and year on survivorship (variable surv). Basically, I have a design with four levels – juveniles that either survive or not, both parents and year.

Dads mate with multiple moms and moms mate with multiple dads. Here is the full model:

proc glimmix method = quad(fastquad qpoints=3) data=final;

class mom dad year;

model ontsurv (event = '1')= jsh /S dist = binary link = logit ddfm =bw;

random int/ subject = mom;

random int/ subject = dad(mom);

random int/ subject = mom (dad year;

covtest 'var (mom)= 0' 0 / est parms ;

covtest 'var (dad(mom)) = 0' . 0 / est parms;

covtest ‘var (mom(dad year)) = 0’ . 0/ est parms;

run;

I want to have dads nested within moms and moms nested within years. In the quad method, when there are multiple subjects, there has to be a hierarchical structure. I am also doubtful with the last random int – mom (dad year). How can I write the model with all three levels nested within each other?

Note that this is the full model. I will also run a random intercept only model without the variable jsh to test for interclass correlation.

Best regards,

B

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

It's not looking like there is a nested structure of dad, mom, and year. I would consider dad and mom to be crossed random effects, rather than nested random effects. (I'm not sure how year fits in yet.) How full (or sparse) is a cross-tabulation of dad and mom?

 

proc freq data=final;
  table dad*mom;
  run;

 

 

But still not enough detail.

 

Is there only one mating of a particular dad with a particular mom, or does this pair mate multiple times? Does a mating produce one or more than one offspring?

 

What is your observation unit in the data set final? Is it a single offspring?

 

What is the role of year in your study? How many years? Fixed or random? 

 

Are all dads and all moms in all years?

 

What is ontsurv? What is jsh?

 

 

boban
Calcite | Level 5

Hi,

When it comes to the quad method, subjects have to form a hierarchy, so is it possible not to have dad and mom nested within each other and in this case how should I write the program?

 

All three variables (mom, dad, and year) have a significant effect on the random intercept. Therefore, they must be considered in the analysis.

 

However, most dad*mom combinations do not exist (very sparse cross-tabulation), and most importantly, many dads and moms appear only in one or two years. Do you think that year should be a subject variable?

If I ignore the effect of year, wouldn’t I pseudo replicate in this case?

 

  • Dads and Moms may mate multiple times, and each matting produces several offspring.
  • JSH refers to a unit particular to each offspring (predictor variable) and ontsurv is a binary variable (survived-did not survive)
  • I have 10 years and each year, not all dads and moms reproduce – they are captured in the wild and taken to mate in captivity. Then, they are released and recaptured the subsequent year.
  • Not all moms and dads are present in all years.

I hope that helps.

 

Thanks!

Regards,

B

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Oh, my, this really is a mess, isn't it. 

 

What sort of animal are you working with?

 

No, I don't think random effects must be nested to use the quadrature method. 

 

Let's step back. How many dads are there? How many moms? Are your objectives focused on these particular dads and moms and years, or are you thinking of the collections of dads/moms/years as if the collections are random samples from statistical populations of dads/moms/years to which you would like to make inference? In other words, are dads/moms/years fixed effects or random effects?

 

What do you think is your replication factor for this experiment? I might think that it is a mating (one dad x one mom x one year). If so, then the multiple offspring that result from one mating are subsamples, and I would collapse the dataset (using, for example, the MEANS procedure) to obtain the number of surviving offspring and the number of total offspring for each mating, and then use a binomial distribution. But this depends on JSH which might be an offspring-level measurement.

 

I'm still not clear on what JSH is. Because it is not in the CLASS statement, it would be something measured on a continuous scale. Size? IQ?

 

Are you primarily interested in the effect of JSH, or do you also have hypotheses to be tested about dad, mom, and year? 

 

I'm still thinking about crossed random effects

random dad mom year;

but this study is a non-standard scenario, and context-specific considerations and data patterns will need to play into decisions about statistical modeling. A bit beyond what we can accomplish in this forum probably. 

 

"Using the data to guide the data analysis is almost as dangerous as not doing so." Frank Harrell, Regression Modeling Strategies 2nd ed, p. ix.

boban
Calcite | Level 5

Dad, mom and year are random effects.

 

The design is one dad x one mom x one year with multiple offspring per mating. They are lizards.

 

JSH is an offspring-level measurement on a continuous scale.

 

I am interested in the effects of JSH on ontsurv (binary variable) and of parental ID (both mom and dad) on the intercept.

 

I might also add covariates at the mom and dad level later.

 

If a use a crossed random effect, how would you write the syntax (the covtest for example)?

 

Thank you for your help, very much appreciated!

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

I would not say that dad and mom as random effects factors have an effect on the intercept. Random effects factors affect the variance of the response variable, but not the mean of the response variable (and the intercept is the overall mean). I'd give this objective more thought.

 

The COVTEST syntax is the same regardless. It's all about the order of the covariance parameter estimates.

 

If you have a continuous covariate (JSH) measured at the individual offspring level, then you will have to embed that regression in a mixed model because offspring are nested with matings. Be sure you look at plots of the data to assess linearity (on the logit scale for the binary distribution), look for influential observations, etc.

 

Particularly if you are planning to add more covariates to your model, you should seek out a statistician at your institution/company with whom you can discuss statistical issues vis-a-vis your study issues. 

boban
Calcite | Level 5

Thank you for these very useful coments, I will for sure consider them.

 

Best regards,

B

 

sas-innovate-2024.png

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.

 

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
  • 8 replies
  • 4414 views
  • 2 likes
  • 2 in conversation