Mixed models Alexandra Kuznetsova Biostatistician Leo Pharma Efficacy
Mixed models Alexandra Kuznetsova Biostatistician, Leo Pharma
Efficacy data • Simulated data in an ADa. M-like format • 30 subjects with psoriasis skin disease were randomized to 3 treatment arms in 1: 1: 1. Treatments had a concentration of an active drug 1%, 2%, 3%. • Effectiveness of the treatments was measured in terms of thickness and redness of the skin drug 1% Drug application drug 2% Redness assessments Thickness measurements drug 3% Day 1 Day 2 Day 3 Day 4 Day 5 Day 6 Day 7 Day 8
Efficacy data Thickness measured at Day 1 (baseline), Day 4, Day 6, Day 8 Redness measured at Day 1, Day 2, Day 3, Day 4, Day 5, Day 6, Day 7, Day 8 Objective: compare treatments in terms of thickness, redness at Day 8
Efficacy data, redness • Profile plots
Modelling, mixed model with one random subject effect Main treatment effect Fixed effects Main day effect Day * treatment interaction effect Random subject effect
Modelling, mixed model with one random subject effect Variance-covariance matrix of Redness:
Modelling, MMRM, spatial gaussian correlation Variance-covariance matrix of Redness:
Mixed models, R • lme 4 package • • Fast, can handle large data can handle multiple crossed effects User-friendly JSS (https: //www. jstatsoft. org/article/view/v 067 i 01) • nlme package • • Can handle variance covariance structures (MMRM) Well documented (Pinheiro and Bates, 2010) Difficult syntax Cannot handle multiple crossed random effects
lme 4 package, CRAN
Other R- packages that depend on lme 4
Useful packages that depend on lme 4 • emmeans for calculating least squares means, differences of leastsquares means e t. c. • pbkrtest for calculating Kenward-Roger’s adjusted F-statistics and denominator degrees of freedom • lmer. Test for calculating Satterthwaites degrees of freedom, Type Ⅲ hypothesis tests, step-wise selection • …
Mixed model, lme 4
Modelling, mixed model with one random subject effect, lme 4 Fixed effects Random effect NOTE: by default the first level in fixed effect is set to 0 (in SAS the last one) NOTE: check classes of variables before fitting a model! Estimates of the coefficients, REML, variance estimates F-tests for fixed effects
Modelling, mixed model with one random subject effect, lme 4
nlme package, CRAN
Modelling, MMRM, nlme Fixed effects NOTE: ADY must be covariate!
Modelling, MMRM, nlme
MMRM. Treatment differences at Day 8
MMRM, unstructured covariance
Exercises, MMRM • Use the same data dat_mmrm. csv. Subset the data for response variable thickness • Plot the data • Fit a model with a random scalar effect either using nlme package and gls function or lme 4 package. • Extend the model by adding correlation structure. • Try different correlation structures. Use ? cor. Classes • Make diagnostic plots • Formulate a conclusion about difference between treatments at Day 8.
- Slides: 20