Beruflich Dokumente
Kultur Dokumente
Outcomes II
Overview of common
statistical tests
Are the observations independent
or correlated?
Outcome
Variable
independent
correlated
Assumption
s
Continuous
Ttest
ANOVA
Linear correlation
Linear regression
Paired ttest
Repeated-measures
ANOVA
Mixed models/GEE
modeling
Outcome is
normally distributed
(important for small
samples).
Outcome and
predictor have a
linear relationship.
Relative risks
Chi-square test
Logistic regression
McNemars test
Conditional logistic
regression
GEE modeling
Sufficient numbers
in each cell (>=5)
Binary or
categorical
(e.g. fracture
yes/no)
Overview of common
statistical tests
Are the observations independent
or correlated?
Outcome
Variable
independent
correlated
Assumption
s
Continuous
Ttest
ANOVA
Linear correlation
Linear regression
Paired ttest
Repeated-measures
ANOVA
Mixed models/GEE
modeling
Outcome is
normally distributed
(important for small
samples).
Outcome and
predictor have a
linear relationship.
Relative risks
Chi-square test
Logistic regression
McNemars test
Conditional logistic
regression
GEE modeling
Sufficient numbers
in each cell (>=5)
Binary or
categorical
(e.g. fracture
yes/no)
Continuous outcome
(means)
Are the observations independent or correlated?
Outcome
Variable
independent
correlated
Alternatives if the
normality assumption is
violated (and small
sample size):
Continuous
(e.g. pain
scale,
cognitive
function)
Non-parametric statistics
Wilcoxon sign-rank
test: non-parametric
Repeated-measures
ANOVA: compares changes
Pearsons correlation
coefficient (linear
correlation): shows linear
Mixed models/GEE
modeling: multivariate
Linear regression:
regression techniques to
compare changes over time
between two or more groups;
multivariate regression
non-parametric alternative to
the ttest
Spearman rank
Davis et al. Divalproex in the treatment of bipolar depression: A placebo controlled study. J
Affective Disorders 85 (2005) 259-266.
Repeated-measures
ANOVA
Statistical question: Do subjects in the treatment
group have greater reductions in depression
scores over time than those in the control group?
What is the outcome variable? Depression score
What type of variable is it? Continuous
Is it normally distributed? Yes
Are the observations correlated? Yes, there are
multiple measurements on each person
How many time points are being compared? >2
repeated-measures ANOVA
Repeated-measures
ANOVA
Repeated-measures
ANOVA
1
A
31
29
15
26
2
A
24
28
20
32
3
A
14
20
28
30
4
B
38
34
30
34
5
B
25
29
25
29
6
B
30
28
16
34
Hypothetical data: measurements of depression
scores over time in treatment (A) and placebo (B).
Possible questions
repeated-measures ANOVA
Time factor
Group factor
rANOVA
Time is significant.
Group*time is
significant.
Group is not
significant.
rANOVA
Time is not
significant.
Group*time is not
significant.
Group IS
significant.
rANOVA
Time is
significant.
Group is not
significant.
Time*group is not
significant.
p>.05;
rANOVA
Mean pain
assessments by
visual analogue
scales (VAS)
(Group x
Time)
Days 1-7 after surgery
(morning and evening)
P values are
for the
differences
between
groups by
repeated
measures
analysis of
variance
P<.05;
rANOVA
Review Question 1
In a study of depression, I measured depression score (a
continuous, normally distributed variable) at baseline; 1
month; 6 months; and 12 months. What statistical test
will best tell me whether or not depression improved
between baseline and the end of the study?
a.
b.
c.
d.
e.
Repeated-measures ANOVA.
One-way ANOVA.
Two-sample ttest.
Paired ttest.
Wilcoxon sum-rank test.
Review Question 2
In the same depression study, what statistical test
will best tell me whether or not two treatments for
depression had different effects over time?
a.
b.
c.
d.
e.
Repeated-measures ANOVA.
One-way ANOVA.
Two-sample ttest.
Paired ttest.
Wilcoxon sum-rank test.
Continuous outcome
(means)
Are the observations independent or correlated?
Outcome
Variable
independent
correlated
Alternatives if the
normality assumption is
violated (and small
sample size):
Continuous
(e.g. pain
scale,
cognitive
function)
Non-parametric statistics
Wilcoxon sign-rank
test: non-parametric
Repeated-measures
ANOVA: compares changes
Pearsons correlation
coefficient (linear
correlation): shows linear
Mixed models/GEE
modeling: multivariate
Linear regression:
regression techniques to
compare changes over time
between two or more groups;
multivariate regression
non-parametric alternative to
the ttest
Spearman rank
Correlation coefficient
Statistical question: Is injection pressure
related to pain?
What is the outcome variable? VAS pain
score
What type of variable is it? Continuous
Is it normally distributed? Yes
Are the observations correlated? No
Are groups being compared? Nothe
independent variable is also continuous
correlation coefficient
cov ( X , Y )
( X X)( Y Y )
i1
n 1
Interpreting Covariance
cov(X,Y) > 0
direction
cov(X,Y) < 0
directions
cov(X,Y) = 0
Correlation coefficient
cov ariance( x, y )
var x var y
Corrrelation
Unit-less
r = -1
r = -.6
X
Y
r = +1
r=0
r = +.3
r=0
Linear Correlation
Linear relationships
Y
Curvilinear relationships
Y
X
Y
X
Y
Linear Correlation
Strong relationships
Y
Weak relationships
Y
X
Y
X
Y
Linear Correlation
No relationship
Y
X
Y
Recall: correlation
coefficient (large n)
Hypothesis test:
Z
r -0
1 r2
n
Confidence Interval
1 r2
confidence interval observed r Z/2 * (
)
n
Correlation coefficient
(small n)
Hypothesis test:
Tn 2
r 0
1 r2
n2
Confidence Interval
1 r 2
confidence interval observed r Tn 2,/2 * (
)
n2
Review Problem 3
a.
b.
c.
d.
e.
Continuous outcome
(means)
Are the observations independent or correlated?
Outcome
Variable
independent
correlated
Alternatives if the
normality assumption is
violated (and small
sample size):
Continuous
(e.g. pain
scale,
cognitive
function)
Non-parametric statistics
Wilcoxon sign-rank
test: non-parametric
Repeated-measures
ANOVA: compares changes
Pearsons correlation
coefficient (linear
correlation): shows linear
Mixed models/GEE
modeling: multivariate
Linear regression:
regression techniques to
compare changes over time
between two or more groups;
multivariate regression
non-parametric alternative to
the ttest
Spearman rank
Linear regression
In correlation, the two variables are treated as equals.
In regression, one variable is considered
independent (=predictor) variable (X) and the other
the dependent (=outcome) variable Y.
What is Linear?
Remember this:
Y=mX+B?
m
Whats Slope?
A slope of 0.28 means that every 1-unit change in X
yields a .28-unit change in Y.
Intercept (x=0),
not shown on
The linear regression model:
graph
Ratings of Obama = 50.5 + 0.28*(political bent)
slope
Every additional hour of weekly exercise costs you about 11 minutes of sleep in the
morning (p=.0015).
+ *xi
Fixed
exactly
on the
line
+ random errori
Follows a normal
distribution
Sy/x
Sy/x
Sy/x
Sy/x
Sy/x
Sy/x
1. Lee DM, Tajar A, Ulubaev A, et al. Association between 25-hydroxyvitamin D levels and cognitive performance
in middle-aged and older European men. J Neurol Neurosurg Psychiatry. 2009 Jul;80(7):722-9.
Distribution of vitamin D
Mean= 63 nmol/L
Standard deviation = 33
nmol/L
Distribution of DSST
Normally distributed
Mean = 28 points
Standard deviation = 10 points
0
0.5 points per 10 nmol/L
1.0 points per 10 nmol/L
1.5 points per 10 nmol/L
Dataset 1: no relationship
Dataset 2: weak
relationship
Dataset 3: weak to
moderate relationship
Dataset 4: moderate
relationship
Regression
equation:
E(Yi) = 26 + 0.5*vit
Di (in 10 nmol/L)
Regression equation:
E(Yi) = 22 + 1.0*vit
Di (in 10 nmol/L)
Regression equation:
E(Yi) = 20 + 1.5*vit Di
(in 10 nmol/L)
Whats the constraint? We are trying to minimize the squared distance (hence the least squares) between the
observations themselves and the predicted values , or (also called the residuals, or left-over unexplained
variability)
Differencei = yi (x + )
Differencei2 = (yi (x + )) 2
Find the that gives the minimum sum of the squared differences. How do you maximize a function? Take the
n
n
derivative; set it equal
and solve. Typical max/min
problem from calculus.
d to zero;
2
(y
( xi )) 2(
i 1
2(
(y
xi )( x i ))
i 1
( y i xi x i xi )) 0...
i 1
Resulting formulas
Slope (beta coefficient) =
Intercept=
Cov ( x, y )
Var ( x)
Calculate : y - x
(x, y)
Relationship with
correlation
SD
x
r
SD y
In correlation, the two variables are treated as equals. In regression, one variable is considered
independent (=predictor) variable (X) and the other the dependent (=outcome) variable Y.
Example: dataset 4
SDx = 33 nmol/L
SDy= 10 points
Cov(X,Y) = 163
points*nmol/L
SS x
SS y
r = 163/(10*33) = 0.49
Or
r = 0.15 * (33/10) = 0.49
Significance testing
Slope
Distribution of slope ~ Tn-2(,s.e.(
))
H0: 1 = 0
H1: 1 0
exist)
Tn-2=
0
s.e.( )
(y
i 1
y i )
n2
SS x
where SSx ( xi x ) 2
i 1
and y i xi
sy / x
SS x
Example: dataset 4
Review Problem 4
Researchers fit a regression equation to predict baby
weights from weeks of gestation:
Y/X = 100 grams/week*X weeks
What is the expected weight of a baby born at 22
weeks?
a.
b.
c.
d.
e.
2000g
2100g
2200g
2300g
2400g
Review Problem 5
The model predicts that:
a.
b.
c.
d.
Predicted values
y i 20 1.5 xi
For Vitamin D = 95 nmol/L (or 9.5 in 10 nmol/L):
y i 20 1.5(9.5) 34
Residual =
observed - predicted
X=95
nmol/L
34
yi 48
y i 34
yi y i 14
Not Linear
residuals
residuals
Linear
Slide from: Statistics for Managers Using Microsoft Excel 4th Edition, 2004 Prentice-Hall
x
Non-constant variance
residuals
residuals
Constant variance
Slide from: Statistics for Managers Using Microsoft Excel 4th Edition, 2004 Prentice-Hall
residuals
residuals
residuals
Independent
Slide from: Statistics for Managers Using Microsoft Excel 4th Edition, 2004 Prentice-Hall
Review Problem 6
A medical journal article reported the following
linear regression equation:
Cholesterol = 150 + 2*(age past 40)
Based on this model, what is the expected
cholesterol for a 60 year old?
a.
b.
c.
d.
e.
150
370
230
190
200
Review Problem 7
If a particular 60 year old in your study
sample had a cholesterol of 250, what
is his/her residual?
a.
b.
c.
d.
e.
+50
-50
+60
-60
0
Multiple linear
regression
Different 3D view
E(y)= + 1*X + 2 *W + 3 *Z
Each regression coefficient is the amount of
change in the outcome variable that would be
expected per one-unit change of the predictor, if
all other variables in the model were held
constant.
Review Problem 8
A medical journal article reported the following linear
regression equation:
Cholesterol = 150 + 2*(age past 40) + 10*(gender:
1=male, 0=female)
Based on this model, what is the expected cholesterol for
a 60 year-old man?
a.
b.
c.
d.
e.
150
370
230
190
200
40 32.5 7.5
2
10.8 10.8
54
46
3.46; p .0008
As a linear regression
Intercept
represents the
mean value in
the sufficient
group.
Slope represents
the difference in
means between the
groups. Difference
is significant.
Parameter
Variable
Intercept
insuff
````````````````Standard
Estimate
Error
t Value
40.07407
-7.53060
1.47511
2.17493
27.17
-3.46
Pr > |t|
<.0001
0.0008
ANOVA is linear
regression!
The picture
Sufficient vs.
Insufficient
Sufficient vs.
Deficient
Results
Parameter Estimates
Variable
DF
Intercept
deficient
insufficient
1
1
1
Parameter
Estimate
40.07407
-9.87407
-6.87963
Standard
Error
1.47817
3.73950
2.33719
t Value
Pr > |t|
27.11
-2.64
-2.94
<.0001
0.0096
0.0041
Interpretation:
Functions of multivariate
analysis:
Logistic
Cox
Appropriate
multivariate
regression
model
Example equation
Continuous
Blood
pressure
Linear
regression
Binary
High blood
pressure
(yes/no)
Logistic
regression
Time-to-event
Time-todeath
Cox regression
ln (rate of death) =
+ salt*salt consumption (tsp/day) +
age*age (years) + smoker*ever
smoker (yes=1/no=0)
Outcome
(dependent
variable)
Multivariate regression
pitfalls
Multi-collinearity
Residual
confounding
Overfitting
Multicollinearity
Multicollinearity
Model
Residual confounding
Residual confounding:
example
Overfitting
Parameter
Estimate
Standard
Error
Intercept
exercise
sleep
obama
Clinton
mathLove
11.80175
-0.29106
-1.91592
1.73993
-0.83128
0.45653
2.98341
0.09798
0.39494
0.24352
0.17066
0.10668
Type II SS
F Value
Pr > F
11.96067
6.74569
17.98818
39.01944
18.13489
13.99925
15.65
8.83
23.53
51.05
23.73
18.32
0.0019
0.0117
0.0004
<.0001
0.0004
0.0011
Exercise, sleep, and high ratings for Clinton are negatively related to optimism (highly
significant!) and high ratings for Obama and high love of math are positively related to
optimism (highly significant!).
If something seems to
good to be true
Clinton, univariate:
Variable
Label
Intercept
Clinton
Intercept
Clinton
DF
Parameter
Estimate
1
1
5.43688
0.24973
Standard
Error t Value
2.13476
0.27111
2.55
0.92
Pr > |t|
0.0188
0.3675
Sleep, Univariate:
Variable
Label
DF
Parameter
Estimate
Standard
Error t Value
Pr > |t|
Intercept Intercept 1
8.30817
4.36984
1.90
0.0711
sleep
1
-0.14484
0.65451
-0.22
0.8270
Exercise, Univariate: sleep
Parameter
Standard
Variable Label
DF
Estimate
Error t Value Pr > |t|
Intercept
exercise
Intercept
exercise
1
1
6.65189
0.19161
0.89153
0.20709
7.46
0.93
<.0001
0.3658
Label
Intercept
obama
Intercept
obama
DF
1
1
Parameter
Estimate
Standard
Error t Value
0.82107
0.87276
2.43137
0.31973
Pr > |t|
0.34
0.7389
2.73
0.0126
Label
DF
Intercept Intercept 1
mathLove mathLove
Parameter
Estimate
Standard
Error t Value
Pr > |t|
3.70270
1.25302
2.96
0.0076
1
0.59459
0.19225
3.09
0.0055
Compare
with
multivariate
result;
p<.0001
Compare
with
multivariate
result;
p=.0011
Overfitting
Rule of thumb: You need at
least 10 subjects for each
additional predictor
variable in the multivariate
regression model.
Beta
p-VALUE
-14.74660
0.0257
0.23441
0.0004
-0.51383
0.0715
-0.01025
0.0168
0.03064
0.0005
0.88753
<.0001
0.37459
0.0490
R-Square = 0.8192
N=20, 7
parameters
in the
model!
Univariate models
Variable
Beta
p-value
Coffee
0.05916
0.3990
Wakeup -0.06587
0.8648
MathSAT -0.00021368 0.9731
EngSAT -0.01019
0.1265
Sleep
-0.41185
0.4522
WritingLove 0.38961
0.0279