Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05 x.html#47 1/47 Statistics - Lecture...

47
10/8/2018 Statistics - Lecture 05 http://statnipa.appspot.com/cours/05/index.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université de Strasbourg

Transcript of Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05 x.html#47 1/47 Statistics - Lecture...

Page 1: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 1/47

Statistics - Lecture 05Nicodème Paul Faculté de médecine, Université de Strasbourg

Page 2: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 2/47

Descriptive statistics and probability

Data description and graphical representation

Mean, median, quartiles, standard deviation, interquartile range (IQR)

Barplot, histogram and boxplot

Decisions are based on probability calculation

Notion of random variables and distributions

Binomial and normal distributions

·

·

·

·

·

·

2/47

Page 3: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 3/47

Estimation

Notion of parameters ( , )

Di�erence between estimate and estimator

The sample mean and the sample variance are estimators

The Central Limit Theorem and sampling distribution

Interval estimate or con�dence interval

· μ σ2

·

· X̄ S2

·

·

3/47

Page 4: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 4/47

Hypothesis testing

Parametric tests and test procedure

Notion of null and alternative hypotheses

Test statistic and its sampling distribution

Critical values and critical regions

P-values

·

·

·

·

·

4/47

Page 5: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 5/47

Relation between variables and goodness of �t

Notion of correlation

Non parametric tests and goodness of �t

Notion of association between categorical variables

The test

The Fisher exact test

·

·

·

· χ2

·

5/47

Page 6: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 6/47

Examples

You have been assigned 12 consenting experimental subjects, each of whom has a brain tumour of the same sizeand type. Four are allocated at random to an untreated control group, four are treated with the drug Tumostat andfour more with the drug Inhibin 4. After two months of treatment, the diameter of each tumour is remeasured.

Survival times in �ve human cancer (stomach, bronchus, colon, ovary, breast). Cameron, E. and Pauling, L. (1978)Supplemental ascorbate in the supportive treatment of cancer: re-evaluation of prolongation of survival times interminal human cancer. Proceedings of the National Academy of Science USA, 75, 4538-4542

Comparison of 5 pretreated patches to reduce mosquito human contact. Bhatnagar, A and Mehta, VK (2007)E�cacy of Deltamethrin and Cy�uthrin Impregnated Cloth over Uniform against Mosquito Bites. Medical JournalArmed Forces India, 63, 120-122

6/47

Page 7: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 7/47

QuestionYou have been assigned 12 consenting experimental subjects, each of whom has a brain tumour of the samesize and type. Four are allocated at random to an untreated control group, four are treated with the drugTumostat and four more with the drug Inhibin 4. After two months of treatment, the diameter of each tumour isremeasured. What would be the appropriate test here?

Parametric test

Non parametric test

Submit Show Hint Show Answer Clear

7/47

Page 8: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 8/47

ANOVA: Analysis Of Variance

Population 1: Sample 1:

Population 2: Sample 2:

Population k: Sample k:

Objective: Comparing the means of multiple populations

( , )μ1 σ21 → ( , , . . . , )X11 X12 X1,n1 → ( , )X̄1 S2

1

( , )μ2 σ22 → ( , , . . . , )X21 X22 X2,n2 → ( , )X̄2 S2

2

. . . . . . . . . . . . . . . . . . . . . . . . . .

( , )μk σ2k

→ ( , , . . . , )Xk1 Xk2 Xk,nk → ( , )X̄k S2k

8/47

Page 9: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 9/47

ANOVA assumption and objectivesEach of the k population or treatment response distributions is normal

(The k normal distributions have identical standard deviations)

The observations in the sample from any particular one of the k populations or treatmentsare independent of one another

When comparing population means, the k random samples are selected independently ofone another

:

: At least two of the ’s are di�erent

Estimation of simultaneous con�dence intervals for the mean di�erences for

and

·

· = =. . . =σ1 σ2 σk

·

·

· H0 = =. . . =μ1 μ2 μk

· H1 μ

· −μi μji, j = 1, . . . ,k i ≠ j

9/47

Page 10: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 10/47

ExampleYou have been assigned 12 consenting experimental subjects, each of whom has a brain tumour of the same sizeand type. Four are allocated at random to an untreated control group, four are treated with the drug Tumostat andfour more with the drug Inhibin 4. After two months of treatment, the diameter of each tumour is remeasured.

Population parameters:

: There is no di�erence in mean tumour diameter among the treatments

: There is a di�erence in mean tumour diameter among the treatments. At least two ofthe ’s are di�erent

·

: population mean of the control group

: population mean of the Neurohib group

