Mixed models with correlated measurement errors

Similar documents
Intruction to General and Generalized Linear Models

REPEATED MEASURES. Copyright c 2012 (Iowa State University) Statistics / 29

Outline. Statistical inference for linear mixed models. One-way ANOVA in matrix-vector form

22s:152 Applied Linear Regression. Returning to a continuous response variable Y...

22s:152 Applied Linear Regression. In matrix notation, we can write this model: Generalized Least Squares. Y = Xβ + ɛ with ɛ N n (0, Σ)

Course topics (tentative) The role of random effects

Non-independence due to Time Correlation (Chapter 14)

Linear models. Rasmus Waagepetersen Department of Mathematics Aalborg University Denmark. October 5, 2016

Modeling the Covariance

Repeated Measures ANOVA Multivariate ANOVA and Their Relationship to Linear Mixed Models

Auto correlation 2. Note: In general we can have AR(p) errors which implies p lagged terms in the error structure, i.e.,

Stat 579: Generalized Linear Models and Extensions

Linear models and their mathematical foundations: Simple linear regression

20. REML Estimation of Variance Components. Copyright c 2018 (Iowa State University) 20. Statistics / 36

Covariance Models (*) X i : (n i p) design matrix for fixed effects β : (p 1) regression coefficient for fixed effects

SLR output RLS. Refer to slr (code) on the Lecture Page of the class website.

Prediction. is a weighted least squares estimate since it minimizes. Rasmus Waagepetersen Department of Mathematics Aalborg University Denmark

Random Coefficients Model Examples

Questions and Answers on Heteroskedasticity, Autocorrelation and Generalized Least Squares

Stat 579: Generalized Linear Models and Extensions

5 Transfer function modelling

CAMPBELL COLLABORATION

36-720: Linear Mixed Models

Analysis of variance using orthogonal projections

Analysing data: regression and correlation S6 and S7

Quantitative Analysis of Financial Markets. Summary of Part II. Key Concepts & Formulas. Christopher Ting. November 11, 2017

Random and Mixed Effects Models - Part II

ANOVA Situation The F Statistic Multiple Comparisons. 1-Way ANOVA MATH 143. Department of Mathematics and Statistics Calvin College

SPSS Output. ANOVA a b Residual Coefficients a Standardized Coefficients

Cuckoo Birds. Analysis of Variance. Display of Cuckoo Bird Egg Lengths

Random and Mixed Effects Models - Part III

Randomized Block Designs with Replicates

STAT 5200 Handout #23. Repeated Measures Example (Ch. 16)

Correlated Data: Linear Mixed Models with Random Intercepts

Longitudinal Data Analysis

WLS and BLUE (prelude to BLUP) Prediction

STAT 135 Lab 11 Tests for Categorical Data (Fisher s Exact test, χ 2 tests for Homogeneity and Independence) and Linear Regression

The First Thing You Ever Do When Receive a Set of Data Is

PS 271B: Quantitative Methods II Lecture Notes

The Random Effects Model Introduction

Workshop 9.3a: Randomized block designs

Minitab Project Report - Assignment 6

df=degrees of freedom = n - 1

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS. Duration - 3 hours. Aids Allowed: Calculator

Multiple Linear Regression

Repeated measures, part 1, simple methods

1. How can you tell if there is serial correlation? 2. AR to model serial correlation. 3. Ignoring serial correlation. 4. GLS. 5. Projects.

Statistical Methods III Statistics 212. Problem Set 2 - Answer Key

Coping with Additional Sources of Variation: ANCOVA and Random Effects

STK4900/ Lecture 10. Program

STAT Regression Methods

Outline for today. Two-way analysis of variance with random effects

Multiple Predictor Variables: ANOVA

General Linear Model (Chapter 4)

A brief introduction to mixed models

Correlation and the Analysis of Variance Approach to Simple Linear Regression

Linear, Generalized Linear, and Mixed-Effects Models in R. Linear and Generalized Linear Models in R Topics

Stat 579: Generalized Linear Models and Extensions

Measuring relationships among multiple responses

EC402: Serial Correlation. Danny Quah Economics Department, LSE Lent 2015

