turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- GLIMMIX for repeated measures

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-02-2017 05:00 PM

I am new to utilizing SAS 9.4 full time for analyses. I am working on my dissertation data and I know that the best way to analyze my data is a generalized linear mixed model. No one else in my lab utilizes SAS, they prefer SPSS, which does not to as good a job with very complex stats in my opinion.

My data is a secondary analysis of a year long dataset on women who were undergoing an intervention to regain menstrual function. My Y (resume) is did they or didn't they resume menses during the study.

I am interested in whether body composition (of which I have 12 variables) changed the odds of menstrual recovery and am not interested in the intervention effect (rnd) for this analysis. My main concern is fitting the model so that the subject-specific random intercept is assumed and uneven repeate structure of the data (and number of measures per subject) is considered in the analysis.

I am not sure the solution I have come up with following extended reviews of the GLIMMIX literature reflects the analysis I am interested in.

Proc Glimmix data=resumption;

Class period id rnd;

Model resume = wt bmi perbf fm fmi lmi lpct tpct tlpctr apct gpct agpctr/ link=logit dist=binomial or solution;

Random int/subject=id type=ar residual;

Run;

My data is set up like:

Options nocenter pageno=1;

Data resumption;

Input period $ id rnd wt bmi perbf fm fmi lmi lpct tpct tlpctr apct gpct agpctr resume;

Cards;

SBI1 | 1 | 3 | 45.90 | 16.07 | 12.30 | 5.99 | 2.10 | 14.37 | 12.58 | 9.81 | 0.78 | 6.40 | 9.57 | 0.67 | 0 |

I5 | 1 | 3 | 50.90 | 17.82 | 14.90 | 7.74 | 2.71 | 15.81 | 16.20 | 12.57 | 0.78 | 10.37 | 21.34 | 0.49 | 0 |

SBI1 | 14 | 2 | 52.16 | 19.88 | 17.60 | 9.29 | 3.54 | 16.66 | 20.74 | 14.42 | 0.69 | 13.01 | 25.17 | 0.52 | 0 |

I5 | 14 | 2 | 53.90 | 20.54 | 18.60 | 9.97 | 3.80 | 16.72 | 22.38 | 14.70 | 0.66 | 13.96 | 27.56 | 0.51 | 0 |

I9 | 14 | 2 | 53.00 | 20.20 | 17.70 | 9.48 | 3.61 | 16.93 | 21.74 | 13.78 | 0.63 | 12.73 | 25.93 | 0.49 | 0 |

SBI1 | 126 | 2 | 50.23 | 17.87 | 24.30 | 12.22 | 4.35 | 12.71 | 31.10 | 19.19 | 0.62 | . | . | . | 0 |

SBI1 | 132 | 3 | 56.45 | 20.09 | 23.76 | 13.25 | 4.71 | 14.21 | 29.03 | 20.95 | 0.72 | . | . | . | 0 |

I5 | 132 | 3 | 56.41 | 20.07 | . | . | . | . | . | . | . | . | . | . | 0 |

I9 | 132 | 3 | 56.50 | 20.21 | 26.25 | 14.74 | 5.24 | 13.88 | 30.40 | 24.86 | 0.82 | . | . | . | 0 |

SBI1 | 155 | 2 | 40.95 | 16.81 | 10.10 | 4.05 | 1.66 | 14.04 | 12.50 | 6.90 | 0.55 | 5.00 | 17.00 | 0.29 | 0 |

I5 | 155 | 2 | 40.45 | 16.60 | 12.20 | 4.89 | 2.01 | 13.67 | 14.70 | 9.40 | 0.64 | 7.20 | 20.00 | 0.36 | 0 |

I9 | 155 | 2 | 41.20 | 16.91 | 12.10 | 4.90 | 2.01 | 13.82 | 15.20 | 9.00 | 0.59 | 7.30 | 20.80 | 0.35 | 0 |

I21 | 155 | 2 | 40.20 | 16.50 | 11.00 | 4.41 | 1.81 | 13.83 | 13.40 | 8.20 | 0.61 | 5.40 | 17.60 | 0.31 | 0 |

I33 | 155 | 2 | 39.00 | 16.01 | 7.50 | 2.92 | 1.20 | 13.98 | 8.60 | 4.80 | 0.56 | 3.90 | 11.00 | 0.35 | 0 |

I49 | 155 | 2 | 42.10 | 17.28 | 9.80 | 4.12 | 1.69 | 14.81 | 11.40 | 7.40 | 0.65 | 5.80 | 16.40 | 0.35 | 0 |