: population mean of the Tumostop group.

- μ1

- μ2

- μ3

· H0

= =μ1 μ2 μ3

· H1

μ

10/47

Page 11: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 11/47

Data

is the th observation resulting from th treatment

: total of th treatment. : mean of the th treatment

: total of all observations

: the grand mean where

· xij i j

· =T.j ∑nji=1 xij j =x̄.j

T.j

njj

· = =T.. ∑kj=1 T.j ∑k

j=1 ∑nji=1 xij

· =x̄..T..

NN = ∑k

j=1 nj

11/47

Page 12: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 12/47

Example

· = (7 + 8 + 10 + 11) = 9x̄.114

= (4 + 5 + 7 + 8) = 6x̄.214

· = (4 + 5 + 1 + 2) = 3x̄.314

= (7 + 8 + 10 + 11 + 4 + 5 + 7 + 8 + 4 + 5 + 2 + 1) = 6x̄..112

12/47

Page 13: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 13/47

Within groups sum of squares

Variation within group: · ssw = ( −∑3j=1 ∑

4i=1 xij x̄.j)

2

ssw = (4 + 1 + 1 + 4) + (4 + 1 + 1 + 4) + (4 + 1 + 1 + 4) = 30

13/47

Page 14: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 14/47

Between groups sum of squares

Variation between groups: · ssb = 4( −∑3j=1 x̄.j x̄..)

2

ssb = 4 × 9 + 0 + 4 × 9 = 72

14/47

Page 15: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 15/47

Total sum of squares

Variation between groups: · sst = ( −∑3i=1 ∑

4i=1 xij x̄..)

2

sst = (1 + 4 + 16 + 25) + (1 + 1 + 4 + 4) + (1 + 4 + 16 + 25) = 102

· sst = ssw + ssb = 30 + 72 = 102

15/47

Page 16: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 16/47

Check yourselfUnder the null hypothesis, the ratio should be close to 1.

True

False

Submit Show Hint Show Answer Clear

ssbssw

16/47

Page 17: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 17/47

Test for equal meansThe hypotheses are:

If the null hypothesis is true, we combine k samples to estimate overall mean and the samplemean for the group as:

Total sum of squares,

sum of squares within groups and sum of squares between

groups

We can show that:

·

H0

H1

:

:

= =. . . =μ1 μ2 μksome means are different

·i

= =X̄..1

N∑j=1

k

∑i=1

nj

Xij X̄.j1

nj∑i=1

nj

Xi,j

· SST = ( −∑kj=1 ∑

nji=1 Xij X̄..)

2SSW = ( −∑k

j=1 ∑nji=1 Xij X̄.j)

2

SSB = ( −∑kj=1 nj X̄.j X̄..)

2

· SST = SSW + SSB

17/47

Page 18: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 18/47

Check yourselfLet with and unknown. Let .

What is the distribution of ?

Submit Show Hint Show Answer Clear

, , . . . , ∼ N (μ, )X1 X2 Xn σ2 μ σ = ( −S2 1n−1

∑ni=1 Xi X̄)2

n−1σ2 S2

N (μ; )σ2

n

tn−1

χ21

χ2n−1

χ2n

18/47

Page 19: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 19/47

Check yourselfIn the anova framework, we de�ned as the sum of squares within group.

Let , what is the distribution of ?

Submit Show Hint Show Answer Clear

SSW = ( −∑kj=1 ∑

nji=1 Xij X̄.j)

2

N = + +. . . +n1 n2 nkSSW

σ2

χ21

χ2k

χ2k−1

χ2N

χ2N−1

χ2N−k

χ2N−k−1

19/47

Page 20: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 20/47

Parameter estimationComparing means from multiple populations assuming the variances are the same andequal to

Pooled variance estimator:

where , and

Notice that:

As for ,

·σ2

·

= =S2pool

( − 1)∑kj=1 nj S2

j

( − 1)∑kj=1 nj

( −∑kj=1 ∑

nji=1 Xij X̄.j)

2

N − k

N = + +. . . +n1 n2 nk =X̄.j1nj∑

nji=1 Xi,j = ( −S2

j1−1nj

∑nji=1 Xij X̄.j)

2

·

= + +. . . + ∼S2pool

σ2

( − 1)n1 S21

σ2

( − 1)n2 S22

σ2

( − 1)nk S2k

σ2χ2N−k

j = 1, 2, . . . ,k ∼( −1)nj S 2

j

σ2 χ2−1nj

20/47

Page 21: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 21/47

Parameter estimation

is an estimator of

As , then

