Lecture1 S3RI 2013

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

Lecture 1: Introduction to Mixed Models with Applications in Medicine

Lecture 1: Introduction to Mixed Models


with Applications in Medicine
Dankmar B
ohning
Southampton Statistical Sciences Research Institute
University of Southampton, UK

S3 RI, 10-11 June 2013

Lecture 1: Introduction to Mixed Models with Applications in Medicine

Data with simple cluster structure

Testing random effects

Mixed modelling in STATA

Reliability

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

Data with simple cluster structure


consider the following study data:
I

interest is in the amount of impurity in a pharmaceutical


product

data arise in form of batches of material as they come off the


production line

6 batches are randomly selected

4 determinations are made per batch

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

Data:
Batch
1
2
3
4
5
6

Determination of impurity (in%)


1
2
3
4
3.28 3.09 3.03
3.07
3.52 3.48 3.38
3.43
2.91 2.80 2.76
2.85
3.34 3.38 3.23
3.31
3.28 3.14 3.25
3.21
2.98 3.01 3.13
2.95

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

questions of interest
I

to determine the average amount of impurity

batch effect?

how large is variation between batches ?

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

ONEWAY fixed effect model


Yij = + i + ij
I

i = 1, , 6, j = 1, , 4

i unknown fixed parameters,

random error ij

i = 0

N(0, 2 )

E (Yij ) = + i

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

Problems with the ONEWAY fixed effect model


I

number of parameters increases with the number of batches

interest is not in a specific effect but more in a general batch


effect

model assumes independence of observations within batches

variance of observations is determined by variance of errors


Var (Yij ) = Var (ij ) = 2
and might likely underestimate variance

hence confidence intervals for average impurity amount might


be too small

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

more suitable is the ONEWAY random effects model


Yij = + i + ij
I

i = 1, , 6, j = 1, , 4

i N(0, B2 ) are random effects

random error ij N(0, 2 )

i and ij independent

E (Yij ) =

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

ONEWAY random effects model


Yij = + i + ij
I

Var (Yij ) = Var (i ) + Var (ij ) = B2 + 2

model is a variance components model

covariance between batches is 0


cov (Yij , Y`k ) = 0
if ` 6= i, j 6= k

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

ONEWAY random effects model


Yij = + i + ij
I

covariance within batches is not 0 (j 6= k):


cov (Yij , Yik ) = E (i2 ) + E (i ij )E (i ik ) + E (ik ij ) = B2

hence random effects model is suitable to model within


batches correlation (autocorrelation model)

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Data with simple cluster structure

Data with simple cluster structure

Testing random effects

Mixed modelling in STATA

Reliability

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Testing random effects

ONEWAY random effects model


random effects
Yij = + i + ij
fixed effects
Yij = + i + ij
I

fixed effects models has as many parameters i as there are


levels of the factor

potentially many parameters

random effects model has only one parameter B2

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Testing random effects

Testing the random effect


random effects
Yij = + i + ij
how can we test the significance of a random effect?
Var (Yij ) = 2 + B2

test if B2 = 0

H0 : B2 = 0

vs.
H1 : B2 > 0

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Testing random effects

Likelihood ratio test (LRT)


random effects model
Yij = + i + ij
has mean E (Yij ) = and
Var (Yij ) = 2 + B2
hence the normal density is
1 (yij )2
exp
Lij = q
2 ( 2 + B2 )
2( 2 + B2 )
1

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Testing random effects

Likelihood ratio test (LRT)


the full sample log-likelihood becomes
XX
log L =
log Lij
i

and the likelihood ratio test becomes


2 log = 2(log L1 log L0 )
where the index refers to the value of B2 under the hypothesis
(B2 = 0 for H0 and B2 > 0 for H1 )
2 log is evaluated on a 2 scale with 1df

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Testing random effects

Data with simple cluster structure

Testing random effects

Mixed modelling in STATA

Reliability

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Mixed modelling in STATA

ONEWAY random effects model in STATA


I

use multi-level mixed-effects linear regression module in


STATA

specify dependent variable (Yij )

specific random effect(s)

change under reporting to variances and covariances

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Mixed modelling in STATA

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Mixed modelling in STATA

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Mixed modelling in STATA

Important information from STATA output


I

overall estimate of mean is 3.16 with 95% CI: 2.983.34

estimate of random error variance 2 = 0.0057

estimate of random effect (batch) variance B2 = 0.0474

likelihood ratio test 2 log = 30.83 with p-value 0.0000


(highly significant)

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Mixed modelling in STATA

Data with simple cluster structure

Testing random effects

Mixed modelling in STATA

Reliability

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Reliability

Reliability analysis
I

often interest is in determining the reliability of a


measurement device (instrument, questionnaire,...)

this means to investigate how reliable the measurement


process is

or how well measurements can be reproduced if the process is


repeated

for this purpose several measurements are taken for each unit

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Reliability

A case study
I

in a microbiological experiment the number of colonies (on


log-scale) of the E. coli 0157:H7 pathogen in contaminated
fecal samples from 12 beef carcasses were determined

two repeated measurements were taken from each of the 12


carcasses for a new test (Petrifilm HEC) and a standard test

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Reliability

Data:
carcass
1
1
2
2
3
3
4
4
5
5
6
6

colonSta
2.356
2.384
2.149
2.263
2.452
2.417
2.255
2.299
2.694
2.684
2.430
2.440

colonNew
2.283
2.265
2.061
1.987
2.322
2.316
2.162
2.127
2.068
2.111
2.322
2.280

carcass
7
7
8
8
9
9
10
10
11
11
12
12

colonSta
2.322
2.491
2.322
2.041
2.491
2.322
2.322
2.322
2.322
2.491
2.491
2.785

colonNew
2.491
2.491
2.041
2.041
2.322
2.041
2.491
2.710
2.041
2.322
2.785
2.322

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Reliability

ONEWAY random effects model for reliability analysis


Yij = + i + ij
I

i = 1, , 12, j = 1, 2

i N(0, B2 ) are random effects (beef carcass)

random error ij N(0, 2 )

i and ij independent

Var (Yij ) = B2 + 2
I

clearly, the larger B2 relative to 2 , the higher the


reliability

Lecture 1: Introduction to Mixed Models with Applications in Medicine


Reliability

Analysis of study data:


test
standard
new test

B2
0.0172
0.0291

2
0.0112
0.0180

reliability B2 /(B2 + 2 )
0.6055
0.6183

You might also like