[R-sig-ME] Longitudinal logistic regression with continuous-time first-order autocorrelation structure
Steven J. Pierce
pierces1 at msu.edu
Thu Mar 1 14:45:45 CET 2018
With > 100 observations each person, you effectively have multilevel time series data. You may want to consider using Mplus (www.statmodel.com), which has some interesting features for modeling that via what they call dynamic structural equation models (DSEM). See the description of time series analysis at http://www.statmodel.com/verhistory.shtml and http://www.statmodel.com/TimeSeries.shtml . That last link also has citations for published DSEM papers, example scripts, plus videos and handouts from DSEM workshops and webinars.
I think Mplus would give you the kind of sophisticated modeling options you need. It's not open-source, nor is it cheap software, but it has a very good reputation. I prefer R for most of my work (for lots of reasons), but what you're describing is an analysis where I would strongly consider using Mplus instead. It may well be that you can do the same things in R (with the right packages) but I suspect even then reading about the DSEM modeling framework could provide you with useful methodology ideas that are software independent.
Disclaimer: I have no personal or financial stake whatsoever in the company that produces Mplus. I simply use that software for some of my own work.
Steven J. Pierce, PhD
Acting Director; Associate Director
Center for Statistical Training and Consulting
Michigan State University
E-mail: pierces1 at msu.edu
From: Dennis Ruenger [mailto:dennis.ruenger at gmail.com]
Sent: Wednesday, February 28, 2018 8:45 PM
To: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Longitudinal logistic regression with continuous-time first-order autocorrelation structure
Thanks, Alain and Ben, for your replies.
My understanding is that for the kind of intensive longitudinal data I'm
dealing with, a mixed model with both random intercepts and slopes for the
time effect *and *autoregressive errors are recommended.
I'd like to follow Alain's suggestion and give glmmTMB a try. Based on a
description of the covariance structures available with glmmTMB (link
below), it looks like the Ornstein–Uhlenbeck covariance structure might be
what I'm looking for (i.e., something akin to corrCAR1() that works in a
So I tried:
df$time_hours <- numFactor(df$time_hours)
fit <- glmmTMB(y ~ time_hours + (time_hours|id) + ou(time_hours-1|id),
family = binomial, data = df)
However, after about 10 minutes, I receive an error message about failed
memory allocation (on a laptop with a 7th gen Intel Core i5 processor and
8GB RAM). The data set includes 34 participants with up to 300 data points
per participants. Running the model for a subset of 5 participants also
resulted in memory allocation failure. The same was true for the spatial
Gaussian and spatial exponential covariance structures.
Does anyone see a way to make this work with glmmTMB?
Thanks a lot.
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models