Experimental Statistics - week 8
description
Transcript of Experimental Statistics - week 8
![Page 1: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/1.jpg)
1
Experimental StatisticsExperimental Statistics - week 8 - week 8Experimental StatisticsExperimental Statistics - week 8 - week 8
Chapter 17:
Mixed Models
Chapter 18:
Repeated Measures
![Page 2: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/2.jpg)
2
2-Factor Random Effects Model
ijk i j ij ijky
Assumptions:
2(0,2. ) i N :2-- normally distributed with mean 0 and variance
6. 's, 's, 's and are independent rv'si j ij ij
1. is overall mean
2(0,3. ) j N :2(0,4. ) ij N :
2(0,5. ) ijk N :
Sum-of-Squares obtained as in Fixed-Effects case
![Page 3: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/3.jpg)
3
Expected Mean Squares for
2-Factor ANOVA with Random EffectsRandom Effects:
A
B
AB
Error
2 2 2n bn
2
Expected MS
2 2 2n an
2 2n
![Page 4: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/4.jpg)
4
To Test:2
0
2
: 0
: 0a
H
H
we use F = MSA/MSAB
20
2
: 0
: 0a
H
H
we use F = MSB/MSAB
we use F = MSAB/MSE
20
2
: 0
: 0a
H
H
Note: Test each of these 3 hypotheses (no matter
whether Ho: is rejected)
![Page 5: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/5.jpg)
5
2-Factor Random Effects ANOVA Table
Source SS df MS F
Main Effects
A SSA a 1
B SSB b1
Interaction
AB SSAB (a 1)(b1)
Error SSE ab(n 1) Total TSS abn
/( 1)MSB SSB b
/ ( 1)MSE SSE ab n
/MSA MSAB
/( 1)( 1)MSAB SSAB a b
/MSB MSAB
/( 1)MSA SSA a
/MSAB MSE
![Page 6: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/6.jpg)
6
Estimating Variance Components2-Factor Random Effects Model
2ˆMSAB MSE
n
2ˆ MSE
2ˆMSA MSAB
bn
2ˆMSB MSAB
an
(note error on page 986)
![Page 7: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/7.jpg)
7
2ˆ
![Page 8: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/8.jpg)
8
DATA one;INPUT operator filter loss;DATALINES;1 1 16.21 1 16.81 1 17.11 2 16.61 2 16.91 2 16.8 . . .4 1 14.94 2 15.44 2 14.64 2 15.94 3 16.14 3 15.44 3 15.6;PROC GLM; CLASS operator filter; MODEL loss=operator filter operator*filter; TITLE ‘2-Factor Random Effects Model'; RANDOM operator filter operator*filter/test;RUN;
1 2 3 4 16.2 15.9 15.6 14.91 16.8 15.1 15.9 15.2 17.1 14.5 16.1 14.9
16.6 16.0 16.1 15.42 16.9 16.3 16.0 14.6 16.8 16.5 17.2 15.9
16.7 16.5 16.4 16.13 16.9 16.9 17.4 15.4 17.1 16.8 16.9 15.6
Operator
Filter
Filtration Process:Response - % material lost through filtrationA – Operator (randomly selected) (a = )B – Filter (randomly selected) (b = )
n =
![Page 9: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/9.jpg)
9
2-Factor Random Effects Model General Linear Models ProcedureDependent Variable: LOSS Sum of MeanSource DF Squares Square F Value Pr > FModel 11 16.60888889 1.50989899 8.16 0.0001Error 24 4.44000000 0.18500000Corrected Total 35 21.04888889
R-Square C.V. Root MSE LOSS Mean 0.789062 2.664175 0.4301163 16.144444
Source DF Type III SS Mean Square F Value Pr > FOPERATOR 3 10.31777778 3.43925926 18.59 0.0001FILTER 2 4.63388889 2.31694444 12.52 0.0002OPERATOR*FILTER 6 1.65722222 0.27620370 1.49 0.2229 Source Type III Expected Mean SquareOPERATOR Var(Error) + 3 Var(OPERATOR*FILTER) + 9 Var(OPERATOR)FILTER Var(Error) + 3 Var(OPERATOR*FILTER) + 12 Var(FILTER)OPERATOR*FILTER Var(Error) + 3 Var(OPERATOR*FILTER)
SAS Random-Effects Output(Filtration Data)
![Page 10: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/10.jpg)
10
Tests of Hypotheses for Random Model Analysis of VarianceDependent Variable: LOSS Source: OPERATORError: MS(OPERATOR*FILTER) Denominator Denominator DF Type III MS DF MS F Value Pr > F 3 3.4392592593 6 0.2762037037 12.4519 0.0055Source: FILTERError: MS(OPERATOR*FILTER) Denominator Denominator DF Type III MS DF MS F Value Pr > F 2 2.3169444444 6 0.2762037037 8.3885 0.0183Source: OPERATOR*FILTERError: MS(Error) Denominator Denominator DF Type III MS DF MS F Value Pr > F 6 0.2762037037 24 0.185 1.4930 0.2229
SAS Random-Effects Output – continued
“../test” option
![Page 11: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/11.jpg)
11
Filtration Problem Results and Conclusions
![Page 12: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/12.jpg)
12
Total Variability – 1-factor ModelBased on the 1-factor random effects model,
2 2 2Y
ij i ijy
it follows that the total variability in Y can be expressed as
As a result, an estimate of the proportion of variability explained by the random factor A can be estimated using
2
2 2
ˆ
ˆ ˆ
![Page 13: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/13.jpg)
13
For the operator data example (1-factor random effects example from Thursday’s lecture)
2
2 2
ˆ 28.91 28.91.78
28.91 8.32 37.23ˆ ˆ
i.e. 78% of the variability in Y is explained by the operator to operator variability
![Page 14: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/14.jpg)
14
Total Variability – 2 factor model
2 2 2 2 2Y
For better appreciation of the role of the individual factors, it is helpful to express each variance as the proportion of total variability it explains. The proportion of variability explained by
In 2-factor random effects model, we expressed the total variability in Y as
Factor A =
Factor B =
2
2 2 2 2
ˆ
ˆ ˆ ˆ ˆ
2
2 2 2 2
ˆ
ˆ ˆ ˆ ˆ
2
2 2 2 2
ˆ
ˆ ˆ ˆ ˆ
Factor AB =
![Page 15: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/15.jpg)
15
2-Factor Mixed Effects Model
ijk i j ij ijky
Assumptions:
1
02. a
ii
6. , 's and 's are independent rv'sj ij ijk
1. is overall mean
2(0,3. ) j N :
2(0,4. ) ij N :
2(0,5. ) ijk N :
Sum-of-Squares obtained as before
fixed random
![Page 16: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/16.jpg)
16
Expected Mean Squares for
2-Factor ANOVA with Mixed Effects Effects:
A
B
AB
Error
2 2 2
11
a
ii
nbn
a
2
SAS Expected MS
2 2 2n an
2 2n
(fixed)
(random)
Book’s Expected MS
2 2 2
11
a
ii
nbn
a
2 2an
2 2n
2
![Page 17: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/17.jpg)
17
To Test:
0 1 2: 0
: 0 at least one a
a i
H
H
use F =
20
2
: 0
: 0a
H
H
SAS uses F =
use F =
20
2
: 0
: 0a
H
H
Mixed-Effects Model
Again: Test each of these 3 hypotheses as in random-effects case.
MSAMSAB
MSBMSAB
MSABMSE
![Page 18: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/18.jpg)
18
2-Factor Mixed-Effects ANOVA Table(using SAS Expected MS)
Source SS df MS F
Main Effects
A SSA a 1
B SSB b1
Interaction
AB SSAB (a 1)(b1)
Error SSE ab(n 1) Total TSS abn
/( 1)MSB SSB b
/ ( 1)MSE SSE ab n
/MSA MSAB
/( 1)( 1)MSAB SSAB a b
/MSB MSAB
/( 1)MSA SSA a
/MSAB MSE
![Page 19: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/19.jpg)
19
Estimating Variance Components2-Factor Mixed-Effects Model
2ˆMSAB MSE
n
2ˆ MSE
2ˆMSB MSAB
an (based on SAS Expected MS)
Note: A is a fixed effect
![Page 20: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/20.jpg)
20
7.50 7.08 6.15 7.42 6.17 5.52
1 5.85 5.65 5.48 5.89 5.30 5.48 5.35 5.02 5.98
7.58 7.68 6.17 6.52 5.86 6.20
2 6.54 5.28 5.44 5.64 5.38 5.75 5.12 4.87 5.68
7.70 7.19 6.21 6.82 6.19 5.66
3 6.42 5.85 5.36 5.39 5.35 5.90 5.35 5.01 6.12
(F)ullMilitaryInspect.
(R)educedMilitaryInspect.
(C)ommercial
Inspector
Response – fatigue of mechanical part
A – type of inspection (a = )
B – inspector (randomly selected) (b = )
n =
Product Inspection
![Page 21: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/21.jpg)
21
DATA one;INPUT insp$ level$ fatigue;DATALINES;1 F 7.50 1 F 7.42 1 F 5.85 1 F 5.89 . . .2 C 5.683 C 6.213 C 5.663 C 5.363 C 5.903 C 6.12; PROC GLM; CLASS insp level; MODEL fatigue= level insp level*insp; TITLE 'Mixed-Effects Model';
RANDOM insp level*insp/test; RUN;PROC MEANS mean var; CLASS level; VAR fatigue;RUN;
Mixed-Effects Data
![Page 22: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/22.jpg)
22
Mixed-Effects Model The GLM ProcedureDependent Variable: fatigue Sum of Source DF Squares Mean Square F Value Pr > F Model 8 2.70711111 0.33838889 0.53 0.8282 Error 36 23.11448000 0.64206889 Corrected Total 44 25.82159111
R-Square Coeff Var Root MSE fatigue Mean 0.104839 13.35141 0.801292 6.001556
Source DF Type III SS Mean Square F Value Pr > F level 2 2.58739111 1.29369556 2.01 0.1481 insp 2 0.02523111 0.01261556 0.02 0.9806 insp*level 4 0.09448889 0.02362222 0.04 0.9973
SAS Mixed-Effects Output
![Page 23: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/23.jpg)
23
Mixed-Effects Model The GLM Procedure Source Type III Expected Mean Square level Var(Error) + 5 Var(insp*level) + Q(level) insp Var(Error) + 5 Var(insp*level) + 15 Var(insp) insp*level Var(Error) + 5 Var(insp*level)
Mixed-Effects Model The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance Dependent Variable: fatigue Source DF Type III SS Mean Square F Value Pr > F level 2 2.587391 1.293696 54.77 0.0012 insp 2 0.025231 0.012616 0.53 0.6229
Error 4 0.094489 0.023622 Error: MS(insp*level)
Source DF Type III SS Mean Square F Value Pr > F insp*level 4 0.094489 0.023622 0.04 0.9973
Error: MS(Error) 36 23.114480 0.642069
SAS Mixed-Effects Output - Continued
![Page 24: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/24.jpg)
24
Multiple Comparisons for Fixed Effect (Inspection Level)
-- Use MSAB in place of MSE
1 2(y y2 marginal means and ) are declared
to be significantly different (using LSD) if
1 2 22
( ) | | α/MSAB
y y tN
where ▪ N denotes the # of observations involved in the computation of a marginal mean ▪ v denotes the df associated with AB interaction
![Page 25: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/25.jpg)
25
The MEANS Procedure Analysis Variable : fatigue N level Obs Mean Variance ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ C 15 5.8066667 0.0981810 F 15 6.3393333 0.8208638 R 15 5.8586667 0.7405410 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
SAS Mixed-Effects Output –
Output from PROC Means
![Page 26: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/26.jpg)
26
Mixed-Effects Example Results and Conclusions:
![Page 27: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/27.jpg)
27
Repeated Measures Designs
Setting:1. Random sample of “subjects”
2. Each subject is measured at t different time points
3. Interested in the effect of treatment over time
![Page 28: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/28.jpg)
28
Repeated Measures with a Single Factor
Time
11 21 1
12 22 2
1 2
1 2
1
2
...
...
...
t
t
n n tn
t
y y y
y y y
n y y y
Subject
:ijy
ith time period
jth subject
Reading for
![Page 29: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/29.jpg)
29
Single Factor Repeated Measures Designs
• single factor repeated measures model is similar to the randomized complete block model - i.e. 2 factors (subject and time) with one observation cell - since there is only one observation per cell, we cannot estimate an interaction term
• typically: - subject is a random effect - time is a fixed effect
ij i j ijy
time subject
![Page 30: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/30.jpg)
30
ANOVA Table for Repeated Measure Design with Single Factor
Source SS df MS EMS F
Between subjects SSP n 1 MSP MSP/MSE Time SSA a 1 MSA MSA/MSE
Error SSE (n 1)(a 1) MSE
Total TSS an
2 2
11
t
ii
na
2 2a
2
![Page 31: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/31.jpg)
31
Data – 5 subjects take tablet
-- blood samples taken .5, 1, 2, 3, and 4 hours after ingestion
Goal: understand rate at which medicine enters blood
Time
Subject .5 1 2 3 4
1 50 75 120 60 30
2 40 80 135 70 40
3 55 75 125 85 50
4 70 85 140 90 40
5 60 90 150 95 50
![Page 32: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/32.jpg)
32
Dependent Variable: conc Sum of Source DF Squares Mean Square F Value Pr > F Model 8 26442.00000 3305.25000 66.60 <.0001 Error 16 794.00000 49.62500 Corrected Total 24 27236.00000
R-Square Coeff Var Root MSE conc Mean 0.970847 8.985333 7.044501 78.40000
Source DF Type III SS Mean Square F Value Pr > F subject 4 1576.00000 394.00000 7.94 0.0010 time 4 24866.00000 6216.50000 125.27 <.000
![Page 33: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/33.jpg)
33
The GLM Procedure t Tests (LSD) for conc NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 16 Error Mean Square 49.625 Critical Value of t 2.11991 Least Significant Difference 9.4449
Means with the same letter are not significantly different.
t Grouping Mean N time
A 134.000 5 2
B 81.000 5 1 B B 80.000 5 3
C 55.000 5 0.5
D 42.000 5 4
![Page 34: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/34.jpg)
34
![Page 35: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/35.jpg)
35
Results:
![Page 36: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/36.jpg)
36
Residual Diagnostics – 1-factor Repeated Measures Data
![Page 37: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/37.jpg)
37
Two-Factor Repeated Measure Data (p.1033)
Data – 10 subjects (5 take tablet, 5 take capsule)
-- blood samples .5, 1, 2, 3, and 4 hours after ingestion
Goal: compare blood concentration patterns of the two methods of administration
Time
Subject .5 1 2 3 4
1 50 75 120 60 30
2 40 80 135 70 40
3 55 75 125 85 50
4 70 85 140 90 40
5 60 90 150 95 50
Time
Subject .5 1 2 3 4
1 30 55 80 130 65
2 25 50 75 125 60
3 35 65 85 140 85
4 45 70 90 145 80
5 50 75 95 160 90
Tablet Capsule
![Page 38: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/38.jpg)
38
( )ijk i j i k ik ijky
2-Factor with Repeated Measure -- Model
type subject within type
timetype by time interaction
NOTE: type and time are both fixed effects in the current example
![Page 39: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/39.jpg)
39
PROC GLM; CLASS type subject time; MODEL conc=type subject(type) time type*time; TITLE 'Repeated Measures – 2 factors'; OUTPUT out=new r=resid; MEANS type time/LSD; RANDOM subject(type)/test;
![Page 40: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/40.jpg)
40
The GLM ProcedureDependent Variable: conc Sum ofSource DF Squares Mean Square F Value Pr > FModel 17 57720.50000 3395.32353 110.87 <.0001Error 32 980.00000 30.62500Corrected Total 49 58700.50000
R-Square Coeff Var Root MSE conc Mean 0.983305 6.978545 5.533986 79.30000
Source DF Type III SS Mean Square F Value Pr > F
type 1 40.50000 40.50000 1.32 0.2587subject(type) 8 3920.00000 490.00000 16.00 <.0001time 4 34288.00000 8572.00000 279.90 <.0001type*time 4 19472.00000 4868.00000 158.96 <.0001
2-Factor Repeated Measures – ANOVA Output
![Page 41: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/41.jpg)
41
2-factor Repeated Measures
Source Type III Expected Mean Square
type Var(Error) + 5 Var(subject(type)) + Q(type,type*time) subject(type) Var(Error) + 5 Var(subject(type)) time Var(Error) + Q(time,type*time) type*time Var(Error) + Q(type*time)
The GLM Procedure Tests of Hypotheses for Mixed Model Analysis of Variance
Dependent Variable: conc Source DF Type III SS Mean Square F Value Pr > F* type 1 40.500000 40.500000 0.08 0.7810 Error 8 3920.000000 490.000000Error: MS(subject(type))* This test assumes one or more other fixed effects are zero. Source DF Type III SS Mean Square F Value Pr > F subject(type) 8 3920.000000 490.000000 16.00 <.0001* time 4 34288 8572.000000 279.90 <.0001 type*time 4 19472 4868.000000 158.96 <.0001 Error: MS(Error) 32 980.000000 30.625000
![Page 42: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/42.jpg)
42
NOTE: Since time x type interaction is significant, and since these are fixed effects we DO NOT test main effects
– we compare cell means (using MSE)
.0252 2(30.6250)
(32) 2.042 7.1475 5
MSELSD t
.5 1 2 3 4 C 37 63 85 140 76 T 55 81 134 80 42
Cell Means
![Page 43: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/43.jpg)
43
![Page 44: Experimental Statistics - week 8](https://reader036.fdocuments.us/reader036/viewer/2022062423/568149e3550346895db70b83/html5/thumbnails/44.jpg)
44
Diagnostic Plots for 2-Factor Repeated Measures Data