Professional Documents
Culture Documents
Statistics
Statistics
guide
Tom Sensky
Clicking on the
RECOMMENDED RESOURCES
BASIC STATISTICS
Types of data
ANOVA
Normal distribution
Repeated measures ANOVA
Describing data
Non-parametric tests
Mann-Whitney U test
Boxplots
Summary of common tests
Standard deviations
Summaries of proportions
Skewed distributions
Odds and Odds Ratio
Parametric vs Non-parametric
Sample size
Absolute and Relative Risks
Statistical errors
Number Needed to Treat (NNT)
Power calculations
Confidence intervals (CIs)
Clinical vs statistical significanceCI (diff between two proportions)
Two-sample t test
Correlation
Problem of multiple tests
Regression
Subgroup analyses
Paired t test
Chi-square test
Logistic regression
Mortality statistics
Survival analysis
TYPES OF DATA
VARIABLES
QUANTITATIVE
RATIO
Pulse rate
Height
QUALITATIVE
NORMAL DISTRIBUTION
THE EXTENT OF THE
SPREAD OF DATA
AROUND THE MEAN
MEASURED BY THE
STANDARD
DEVIATION
MEAN
CASES DISTRIBUTED
SYMMETRICALLY
ABOUT THE MEAN
AREA BEYOND TWO
STANDARD
DEVIATIONS ABOVE
THE MEAN
DESCRIBING DATA
MEAN
MEDIAN
MODE
BOXPLOT
(BOX AND WHISKER PLOT)
97.5th
Centile
75th Centile
12
Pain (VAS)
10
8
6
MEDIAN
(50th
centile)
25th Centile
4
2
0
-2
N=
Interquartile
range
74
27
Female
Male
2.5th Centile
STANDARD DEVIATION
MEASURE OF THE SPREAD OF
THE SQUARE OF
2
VALUES OF A SAMPLE
AROUND
THE SD IS
Sum(Value Mean)
KNOWN
AS THE
SD
THE
MEAN
VARIANCE
Numberof values
SD decreases as a function
of:
smaller spread of values
about the mean
larger number of values
IN A NORMAL
DISTRIBUTION, 95%
OF THE VALUES WILL
LIE WITHIN 2 SDs OF
THE MEAN
n=150
n=50
n=10
SKEWED DISTRIBUTION
MEAN
MEDIAN 50%
OF VALUES WILL
LIE ON EITHER
SIDE OF THE
MEDIAN
DISTRIBUTIONS: EXAMPLES
NORMAL
DISTRIBUTION
SKEWED
DISTRIBUTION
Height
Weight
Haemoglobin
Bankers bonuses
Number of
marriages
DISTRIBUTIONS AND
STATISTICAL TESTS
EXAMPLE: IQ
Say that you have tested a sample of
people on a validated IQ test
The IQ test has
been carefully
standardized on a
large sample to
have a mean of 100
and an SD of 15
94
97
100
SD
103
106
EXAMPLE: IQ
Say you now administer the test
to repeated samples of 25 people
Expected random variation of
these means equals the
Standard Error
SE
SD
SampleSize
15
94
97
100
103
106
25
3.0
STANDARD DEVIATION vs
STADARD ERROR
EXAMPLE: IQ
One sample of 25 people yields a mean
IQ score of 107.5
94
97
100
103
106
EXAMPLE: IQ
How far out the sample IQ is in the
population distribution is calculated as the
area under the curve to the right of the
sample mean:
SampleMean- Population
Mean
StandardError
94
97
100
103
106
107.5- 100
3.0
2.5
EXAMPLE: IQ
94
97
EXAMPLE: IQ
This is commonly referred to as p=0.006
94
97
100
By convention, we accept as
significantly different a sample
mean which has a 1 in 20
chance (or less) of coming from
the population in which the
test was standardized
(commonly referred to as
p=0.05)
Thus our sample had
a significantly
103 106
greater IQ than the
reference population
(p<0.05)
EXAMPLE: IQ
If we move the
sample mean (green)
closer to the
population mean
(red), the area of the
distribution to the
right of the sample
mean increases
94
97
100
103
106
Even by inspection,
the sample is more
likely than our
previous one to come
from the original
SAMPLE
A MEAN
SAMPLE
A
SAMPLE
B MEAN
SAMPLE
B
100
107.5
110
SE
SD
SampleSize
100
107.5
110
100
107.5
110
comes from
the standard
population,
we expect to
find a mean
of 107.5 in 1
out of 20
estimates
100
110
100
107.5
110
100
107.5
110
100
107.5
110
107.5
110
STATISTICAL ERRORS:
SUMMARY
False positive
Find a significant difference even
Type I
()
False negative
Fail to find a significant difference
Type II ()
POWER CALCULATIONS
STATISTICAL SIGNIFICANCE IS
NOT NECESSARILY CLINICAL
SIGNIFICANCE
Sample
Populatio
Sample
p
Size
n Mean
Mean
100.0
110.0
0.05
25
100.0
104.0
0.05
64
100.0
102.5
0.05
400
100.0
101.0
0.05
2,500
100.0
100.4
0.05
10,000
100.0
100.2
0.05
CLINICALLY SIGNIFICANT
IMPROVEMENT
Large proportion of
patients improving
Barlow (1981)
An improvement in
patients everyday
functioning
Kazdin &
Wilson (1978)
Reduction in symptoms by
50% or more
Elimination of the
presenting problem
Kazdin &
Wilson (1978)
MEASURES OF CLINICALLY
SIGNIFICANT IMPROVEMENT
ABNORMAL
POPULATION
DISTRIBUTION
OF
DYSFUNCTION
AL SAMPLE
MEASURES OF CLINICALLY
SIGNIFICANT IMPROVEMENT
SECOND POSSIBLE CUTABNORMAL NORMAL
POPULATION POPULATIO
b
c
a
N
The two
distributions are
widely separated so
their means clearly
different
The distributions
overlap, so it is
unclear whether the
samples come from
the same population
Differencebetweenmeans
t
SE of thedifference
Differencebetweenmeans
t
SE of thedifference
SD
SampleSize
With smaller
sample sizes, SE
increases, as does
the overlap
between the two
curves, so value of
t decreases
Tests (N)
0.05
0.098
0.143
0.185
0.226
0.264
10
0.401
20
0.641
SUBGROUP ANALYSIS
10
11
60
65
27
31
ONE-SAMPLE
(INDEPENDENT
SAMPLE) t-TEST
COMPARING PROPORTIONS:
THE CHI-SQUARE TEST
A
Number of
patients
100
50
Actual %
Discharged
15
30
Actual
number
discharged
15
15
Expected
number
discharged
COMPARING PROPORTIONS:
THE CHI-SQUARE TEST
A
Number of
patients
100
50
Actual %
Discharged
15
30
Actual
number
discharged
15
15
Expected
number
discharged
20
10
COMPARING PROPORTIONS:
THE CHI-SQUARE TEST
2
(Observed- Expected)
Sum
Expected
Number of
patients
100
50
20
10
Actual %
Discharged
15
30
Actual
number
discharged
15
15
Expected
number
discharged
20
10
25 25
ANOVA - AN EXAMPLE
BetweenGroup
Variance
WithinGroup
Variance
ANOVA - AN EXAMPLE
WithinGroup
Variance
BetweenGroup
Variance
ANOVA AN EXAMPLE
Age
Group
Mean
SD
18-24
13
31.9
5.0
25-31
12
31.1
5.7
32-38
10
35.8
5.3
39-45
10
38.0
6.6
46-52
12
29.3
6.0
53-59
11
28.5
5.3
Total
68
32.2
6.4
df
Mean
Square
Sig.
Between
Groups
733.27
146.65
4.60
0.0012
Within Groups
1976.42
62
31.88
Total
2709.69
67
Sum of
Squares
df
Mean
Square
Sig.
Between
Groups
733.27
146.65
4.60
0.0012
Within Groups
1976.42
62
31.88
Total
2709.69
67
Sum of
Squares
df
Mean
Square
Sig.
Between
Groups
733.27
146.65
4.60
0.0012
Within Groups
1976.42
62
31.88
Total
2709.69
67
NON-PARAMETRIC TESTS
MANN-WHITNEY U TEST
Say you have two groups, A and B, with ordinal data
Pool all the data from A and B, then rank each score, and indicate which group each
score comes from
If scores in A were more highly ranked than those in B, all the A scores would be on the
Rank
Grou
p
10 11 12
B
MANN-WHITNEY U TEST
Generate a total score (U) representing the number of times an A score precedes each B
Rank
10 11 12
SUMMARY OF BASIC
STATISTICAL TESTS
2 groups
>2 groups
Continuous variables
Independent ttest
ANOVA
Continuous
variables+same
sample
Matched pairs
t-test
Repeated
measures
ANOVA
Categorical variables
(Chi square
test)
Ordinal variables
(not normally
distributed)
Mann-Whitney
U test
Median test
Kruskal-Wallis
ANOVA
KAPPA
(Non-parametric) measure of agreement
TIME 1 (OR OBSERVER 1)
TIME 2(OR
OBSERVER
2)
Positive
Negativ
e
Total
Positive
A+C
Negativ
e
B+D
Total (A+B)/N
A+D
B+C
N
Simple agreement:
The above does not take account of agreement
by chance
KAPPA - INTERPRETATION
Kappa
Agreement
<0.20
Poor
0.21-0.40
Slight
0.41-0.60
Moderate
0.61-0.80
Good
0.80-1.00
Very good
DESCRIPTIVE STATISTICS
INVOLVING PROPORTIONS
Usual Care
(TAU)
Cases
23
21
Deterioration
3 (13%)
11 (52%)
No
Deterioration
20 (83%)
10 (48%)
CBT
Usual Care
(TAU)
3 (13%)
11 (52%)
No
20 (83%)
Deterioration
Rate of deterioration
3/23
(CBT)
10 (48%)
13%
Odds of deterioration
(CBT)
3/20
0.15
Rate of deterioration
(TAU)
11/21
52%
Deterioration
No
Deterioration
Absolute
Risk
Reduction
(ARR)
Relative Risk
Reduction
(RRR)
CBT
Usual Care
(TAU)
3 (13%)
11 (52%)
20 (83%)
10 (48%)
Deterioratio _ Deterioratio
n rate (TAU)
n rate (CBT)
Deterioratio _ Deterioratio
n rate (TAU)
n rate (CBT)
Deterioration rate
= (52 13)/53 (TAU)
= 73% or 0.73
Deterioration
No
Absolute
Risk
Deterioration
Reduction
(ARR)
Number
CBT
Usual Care
(TAU)
3 (13%)
11 (52%)
20 (83%)
10 (48%)
= 0.39
Needed to
Treatis(NNT)
NNT
the number of patients that need to be
treated with CBT, compared with treatment as
usual, to prevent one patient deteriorating
In this case, 3 patients have to be treated to
prevent one patient deteriorating
NNT is a very useful summary measure, but is
commonly not given explicitly in published
ANOTHER APPROACH:
CONFIDENCE INTERVALS
If a population is sampled 100 times, the means of
the samples will lie within a normal distribution
95 of these 100 sample means
will lie between the shaded
areas at the edges of the
curve this represents the
95% confidence interval (96%
CI)
The 95% CI can be
viewed as the range
within which one can be
95% confident that the
true value (of the mean,
in this case) lies
ANOTHER APPROACH:
CONFIDENCE INTERVALS
95% CI SampleMean 1.96 SE
Returning to the IQ example,
Mean=107.5 and SE=3.0
CONFIDENCE INTERVALS
Cases
23
21
Deterioration
3 (13%)
11 (52%)
No
20 (83%)
10 (48%)
Deterioration
95% CI = Risk Reduction 1.96 x
se
where se = standard error
se
se(ARR)
p1 (1 p)1 p2 (1 p2 )
n1
n2
23
23
NB This formula is given for convenience. You are not required to commit
any of these formulae to memory they can be obtained from numerous
CONFIDENCE INTERVAL OF
ABSOLUTE RISK REDUCTION
ARR = 0.39
se = 0.13
95% CI of ARR = ARR 1.95 x se
95% CI = 0.39 1.95 x 0.13
95% CI = 0.39 0.25 = 0.14 to 0.64
The calculated value of ARR is 39%, and the 95%
CI indicates that the true ARR could be as low as
14% or as high as 64%
INTERPRETATION OF
CONFIDENCE
that the INTERVALS
mean estimated from a
Remember
CORRELATION
RHEUMATOID ARTHRITIS (N=24)
16
HADS Depression
14
12
10
8
6
4
2
0
10
15
SIS
20
25
30
The question is
do HADS scores
correlate with SIS
ratings?
CORRELATION
RHEUMATOID ARTHRITIS (N=24)
16
r2=0.34
HADS Depression
14
12
10
8
x1
x2
x3
x4
2
0
10
15
SIS
20
25
30
CORRELATION
RHEUMATOID ARTHRITIS (N=24)
16
16
r2=0.34
14
12
HADS Depression
HADS Depression
14
10
8
6
4
12
10
8
6
4
10
15
SIS
20
25
30
r2=0.06
10
15
SIS
20
25
30
CORRELATION
Can express correlation as an
equation:
y = A + Bx
CORRELATION
Can express correlation as an
equation:
y = A + Bx
If B=0, there is no correlation
CORRELATION
Can express correlation as an
equation:
y = A + Bx
REGRESSION
Can extend correlation
methods (see previous
slides) to model a
dependent variable on more
than one independent
variable
INTERPRETATION OF REGRESSION
DATA I
INTERPRETATION OF REGRESSION
DATA IV: EXAMPLE
Bchi S et al: J
Rheumatol
1998;25:869-75
LOGISTIC REGRESSION
LOGISTIC REGRESSION II
CRONBACHS ALPHA
You will come across this as an indication
of how rating scales perform
Alpha goes up if
There are more items in the scale
Each item shows good correlation with
the total score
MORTALITY
Number of deaths
Mortality Rate =
Total Population
SURVIVAL ANALYSIS
1
X=Relapsed
4
Case
W=Withdrew
7
8
9
10
X
0
Year of Study
Patients
who have
not relapsed
at the end
of the study
are
described as
censored
1
2
C
W
C=Censored
4
Case
W=Withdrew
8
9
X
X
10
0
Year of Study
SURVIVAL ANALYSIS:
EVENTS IN YEAR 1
1
X=Relapsed
C
W
Case
W
W
8
9
X
X
10
10 people
at
0
risk at start
of Year 1
Year of Study
C=Censored
Case 6 withdrew
within the first year
(leaving 9 cases).
The average number
of people at risk
during the first year
was (10+9)/2 = 9.5
Of the 9.5 people at risk
during
Year51, one relapsed
4
Probability of surviving first
year = (9.5-1)/9.5 = 0.896
C
W=Withdrew
SURVIVAL ANALYSIS:
EVENTS IN YEAR 2
1
X=Relapsed
C
W
Case
W
W
8
9
X
X
10
0
8 people
1 at
risk at start
of Year 2
C=Censored
C Case 7 withdrew in
Year 2, thus 7.5 people
(average) at risk
during
Year
Of the 7.5
people
at 2risk
5
6
W=Withdrew
Year of Study
SURVIVAL ANALYSIS:
EVENTS IN YEAR 3
1
C
W
4
Case
X=Relapsed
8
9
X
X
10
0
5 people
at
2
3
risk at start
of Year
Year of
3 Study
W=Withdrew
C=Censored
Relapse-free survival
SURVIVAL CURVE
Year
KAPLAN-MAIER SURVIVAL
ANALYSIS
COXS PROPORTIONAL
HAZARDS METHOD