SBI1 | 170 | 2 | 56.20 | 23.77 | 32.40 | 18.02 | 7.62 | 14.94 | 30.70 | 35.40 | 1.15 | 45.10 | 40.20 | 1.12 | 0 |

SBI1 | 175 | 3 | 54.35 | 20.33 | 19.60 | 10.65 | 3.98 | 15.50 | 24.00 | 16.80 | 0.70 | 18.20 | 31.30 | 0.58 | 0 |

I5 | 175 | 3 | 55.85 | 20.89 | 20.10 | 11.43 | 4.28 | 16.21 | 24.40 | 17.40 | 0.71 | 18.60 | 31.30 | 0.59 | 0 |

I9 | 175 | 3 | 56.60 | 21.17 | 20.40 | 11.55 | 4.32 | 16.06 | 24.70 | 17.70 | 0.72 | 19.70 | 32.60 | 0.60 | 0 |

I21 | 175 | 3 | 56.85 | 21.27 | 21.40 | 12.11 | 4.53 | 15.86 | 25.90 | 19.00 | 0.73 | 21.80 | 33.10 | 0.66 | 1 |

SBI1 | 217 | 3 | 51.30 | 18.64 | 23.00 | 11.66 | 4.24 | 13.45 | 28.90 | 18.10 | 0.63 | 18.20 | 34.90 | 0.52 | 0 |

I5 | 217 | 3 | 52.70 | 19.15 | 25.20 | 13.16 | 4.78 | 13.48 | 30.10 | 21.40 | 0.71 | 22.60 | 37.70 | 0.60 | 0 |

I9 | 217 | 3 | 54.25 | 19.71 | 26.80 | 14.17 | 5.15 | 13.31 | 31.00 | 23.40 | 0.75 | 26.70 | 39.60 | 0.67 | 0 |

I21 | 217 | 3 | 54.55 | 19.82 | 29.10 | 16.34 | 5.94 | 13.76 | 35.10 | 25.10 | 0.72 | 28.40 | 44.00 | 0.65 | 0 |

I33 | 217 | 3 | 54.55 | 19.82 | 28.40 | 15.57 | 5.66 | 13.55 | 34.10 | 24.80 | 0.73 | 27.00 | 43.10 | 0.63 | 0 |

I49 | 217 | 3 | 55.20 | 20.06 | 27.30 | 14.70 | 5.34 | 13.46 | 32.80 | 23.40 | 0.71 | 24.60 | 41.40 | 0.59 | 1 |

The time periods I have body composition variables are not evenly distributed (screening, and intervention weeks 5, 9, 21, 33, and 49). Duration of time to resumption is not of interest in my analysis. Participants that resumed menstrual function did so at various time points, and many did not resume. Not all of the participants made it through the study to intervention week 49.

Not all women have the apct, gpct, and agpctr variables due to a change in the machine used to evaluate body composition. The apct and gpct have shown to be significantly different at the time of resumption compared to non resumers when analyzed with a Hotelling's T2 test, therefore I want to keep these variables in the analysis.

I understand that most of my variables are correlated; however, only 7 of the variables are correlated above a rho = 0.95 and none are at 0.99.

Thanks for any support!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-04-2017 01:35 PM

The dataset included in your code has 8 subjects. Is this the full dataset or just a subset? If it's a subset, how many subjects do you have?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-04-2017 01:40 PM

I have a total of 30 participants in the analysis I am completing (an approximatly even split of those who resumed and those that did not). I chose those specific participants to show the variability in when participants withdrew or resumed menses in the study. The information provides (though a representation of the actual data) shows the randomness of the data that is missing for the various variables within any one participant.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-04-2017 02:32 PM

I'll offer some thoughts. Hopefully other people will weigh in as well.

1. Consider a "time to event" analysis, where event is resumption of menses. Given the extent of censored observations (i.e., women who withdrew, and women who did not resume menses before the end of the study), I doubt that a GLMM with a binary response will work well. The text by Singer and Willett (Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence) and the code here http://www.ats.ucla.edu/stat/r/examples/alda/ could be a good place to start.

2. 30 subjects, about half of whom exhibited the event, is a small sample. Keep in mind your effective sample size and the risk of over-fitting.

3. With correlations that high among the body condition covariates, you will surely have issues with (multi)collinearity. Consider a more complete assessment of multicollinearity, and then some form of dimension reduction, e.g., dropping predictor variables, forming an index, principal components analysis, factor analysis. Again, keep in mind your effective sample size and the risk of over-fitting.