con�dence intervals for population means are:

· =X̄.j1nj∑

nji=1 Xij μj

· , , . . . , ∼ N ( , )X1j X2j X jnj μj σ2 ∼ N ( , )X̄.j μjσ2

nj

· ∼−X̄.j μj

Spool1nj

√tN−k

· (1 − α)

= [ − , + ]Iα x̄.j tN−k1− α

2

spool

nj−−

√x̄.j tN−k

1− α

2

spool

nj−−

21/47

Page 22: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 22/47

Example

A 95% con�dence interval for respectively , and is:· μcontrol μneurohib μmitostop

- [9 − 2.262 × × 1/2; 9 − 2.262 × × 1/2] = [6.935; 11.065]30/9− −−−

√ 30/9− −−−

- [6 − 2.262 × × 1/2; 6 − 2.262 × × 1/2] = [3.935; 8.065]30/9− −−−

√ 30/9− −−−

- [3 − 2.262 × × 1/2; 3 − 2.262 × × 1/2] = [0.935; 5.065]30/9− −−−

√ 30/9− −−−

22/47

Page 23: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 23/47

Check yourselfIn the anova framework, we de�ned as the sum of total squares. What is the

distribution of ?

Submit Show Hint Show Answer Clear

SST = ( −∑kj=1 ∑

nji=1 Xij X̄..)

2

SST

σ2

χ21

χ2k

χ2N−1

χ2N

χ2N−k

23/47

Page 24: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 24/47

Check yourselfIn the anova framework, we de�ned as the sum of squares between groups.

What is the distribution of ?

Submit Show Hint Show Answer Clear

SSB = ( − . .∑kj=1 nj X̄.j X̄ )2

SSB

σ2

χ21

χ2k

χ2N−1

χ2N−k

χ2k−1

24/47

Page 25: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 25/47

Test for equal means· = ( ∼SST

σ2 ∑kj=1 ∑

nji=1

−Xij X̄..

σ)2

χ2N−1

· = ( ∼SSW

σ2 ∑kj=1 ∑

nji=1

−Xij X̄.j

σ)2

χ2N−k

· = ( ∼SSB

σ2 ∑kj=1

−X̄.j X̄..

σ

nj√

)2

χ2k−1

25/47

Page 26: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 26/47

Test for equal means

has a distribution with and degrees of freedom.

De�nition: Let and be independent random variables such that has the distribution with m degrees of freedom and has the distribution with n degrees offreedom, where m and n are given positive integers. The random variable T de�ned asfollows:

Then the distribution of is , the F distribution with m and n degrees of freedom.

Under the null hypothesis, the random variable:

· Y W Y χ2m

W χ2n

T =Y /m

W/n

T Fm,n

·

T =SSB/(k − 1)

SSW/(N − k)

Fk−1,N−k k − 1 N − k

26/47

Page 27: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 27/47

Test for equal means

To test with a signi�cant level , we calculate the value of the test statistic from thesamples

Reject the null distribution if where is the critical value.

The for the test is:

If the null hypothesis is rejected, what next?

· α f

· H0 f > f 1−αk−1,N−k f 1−α

k−1,N−k

· p − value

p − value = P(T > f) where T ∼ Fk−1,N−k

·

Tests for contrasts

Pairwise comparison

-

-

27/47

Page 28: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 28/47

Example

We have: , , , and .

We reject the null hypothesis of equal mean of tumour diameters

· k − 1 = 2 N − k = 9 f = = 10.872/2

30/9= 4.256f 0.95

2,9 p − value = 0.004

·

28/47

Page 29: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 29/47

Example: Comparison of 5 pretreated patches toreduce mosquito human contact

Reference: Bhatnagar, A and Mehta, VK (2007) E�cacy of Deltamethrin and Cy�uthrin Impregnated Cloth overUniform against Mosquito Bites. Medical Journal Armed Forces India, 63, 120-122

29/47

Page 30: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 30/47

Example: parameter estimationmodel01 = aov(Measure~Treatment, data=bites)

model.tables(model01, type="means")

Tables of means

Grand mean

7.153333

Treatment

Treatment

C+O Cyfluthrin Deltamethrin D+O Odomos

5.367 8.033 8.133 6.333 7.901

= 7.153x̄

= 8.033 = 8.133 = 7.901 = 5.367 = 6.333x̄C x̄D x̄O x̄C+O x̄D+O

30/47

Page 31: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 31/47

Example: testsummary(model01)

Df Sum Sq Mean Sq F value Pr(>F)

Treatment 4 184.6 46.16 4.48 0.00192 **