Mixed Model: Split plot with two whole-plot factors, one split-plot factor, and CRD at the whole-plot level (e.g. fancier split-plot p.

Week 5 Quantitative Analysis of Financial Markets Characterizing Cycles

For more information about how to cite these materials visit

Stat 209 Lab: Linear Mixed Models in R This lab covers the Linear Mixed Models tutorial by John Fox. Lab prepared by Karen Kapur. ɛ i Normal(0, σ 2 )

Exam: high-dimensional data analysis February 28, 2014

lme4 Luke Chang Last Revised July 16, Fitting Linear Mixed Models with a Varying Intercept

SAS Procedures Inference about the Line ffl model statement in proc reg has many options ffl To construct confidence intervals use alpha=, clm, cli, c

Scenario 5: Internet Usage Solution. θ j

A Practitioner s Guide to Cluster-Robust Inference

Principal Component Analysis (PCA) Principal Component Analysis (PCA)

Contrasting Marginal and Mixed Effects Models Recall: two approaches to handling dependence in Generalized Linear Models:

Mixed Models Lecture Notes By Dr. Hanford page 199 More Statistics& SAS Tutorial at

Latent Growth Models 1

unadjusted model for baseline cholesterol 22:31 Monday, April 19,

These slides illustrate a few example R commands that can be useful for the analysis of repeated measures data.

STATISTICS 479 Exam II (100 points)

Repeated Measures Data

Introduction and Background to Multilevel Analysis

Multiple Regression. More Hypothesis Testing. More Hypothesis Testing The big question: What we really want to know: What we actually know: We know:

White Noise Processes (Section 6.2)

IV Estimation and its Limitations: Weak Instruments and Weakly Endogeneous Regressors

Random effects & Repeated measurements

SPH 247 Statistical Analysis of Laboratory Data

Exam Applied Statistical Regression. Good Luck!

The regression model with one stochastic regressor (part II)

Ch 2: Simple Linear Regression

Introduction and Single Predictor Regression. Correlation

Correlation and simple linear regression S5

Written Exam (2 hours)

Economics Department LSE. Econometrics: Timeseries EXERCISE 1: SERIAL CORRELATION (ANALYTICAL)

Simple Linear Regression for the Climate Data

K. Model Diagnostics. residuals ˆɛ ij = Y ij ˆµ i N = Y ij Ȳ i semi-studentized residuals ω ij = ˆɛ ij. studentized deleted residuals ɛ ij =

CHAPTER 4: Forecasting by Regression

Simple Linear Regression

Lecture 11: Simple Linear Regression

SAS Commands. General Plan. Output. Construct scatterplot / interaction plot. Run full model

Basics: Definitions and Notation. Stationarity. A More Formal Definition

Models for longitudinal data

Business Statistics. Lecture 10: Course Review

Longitudinal Data Analysis Using Stata Paul D. Allison, Ph.D. Upcoming Seminar: May 18-19, 2017, Chicago, Illinois

Transcription:

Mixed models with correlated measurement errors Rasmus Waagepetersen October 9, 2018

Example from Department of Health Technology 25 subjects where exposed to electric pulses of 11 different durations using two different electrodes (3=pin, 2=patch). The durations were applied in random order. In total 550 measurements of response to pulse exposure. Fixed effects in the model: electrode, Pulseform (duration), order of 22 measurements for each subject. Random effects: one random effect for each subject-electrode combination (50 random effects).

Mixed model with random intercepts Model: y ijk = µ ij + U ij + ɛ ijk where i = 1,..., 25 (subject), j = 2, 3 (electrode), and k = 1,..., 11 measurement within subject-electrode combination. µ ij fixed effect part of the model depending on electrode, Pulseform and order of measurement. U ij s and ɛ ij s independent random variables.

Using lmer fit=lmer(transfpt~electrodeid*pulseform+ electrodeid*orderfixed+(1 electrsubid),data=perception Random effects: Groups Name Variance Std.Dev. electrsubid (Intercept) 0.03479 0.1865 Residual 0.01317 0.1148 Number of obs: 550, groups: electrsubid, 50 Large subject-electrode variance 0.03479. Noise variance 0.01317

Effect of Pulseform (duration) duration effect 1.2 1.0 0.8 0.6 0.4 0.2 0.0 0 20 40 60 80 100 dur Blue: pin electrode (code 3). Black: patch electrode (code 2).

Serial correlation in measurement error? Maybe error ɛ ijk not independent of previous error ɛ ij(k 1) since measurements carried out in a sequence for each subject? For each subject-electrode combination ij plot residual r ijk (resid(fit)) against previous residual r ij(k 1) for k = 2,..., 11. 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.6 0.4 0.2 0.0 0.2 0.4 0.6 resi1 resi2

Correlation cor.test(resi1,resi2) Pearson s product-moment correlation data: resi1 and resi2 t = 8.5284, df = 498, p-value < 2.2e-16 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: 0.2779966 0.4311777 sample estimates: cor 0.3569848

Mixed model with correlated errors Analysis of residuals r ijk (which are estimates of errors ɛ ijk ) suggests that ɛ ijk are correlated (not independent). Recall general mixed model formulation: Y = X β + ZU + ɛ where ɛ normal with mean zero and covariance Σ. So far Σ = σ 2 I meaning noise terms uncorrelated and all with same variance σ 2 Extension: Σ not diagonal meaning Cov[ɛ i, ɛ i ] 0. Many possibilities for Σ - we will focus on autoregressive covariance structure that is useful for serially correlated error terms.

Basic model for serial correlation: autoregressive Consider sequence of noise terms: ɛ 1, ɛ 2,..., ɛ m. Model for variance/covariance: Cov(ɛ i, ɛ j ) = σ 2 ρ i j Corr(ɛ i, ɛ j ) = ρ i j Thus Varɛ i = σ 2 and ρ is correlation between two consecutive noise terms e.g. ɛ i and ɛ i+1 ρ = Corr(ɛ i, ɛ i+1 )

Interpretation of autoregressive model Covariance structure arises from following autoregressive model: ɛ i+1 = ρɛ i + ν i+1 (1) where ɛ 1 N(0, σ 2 ), and ν l N(0, ω) ω = σ 2 (1 ρ 2 ) l = 2,..., m ɛ 1, ν 2,..., ν m assumed to be independent.

Implementation Not possible in lmer :( However lme (from package nlme) can do the trick (thanks, Mads): fit=lme(transfpt~factor(electrodeid)*pulseform+factor(electrodeid)*orderfixed, random=~1 electrsubid,data=perception,correlation=corar1()) lme predecessor of lmer - both have pros and cons - but here lme has the upper hand. SPSS: specification using Repeated. Here we can select repeated variable: order of observations within subject subject variable: noise terms for different subjects assumed to independent covariance structure for noise terms within subject E.g. for perception data we may have 11 serially correlated errors for each subject-electrode combination but errors are uncorrelated between different subject-electrode combinations.

Repeated in SPSS OrderFixed: from 1-11 within each electrode-subject combination Covariance structure: AR(1)

Estimates of variance parameters With uncorrelated errors: τ 2 = 0.035 σ 2 = 0.013 With autoregressive errors: τ 2 = 0.030 σ 2 = 0.018 ρ = 0.626 Variance parameters not so different but quite big estimated correlation for errors. Qualitatively same conclusions regarding significance of fixed effects (F -tests). Bigger standard errors of parameter estimates for model with correlated noise - makes sense!

Model assessment - residuals Histogram of resi resi Frequency 0.4 0.0 0.2 0.4 0.6 0 50 100 150 200 3 2 1 0 1 2 3 0.4 0.2 0.0 0.2 0.4 Normal Q Q Plot Theoretical Quantiles Sample Quantiles 2 3 0.4 0.2 0.0 0.2 0.4 a.2 e.2 i.2 b.3 f.3 j.3 0.4 0.2 0.0 0.2 0.4 3 2 1 0 1 2 3 0.4 0.2 0.0 0.2 0.4 pin Theoretical Quantiles Sample Quantiles 3 2 1 0 1 2 3 0.2 0.1 0.0 0.1 0.2 patch Theoretical Quantiles Sample Quantiles

Much larger residual variance for pin electrode than for patch electrode. Still room for improvement of model! SAS PROC MIXED has group option to obtain variance heterogeneity over groups. Seems not available in SPSS Separate analyses for two electrodes?

Exercises 1. Given the model (1) verify that ɛ i+1 N(0, σ 2 ) and Corr(ɛ i, ɛ i+1 ) = ρ. 2. Fit model with autoregressive errors to the Orthodont dataset.