Professional Documents
Culture Documents
Διατμηματικό ΠΜΣ
Επαγγελματική και Περιβαλλοντική
Υγεία-Διαχείριση και Οικονομική
Αποτίμηση
Δημήτρης Φουσκάκης
Introduction
So far in the course we’ve assumed that the
data come from some known distribution, e.g.
normal or the Central Limit Theory hold.
Methods of estimation and hypothesis testing
have been based on these assumption. These
procedures are usually called parametric
statistical methods. If these assumptions are
not met the nonparametric statistical
methods must be used.
Revision – Inferential Statistics
Hypothesis testing versus Confidence
Intervals
Parametric versus Nonparametric
Quantitative data
Categorical data
Relation between two variables
Relation between several variables
What does inferential statistics do?
helps to quantify how certain we can be
when we make inferences from a given
sample.
The three approaches:
a) Hypothesis testing
b) Confidence Intervals
c) Both
Yes No
parametric non-parametric
One-sample Wilcoxon signed
1
t-test rank sum test
Wilcoxon matched
Number paired Paired t-test pairs signed rank
of 2 sum test
samples Two-sample
unpaired Mann-Whitney U test
t-test
3 or One-way
Kruskal-Wallis test
more ANOVA
One Sample
Table 1: Average daily energy intake (kJ) over 10 days of 11 healthy women.
Subject Average daily energy intake (kj)
1 5260
2 5470
3 5640
4 6180
5 6390
6 6515
7 6808
8 7515
9 7515
10 8230
11 8770
Mean 6753.6
SD 1142.1
What can we say about the energy intake of these women in relation to a
recommended daily intake of 7725kJ?
One Sample
To answer the question we can carry out a test of
the null hypothesis that our data are a sample from
a population with a specific hypothesized mean.
The test is called the one sample t-test.
sample mean - hypothesized mean x − k
t = =
standard error of sample mean s/ n
6753.6 − 7725
= = −2.821 If t > tn-1,α/2 or
1142.1/ 11 t < - tn-1,α/2 reject
t distribution with
2 × (area to the right of |t| under n -1=10 df Table Ho
the t distribution with 10 df)
Pvalue < 0.02 Reject H0
One Sample
Alternatively we could calculate a 95% C.I. for the
mean intake:
(x ± t10,0.025 ⋅ s / n ) = (6753.6 ± 2.228 ⋅ 344.4) = (5986, 7521)
| r − np | − 1 / 2 Normal Table
z= = 1.81 Pvalue=0.07
np (1 − p )
DO NOT REJECT H0
One Sample
The Wilcoxon Signed rank Test
Calculate the difference between each
observation and the value of interest.
Ignoring the signs of the differences, rank
them in order of magnitude. More powerful
test than the sign test.
Calculate the sum of the ranks of all the
negative (or positive) ranks and find Pvalue
from corresponding table.
One Sample
The Wilcoxon Signed rank Test
1
(n=13)
6.13
(n=9)
8.79
Is there a true
2
3
7.05
7.48
9.19
9.21
difference in the 24
4
5
7.48
7.53
9.68
9.69
hour total energy
6
7
7.58
7.9
9.97
11.51 expenditure
8
9
8.08
8.09
11.85
12.79 between lean and
10 8.11
11
12
8.4
10.15
obese women?
13 10.88
Mean 8.066 10.298
SD 1.238 1.398
Two Independent Groups of
Observations
To answer this question we can carry out
a test of the null hypothesis that the
means of the two populations, obese and
lean women have the same mean of total
energy expenditure. The test is called the
two sample t-test. P <0.001 value
(T distribution with
x1 − x 2 10.298 − 8.066 n1+ n2 -2=20 df )
t= = = 3.95
se( x 1 − x 2 ) s p ⋅ 1 / n 1 + 1 / n 2
w here s p is the p ooled standard deviation given by Reject H0
(n 1 − 1)s 12 + (n 2 − 1)s 22
sp = , w ith s i2 the variance of the i th group.
n1 + n 2 − 2
Reject H0
Two Independent Groups of
Observations – Mann-Whitney Test
Testing the Assumptions
How to test normality? Most people just make a histogram of the
data and check if this looks like a bell shape. Although remember that
the assumption is not that the sample has the normal distribution but
that it comes from a population which does. For large samples we
expect to see a histogram with a bell shape if the population is normal
but with small samples it is quite unlike to get a symmetric distribution
even if the population is normally distributed. There are formal
methods that test for normality, and you can find them in most
statistical packages, like the Shapiro-Wilk test or the Shapiro-
Francia test. You can also use common sense and answer the
question if it is reasonable to make the assumption that the
population of interest is normally distributed.
When the data are not normally distributed and are skewed, it is
better to try some transformations first, like the logarithmic one, in
order to make their shape symmetric and then perform a parametric
test on the transformed data, instead of doing directly a non
parametric test.
Testing the Assumptions
How to test equality of variances? Most
people just see how close are the 2
sample variances. Instead you can
perform a hypothesis testing with a null
hypothesis that the two variances are
equal; this test is called the F test.
Testing the Assumptions
Table: Serum thyroxine level (nmol/l) in 16 hypothyroid infants by severity of
symptoms (Hulse et al., 1979)
Marked symptoms Slight or no symptoms We wish to compare
(n=7) (n=9)
1
2
5
8
34
45
thyroxine levels in the
3
4
18
24
49
55
two groups defined by
5
6
60
84
58
59
severity of symptoms,
7
8
96 60
62 but the sample standard
Mean
9
42.1
86
56.4
deviations are markedly
SD 37.48 14.22
different.
F distribution with
s 12 ⎛ 37.48 ⎞
2
n1 -1=6 and n2 -1=8 df
F= 2 =⎜ ⎟ = 6.95
Pvalue < 0.01
s 2 ⎝ 14.22 ⎠
w here s i is the standard deviation of the i th group. Reject H0
If F < Fn1-1,n2-1,1-α/2 or F > Fn1-1,n2-1,a/2
area to the right of F under the
reject Ho
F distribution with 6, 8 df)
Testing the Assumptions
Alternatively we could calculate a 95% C.I. for the
variances ratio:
⎛ s12 1 s12 1 ⎞
⎜⎜ 2 ⋅ , 2⋅ ⎟⎟ =
⎝ s 2 Fn1 −1,n 2 −1,0.975 s 2 Fn1 −1,n 2 −1,0.025 ⎠
⎛ ⎛ 37.48 ⎞2 1 ⎛ 37.48 ⎞2 1 ⎞
= ⎜⎜ ⋅ ⋅ = (1.49,38.61)
⎜ ⎝ 14.22 ⎟⎠ 4.65 ⎜⎝ 14.22 ⎟⎠ 0.18 ⎟⎟
,
⎝ ⎠
This range does not include the value of 1. Thus the
variance in the marked symptoms group is larger than
the one in the slight or no symptoms group. Thus we
cannot use the t-test and we have to perform a non-
parametric method.
Testing the Assumptions
The F test is non-robust to a violation of
Normality. Alternatively one can use the
Levene’s Test using a statistical package,
which is not strongly dependent on the
assumption of Normality of the two groups.