Residuals 145 1494.1 10.30

---

Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

We have:

If then , we reject the null hypothesis of equal mean mosquito bite

rates.

·

k − 1 = 4 SSB = 184.6N − k = 145 SSW = 1494.1f = 4.48 p − value = 0.00192

· α = 0.05 = 2.434f 1−α4,145

31/47

Page 32: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 32/47

Example: Survival times in terminal human cancerReference: Cameron, E. and Pauling, L. (1978) Supplemental ascorbate in the supportive treatment of cancer: re-evaluation of prolongation of survival times in terminal human cancer. Proceedings of the National Academy ofScience USA, 75, 4538-4542

STOMACH BRONCHUS COLON OVARY BREAST124 81 248 1234 123542 461 377 89 2425 20 189 201 158145 450 1843 356 1166412 246 180 2970 4051 166 537 456 7271112 63 519 380846 64 455 791103 155 406 1804876 859 365 3460146 151 942 719340 166 776396 37 372

223 163138 10172 20245 283

32/47

Page 33: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 33/47

Example: Survival times in terminal human cancer

33/47

Page 34: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 34/47

Example: Survival times in terminal human cancer

34/47

Page 35: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 35/47

Example: parameter estimationmodel02 = aov(Survival~Type, data=cdat)

model.tables(model02, type="means")

Tables of means

Grand mean

5.555785

Type

stomach bronchus colon ovary breast

4.968 4.953 5.749 6.151 6.559

rep 13.000 17.000 17.000 6.000 11.000

= 5.555785x̄

= 4.968 = 4.953 = 5.749 = 6.151 = 6.559x̄s x̄b x̄c x̄o x̄b

35/47

Page 36: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 36/47

Example: testsummary(model02)

Df Sum Sq Mean Sq F value Pr(>F)

Type 4 24.49 6.122 4.286 0.00412 **

Residuals 59 84.27 1.428

---

Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

We have:

If then , we reject the null hypothesis of equal mean survival days.

·

k − 1 = 4 SSB = 24.49N − k = 59 SSW = 84.27

f = 4.286 p − value = 0.00412

· α = 0.05 = 2.434f 1−α4,59

36/47

Page 37: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 37/47

Contrasts

A contrast is any linear combination of the population means

such that and integer.

If are means of populations, some examples of contrasts are:

·

C = + +. . . +c1μ1 c2μ2 ckμk

= 0∑ki=1 ci ci

· , , . . . ,μ1 μ2 μ5 k = 5

- −μ1 μ2

- 2 − −μ1 μ3 μ4

- + + − − 2μ1 μ2 μ3 μ4 μ5

37/47

Page 38: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 38/47

Check yourselfYou want to test:

What would be the contrast:

Submit Show Hint Show Answer Clear

: − ( + + + ) = 0 : + ( + + + ) ≠ 0H0 μ11

4μ2 μ3 μ4 μ5 H1 μ1

1

4μ2 μ3 μ4 μ5

− ( + + + )μ114

μ2 μ3 μ4 μ5

4 − − − −μ1 μ2 μ3 μ4 μ5

5 − − − −μ1 μ2 μ3 μ4 μ5

38/47

Page 39: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 39/47

Test for a contrast

has a t-distribution with degrees of freedom.

The hypotheses:

Note , the test statistic:

·

: = 0 versus : ≠ 0H0 ∑j=1

k

cjμj H1 ∑j=1

k

cjμj

· = SSW/(N − k)Sw

T =∑k

j=1 cjX̄.j

Sw ∑kj=1

c2j

nj

− −−−−−−√

N − k

The 100% con�dence interval for the contrast is:· (1 − α)

[ − ; + ]∑j=1

k

cjx̄.j tN−k1− α

2

sw ∑j=1

k c2j

nj

− −−−−−

j=1

k

cjx̄.j tN−k1− α

2

sw ∑j=1

k c2j

nj

− −−−−−

39/47

Page 40: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 40/47

Check yourselfIn the anova framework with k conditions or treatments, when you reject the null hypothesis how manycomparisons would you do to compare the means?

Submit Show Hint Show Answer Clear

k − 1

k

k2

k(k+1)

2

k(k−1)

2

40/47

Page 41: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 41/47

Pairwise comparisonsThere are pairwise comparisons or tests

Recall that when testing a single hypothesis , a type I error is made if it is rejected, even ifit is actually true.

The probability of making a type I error in a test is usually controlled to be smaller than acertain level of , typically equal to 0.05

When there are several null hypotheses, , and all of them are testedsimultaneously, one may want to control the type I error at some level .

