Multidisciplinary COllaboration: Why and How?

Download Report

Transcript Multidisciplinary COllaboration: Why and How?

Analysis of Variance (ANOVA)
EPP 245
Statistical Analysis of
Laboratory Data
1
The Basic Idea
• The analysis of variance is a way of
testing whether observed differences
between groups are too large to be
explained by chance variation
• One-way ANOVA is used when there are
k ≥ 2 groups for one factor, and no other
quantitative variable or classification
factor.
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
2
A
November 2, 2006
B
C
9
10
12
7
9
14
7
8
14
9
9
12
EPP 245 Statistical Analysis of
Laboratory Data
3
Data = Grand Mean +
Row Deviations from grand mean +
Cell Deviations from row mean
Are the row deviations from the grand mean
too big to be accounted for by the cell
deviations from the row means?
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
4
Data
A
November 2, 2006
B
C
9
10
12
7
9
14
7
8
14
9
9
12
EPP 245 Statistical Analysis of
Laboratory Data
5
Cell Means
A
November 2, 2006
B
C
8
9
13
8
9
13
8
9
13
8
9
13
EPP 245 Statistical Analysis of
Laboratory Data
6
Deviations from Cell Means
A
November 2, 2006
B
C
1
1
-1
-1
0
1
-1
-1
1
1
0
-1
EPP 245 Statistical Analysis of
Laboratory Data
7
Red cell folate data
Description:
22 rows and 2 columns.
data on red cell folate levels in patients receiving three
different methods of ventilation during anesthesia.
Format:
folate a numeric vector. Folate concentration (g/l).
ventilation a factor with levels 'N2O+O2,24h': 50% nitrous oxide
and 50% oxygen, continuously for 24 hours; 'N2O+O2,op': 50%
nitrous oxide and 50% oxygen, only during operation;
'O2,24h': no nitrous oxide, but 35-50% oxygen for 24 hours.
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
8
insheet using redcell.csv
summarize folate
tabulate ventilation
tabulate ventilation, summarize (folate)
graph box folate, over (ventilation)
graph export folate1.wmf
oneway folate ventilation
describe ventilation
encode ventilation, generate(dv)
Describe dv
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
9
. summarize folate
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------folate |
22
283.2273
51.28439
206
392
. tabulate ventilation
ventilation |
Freq.
Percent
Cum.
------------+----------------------------------N2O+O2,24h |
8
36.36
36.36
N2O+O2,op |
9
40.91
77.27
O2,24h |
5
22.73
100.00
------------+----------------------------------Total |
22
100.00
. tabulate ventilation, summarize (folate)
|
Summary of folate
ventilation |
Mean
Std. Dev.
Freq.
------------+-----------------------------------N2O+O2,24h |
316.625
58.717088
8
N2O+O2,op |
256.44444
37.121797
9
O2,24h |
278
33.756481
5
------------+-----------------------------------Total |
283.22727
51.284391
22
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
10
400
350
300
250
200
N2O+O2,24h
November 2, 2006
N2O+O2,op
EPP 245 Statistical Analysis of
Laboratory Data
O2,24h
11
. oneway folate ventilation
Analysis of Variance
Source
SS
df
MS
F
Prob > F
-----------------------------------------------------------------------Between groups
15515.7664
2
7757.88321
3.71
0.0436
Within groups
39716.0972
19
2090.32091
-----------------------------------------------------------------------Total
55231.8636
21
2630.08874
Bartlett's test for equal variances:
November 2, 2006
chi2(2) =
EPP 245 Statistical Analysis of
Laboratory Data
2.0951
Prob>chi2 = 0.351
12
. describe ventilation
storage display
value
variable name
type
format
label
variable label
------------------------------------------------------------------------------ventilation
str10 %10s
. encode ventilation, generate(dv)
. describe dv
storage display
value
variable name
type
format
label
variable label
------------------------------------------------------------------------------dv
long
%10.0g
dv
. anova folate dv
Number of obs =
Root MSE
=
22
45.72
R-squared
=
Adj R-squared =
0.2809
0.2052
Source | Partial SS
df
MS
F
Prob > F
-----------+---------------------------------------------------Model | 15515.7664
2 7757.88321
3.71
0.0436
|
dv | 15515.7664
2 7757.88321
3.71
0.0436
|
Residual | 39716.0972
19 2090.32091
-----------+---------------------------------------------------Total | 55231.8636
21 2630.08874
November 2, 2006
EPP 245 Statistical Analysis of
13
Laboratory Data
Two- and Multi-way ANOVA
• If there is more than one factor, the sum of
squares can be decomposed according to
each factor, and possibly according to
interactions
• One can also have factors and quantitative
variables in the same model (cf. analysis
of covariance)
• All have similar interpretations
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
14
Heart rates after enalaprilat
Description:
36 rows and 3 columns.
data for nine patients with congestive heart failure before and
shortly after administration of enalaprilat, in a balanced two-way
layout.
Format:
hr a numeric vector. Heart rate in beats per minute.
subj a factor with levels '1' to '9'.
time a factor with levels '0' (before), '30',
(minutes after administration).
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
'60', and
'120'
15
. drop _all
. insheet using heart.rate.csv
(4 vars, 36 obs)
. anova hr subj time
Number of obs =
Root MSE
=
36
3.5165
R-squared
=
Adj R-squared =
0.9685
0.9540
Source | Partial SS
df
MS
F
Prob > F
-----------+---------------------------------------------------Model | 9117.52778
11 828.866162
67.03
0.0000
|
subj | 8966.55556
8 1120.81944
90.64
0.0000
time | 150.972222
3 50.3240741
4.07
0.0180
|
Residual | 296.777778
24 12.3657407
-----------+---------------------------------------------------Total | 9414.30556
35 268.980159
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
16
140
120
60
80
100
November 2, 2006
1
2
3
EPP 245 Statistical Analysis of
4
5
6
Laboratory Data
7
8
917
140
120
60
80
100
November 2, 2006
0
EPP 245 Statistical Analysis of
30
60
Laboratory Data
120
18
. anova hr subj
Number of obs =
36
Root MSE
= 4.07226
R-squared
=
Adj R-squared =
0.9524
0.9383
Source | Partial SS
df
MS
F
Prob > F
-----------+---------------------------------------------------Model | 8966.55556
8 1120.81944
67.59
0.0000
|
subj | 8966.55556
8 1120.81944
67.59
0.0000
|
Residual |
447.75
27 16.5833333
-----------+---------------------------------------------------Total | 9414.30556
35 268.980159
. predict hrhat
(option xb assumed; fitted values)
. generate hrres = hr - hrhat
. graph box hrres, over (time)
. graph export hrresxtime.wmf
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
19
15
0
5
10
-5
November 2, 2006
0
EPP
30245 Statistical Analysis of 60
Laboratory Data
120
20
. anova hr subj time
Number of obs =
Root MSE
=
36
3.5165
R-squared
=
Adj R-squared =
0.9685
0.9540
Source | Partial SS
df
MS
F
Prob > F
-----------+---------------------------------------------------Model | 9117.52778
11 828.866162
67.03
0.0000
|
subj | 8966.55556
8 1120.81944
90.64
0.0000
time | 150.972222
3 50.3240741
4.07
0.0180
|
Residual | 296.777778
24 12.3657407
-----------+---------------------------------------------------Total | 9414.30556
35 268.980159
.
.
.
.
.
.
rvfplot
graph export hrrvf.wmf
rvpplot subj
graph export hrrvpsubj.wmf
rvpplot time
graph export hrrvptime.wmf
November 2, 2006
EPP 245 Statistical Analysis of
Laboratory Data
21
0
5
10
-5
-10
60
November 2, 2006
80
100
EPP 245 Statistical
Fitted Analysis
valuesof
Laboratory Data
120
140
22
0
5
10
-5
-10
0
November 2, 2006
2
4
6
EPP 245 Statistical
Analysis of
subj
Laboratory Data
8
23
10
0
5
10
-5
-10
0
November 2, 2006
50
EPP 245 Statistical
Analysis of
time
Laboratory Data
100
150
24