4. You say you are not interested in the "intervention" effect. Are different women exposed to different interventions in your dataset? If so, I would not think that you could ignore it unless intervention absolutely does not matter.

5. The missing covariate values will pose problems. Consider imputation? Or drop those covariates with missing values if they are highly correlated (and thus redundant) to other covariates.

6. These thoughts are all independent of the software that you use, whether SPSS or SAS (or anything else).

7. I suspect this analysis will be a challenge, quite probably more than can be dealt with adequately in this forum. Consider finding someone at your institution with statistical expertise to guide you.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-04-2017 03:23 PM

Thanks for the input.

1. We are working with trying to understand whether or not time to event matters. In the current analysis we want to proceed under the assumption that time to event doesn't matter, what matters is the actual body composition no matter how long it took the participant to reach that value. In another analysis we are going to evaluate the time to event aspect of the study.

2. Yes, we are considering overfitting. We are fitting the GLMM based on the results of Correlation analyses with resumption as well as Hotelling T2 analyses. This way I have dropped to 7 predictors.

3. I am limited in my knowledge of ways to evaluate mulitcollinearity. I know to check correlations, however the value of rho to be concerned at varies. I know I can also look at VIF values as well. Do you have suggestions on the best/most appropriate way to evaluate multicollinearlity.

4. The women went through a freeliving refeeding intervention, however women in both arms resumed. My focus is the body composition changes, which independent of the intervention in some respects. This is a secondary analysis, I can add the randomized group in as a predictor but then I again risk over fitting.

5. The one predictor of interest is missing in a subset of the sample due to a change in the machine being used. This data cannot be imputed.

6/7. I am working with an individual at my institution on the best analysis to complete, however he does not uses SAS and suggested using the SAS forum for guidance on the structure of the SAS coding. As a student I am trying to explore the statistics independently as well as with his guidance.

Thanks again

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-04-2017 04:41 PM

Thank you for the informative responses. My turn!

1. Because of the censoring and because the body condition covariates are time-varying, I'm not seeing how a good binary GLMM can be constructed. The *resume* values don't switch back and forth across periods between N and Y depending on body conditions; a *resume* value is N until it (possibly) becomes Y. Looks like event data to me.

2 and 3. Your approach to variable selection is arguably treacherous. But I concur that you have too many predictor variables for your sample size. Even with this process of down-sizing to 7 variables, you still need to assess multicollinearity among them. A quick Google of "multicollinearity detection" generates a lot of useful links. Multicollinearity is a property of the predictor variables, so you can read about multicollinearity in regression texts that deal with normal-distribution response and use multicollinearity statistics generated by regression software (like REG).

4. If body conditions are largely a *consequence* of intervention, then it would be appropriate to drop intervention.

5. By default, if an observation contains a missing value for one or more predictor variables, the software will drop that observation in the model fitting; this is true for most (if not all) software packages. So, you need to deal with those missing values in some fashion, or you'll lose those observations.

6 and 7. I commend you for not blinding using stat software! This forum is usually good to help with code when you provide enough detail to identify an appropriate model for a corresponding dataset. In this case, as you can tell, I don't believe a binary GLMM is appropriate so I cannot help with syntax for that model (or should not, but see below). If you switch to a time-to-event model, this website which I linked to earlier http://www.ats.ucla.edu/stat/r/examples/alda/ has SAS code examples, and the forum could help with code if you hit snags.

In the interest of your ongoing education, I will add that if I liked your approach, which I don't, I would start with

proc glimmix data=resumption method=laplace; class period id; model resume = wt bmi perbf fm fmi lmi lpct tpct tlpctr apct gpct agpctr period / link=logit dist=binomial or solution; random int / subject=id; random period / subject=id type=ar(1); run;

This sort of model almost always requires some twiddling, even beyond that needed to identify a good covariance structure type. Including "type=ar(1)" and "residual" on the first random statement is wrong. Including both random statements as here identifies an AR(1)+RE covariance structure. Omitting the first random statement and retaining only the second identifies an AR(1) covariance structure. See Littell et al. http://onlinelibrary.wiley.com/doi/10.1002/1097-0258(20000715)19:13%3C1793::AID-SIM482%3E3.0.CO;2-Q/... or Stroup (2013) *Generalized Linear Mixed Models* for details about the distinction between AR(1)+RE and AR(1). If you had enough subjects and enough periods and more complete longitudinal data, you could consider a model with random slopes, specified as

random wt bmi perbf fm fmi lmi lpct tpct tlpctr apct gpct agpctr / subject=id type=vc;

but this is way too complex for what you have to work with.