A type I error is then made if at least one true hypothesis in the family of hypotheses beingtested is rejected. This signi�cance level is called the familywise error rate (FWER). If thehypotheses in the family are independent, then:

where for are individual signi�cance levels.

· k(k−1)

2

· H0

·α

· , , . . . ,H01 H02 H0m

α

·

FWER = 1 − (1 − αi)m

αi i = 1, 2, . . . ,m

41/47

Page 42: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 42/47

Pairwise comparisons

is the upper-tail critical value of the Studentized range for comparing di�erentpopulations.

Bonferroni: To control , reject all among for which thep-value is less than .

Studentized range distribution (Tukey) procedure:

· FWER ≤ α H0i , , . . . ,H01 H02 H0m

α/m

·

Rank the k sample means

Two population means and are declared signi�cantly di�erent if the

con�dence interval of :

-

- μi μj (1 − α)100

−μi μj

− ±x̄i x̄j qN−k,k,1−αsw ( + )1

2

1

ni

1

nj

− −−−−−−−−−−

qN−k,k,1−α k

42/47

Page 43: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 43/47

Comparison of 5 pretreated patches Tukey multiple comparisons of means

95% family-wise confidence level

factor levels have been ordered

Fit: aov(formula = Measure ~ Treatment, data = bites)

$Treatment

diff lwr upr p adj

D+O-C+O 0.9663333 -1.3232391 3.255906 0.7707275

Odomos-C+O 2.5336667 0.2440942 4.823239 0.0220410

Cyfluthrin-C+O 2.6656667 0.3760942 4.955239 0.0136686

Deltamethrin-C+O 2.7660000 0.4764276 5.055572 0.0093589

Odomos-D+O 1.5673333 -0.7222391 3.856906 0.3268078

Cyfluthrin-D+O 1.6993333 -0.5902391 3.988906 0.2476696

Deltamethrin-D+O 1.7996667 -0.4899058 4.089239 0.1965293

Cyfluthrin-Odomos 0.1320000 -2.1575724 2.421572 0.9998540

Deltamethrin-Odomos 0.2323333 -2.0572391 2.521906 0.9986342

Deltamethrin-Cyfluthrin 0.1003333 -2.1892391 2.389906 0.9999510

43/47

Page 44: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 44/47

Comparison of 5 pretreated patches

Cy�uthrin patches when applied in presence of odomos were found to have much morerepellent action as compared to only odomos. The di�erence in the repellent action was veryhighly signi�cant (p < 0.01). Thus it can be inferred that signi�cant bene�t is achieved inreducing man-mosquito contact when cy�uthrin patches are applied over the uniform by thetroops in addition to using odomos as compared to those using odomos only

44/47

Page 45: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 45/47

Survival times in terminal human cancer Tukey multiple comparisons of means

95% family-wise confidence level

factor levels have been ordered

Fit: aov(formula = Survival ~ Type, data = cdat)

$Type

diff lwr upr p adj

stomach-bronchus 0.01474955 -1.2242933 1.253792 0.9999997

colon-bronchus 0.79595210 -0.3575340 1.949438 0.3072938

ovary-bronchus 1.19744617 -0.3994830 2.794375 0.2296079

breast-bronchus 1.60543320 0.3041254 2.906741 0.0083352

colon-stomach 0.78120255 -0.4578403 2.020245 0.3981146

ovary-stomach 1.18269662 -0.4770864 2.842480 0.2763506

breast-stomach 1.59068365 0.2129685 2.968399 0.0158132

ovary-colon 0.40149407 -1.1954351 1.998423 0.9540004

breast-colon 0.80948110 -0.4918267 2.110789 0.4119156

breast-ovary 0.40798703 -1.2987803 2.114754 0.9615409

45/47

Page 46: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 46/47

Survival times in terminal human cancer

is signi�cantly di�erent to 0. In fact, ascorbate, when used withthe treatment, seems to improve survival times better in breast cancer than in bronchuscancer.

is also signi�cantly di�erent to 0, showing a signi�cantimprovement of survival in breast cancer compared to stomach cancer when ascorbatesupplement is used in the treatment.

· log( ) − log( )μbreast μbronchus

· log( ) − log( )μbreast μstomach

46/47

Page 47: Statistics - Lecture 05 · 10/8/2018 Statistics - Lecture 05  x.html#47 1/47 Statistics - Lecture 05 Nicodème Paul Faculté de médecine, Université ...

10/8/2018 Statistics - Lecture 05

http://statnipa.appspot.com/cours/05/index.html#47 47/47

See you next time

47/47