Presentation is loading. Please wait.

Presentation is loading. Please wait.

Longitudinal Data & Mixed Effects Models

Similar presentations


Presentation on theme: "Longitudinal Data & Mixed Effects Models"— Presentation transcript:

1 Longitudinal Data & Mixed Effects Models
Danielle J. Harvey UC Davis

2 Disclaimer Funding for this conference was made possible, in part by Grant R13 AG from the National Institute on Aging. The views expressed do not necessarily reflect the official policies of the Department of Health and Human Services; nor does mention by trade names, commercial practices, or organizations imply endorsement by the U.S. Government. Dr. Harvey has no conflicts of interest to report.

3 Outline Intro to longitudinal data Notation General model formulation
Random effects Assumptions Example Interpretation of coefficients Model diagnostics

4 Longitudinal data features
Three or more waves of data on each unit/person (some with two waves okay). Outcome values. Preferably continuous (although categorical outcomes are possible); Systematically change over time; Metric, validity and precision of the outcome must be preserved across time. Sensible metric for clocking time. Automobile study: months since purchase, miles, or number of oil changes?

5 Data Format Person-level (multivariate or wide format):
One line/record for each person which contains the data for all assessments Person-period (univariate or long format): One line/record for each assessment Person-period data format is usually preferable: Contains time and predictors at each occasion; More efficient format for unbalanced data.

6 Exploring longitudinal data
Empirical growth plots (spaghetti plots). If too many, select a random sample. Reveal how each person changes over time. Smoothing techniques for trends: Nonparametric: moving averages, splines, lowess and kernel smoothers. Examine intra- and inter-individual differences in the outcome. Gather ideas about functional form of change.

7 Spaghetti plots

8 Exploring longitudinal data (cont)
More formally: use OLS regression methods. Estimate within-person regressions. Record summary statistics (OLS parameter estimates, their standard errors, R2). Evaluate the fit for each person. Examine summary statistics across individuals (obtain their sample means and variances). Known biases: sample variance of estimated slopes > population variance in the rate of change.

9 Exploring longitudinal data (cont)
To explore effects of categorical predictors: Group individual plots. Examine smoothed individual growth trajectories for groups. Examine relationship between OLS parameter estimates and categorical predictors.

10 Selected References Singer, J. D., & Willet, J. B. (2003) Applied Longitudinal Data Analysis, Oxford University Press. Diggle,P. J., Heagerty, P., Liang, Kung-Yee, & Zeger, S. L. (2002). Analysis of Longitudinal Data, Oxford University Press. Weiss, R. (2005) Modeling Longitudinal Data, Springer.

11 Random Effects Models - Notation
Let Yij = outcome for ith person at the jth time point Let Y be a vector of all outcomes for all subjects X is a matrix of independent variables (such as cognitive activity frequency and time) Z is a matrix associated with random effects (typically includes a column of 1s and time)

12 Mixed Model Formulation
Y = X + Z +   are the “fixed effect” parameters Similar to the coefficients in a regression model Coefficients tell us how variables are related to baseline (or overall) level and change over time in the outcome  are the “random effects”, ~N(0,)  are the errors, ~N(0,2)

13 Working Memory

14 Random Effects Why use them?
Not everybody responds the same way (even people with similar demographic and regular cognitive activities respond differently) Want to allow for random differences in baseline level and rate of change that remain unexplained by the covariates

15 Random Effects Cont. Way to think about them
Two bins with numbers in them Every person draws a number from each bin and carries those numbers with them Predicted baseline level and change based on “fixed effects” adjusted according to a person’s random number

16 Random Effects Cont. Accounts for correlation in observations
Correlation structures Compound symmetry (common within-individual correlation) Autoregressive - AR(1) (each assessment most strongly correlated with previous one) Unstructured (most flexible)

17 Assumptions of Model Linearity Homoscedasticity (constant variance)
Errors are normally distributed Random effects are normally distributed Typically assume MAR

18 Interpretation of parameter estimates
Main effects Continuous variable: average association of one unit change in the independent variable with the baseline level of the outcome Categorical variable: how baseline level of outcome compares to “reference” category Time Average annual change in the outcome for “reference individual” Interactions with time How annual change varies by one unit change in an independent variable Covariance parameters

19 Graphical Tools for Checking Assumptions
Scatter plot Plot one variable against another one (such as random slope vs. random intercept) E.g. Residual plot Scatter plot of residuals vs. fitted values or a particular independent variable Quantile-Quantile plot (QQ plot) Plots quantiles of the data against quantiles from a specific distribution (normal distribution for us)

20 Residual Plot Ideal Residual Plot - “cloud” of points - no pattern
- evenly distributed about zero

21 Non-linear relationship
Residual plot shows a non-linear pattern (in this case, a quadratic pattern) Best to determine which independent variable has this relationship then include the square of that variable into the model

22 Non-constant variance
Residual plot exhibits a “funnel-like” pattern Residuals are further from the zero line as you move along the fitted values Typically suggests transforming the outcome variable (ln transform is most common)

23 QQ-Plot

24 Scatter plot of random effects

25 Example Back to some data
Interested in association between frequency of cognitive activity and decline in working memory Outcomes = working memory X includes lifetime cognitive activity frequency and time Incorporate a random intercept and slope, with unstructured covariance (allows for correlation between the random effects)

26 Working Memory Model Results (baseline)
Variable Estimate SE p-value Intercept -0.99 0.02 <0.001 Cognitive Activity Frequency 0.34 0.04

27 Model Results (change)
Variable Estimate SE p-value Time -0.16 0.03 <0.001 Time*Cognitive Activity Frequency 0.02 0.009 0.007

28 Advanced topics Time-varying covariates
Simultaneous growth models (modeling two types of longitudinal outcomes together) Allows you to directly compare associations of specific independent variables with the different outcomes Allows you to estimate the correlation between change in the two processes


Download ppt "Longitudinal Data & Mixed Effects Models"

Similar presentations


Ads by Google