Basic Statistics II. Significance/hypothesis tests.

66
Basic Statistics II

Transcript of Basic Statistics II. Significance/hypothesis tests.

Page 1: Basic Statistics II. Significance/hypothesis tests.

Basic Statistics II

Page 2: Basic Statistics II. Significance/hypothesis tests.

Significance/hypothesis tests

Page 3: Basic Statistics II. Significance/hypothesis tests.

RCT comparing drug A and drug B for the treatment of hypertension

• 50 patients allocated to A

• 50 patients allocated to B

• Outcome = systolic BP at 3 months

Page 4: Basic Statistics II. Significance/hypothesis tests.

Results

Group A

Mean = 145, sd = 9.9

Group B

Mean = 135, sd = 10.0

Page 5: Basic Statistics II. Significance/hypothesis tests.

Null hypothesis : “μ (A) = μ (B)”

[ie. difference equals 0]

Alternative hypothesis : “μ (A) ≠ μ (B)”

[ie. difference doesn’t equal zero]

[where μ = population mean]

Page 6: Basic Statistics II. Significance/hypothesis tests.

Statistical problem

When can we conclude that

the observed difference

mean(A) - mean(B)

is large enough to suspect that

μ (A) - μ (B) is not zero?

Page 7: Basic Statistics II. Significance/hypothesis tests.

P-value :

“probability of obtaining observed data if the null hypothesis were true”

[eg. if no difference in systolic BP between two groups]

Page 8: Basic Statistics II. Significance/hypothesis tests.

How do we evaluate the probability?

Page 9: Basic Statistics II. Significance/hypothesis tests.

Test Statistic

• Numerical value which can be compared with a known statistical distribution

• Expressed in terms of the observed data and the data expected if the null hypothesis were true

Page 10: Basic Statistics II. Significance/hypothesis tests.

Test statistic

[mean (A) – mean (B)] / sd [mean(A)-mean(B)]

Under null hypothesis this ratio will follow a Normal distribution with mean = 0 and sd = 1

Page 11: Basic Statistics II. Significance/hypothesis tests.

Hypertension example

Test statistic = [mean (A) – mean (B)] / sd [mean(A)-mean(B)]

= [ 145 – 135 ] / 1.99 = 5

→ p <0.001

Page 12: Basic Statistics II. Significance/hypothesis tests.

Interpretation

Drug B results in lower systolic blood pressure in patients with hypertension than does Drug A

Page 13: Basic Statistics II. Significance/hypothesis tests.

Two-sample t-test

Compares two independent groups of Normally distributed data

Page 14: Basic Statistics II. Significance/hypothesis tests.

Significance test example I

Page 15: Basic Statistics II. Significance/hypothesis tests.

Null hypothesis : “μ (A) = μ (B)”

[ie. difference equals 0]

Alternative hypothesis : “μ (A) ≠ μ (B)”

[ie. difference doesn’t equal zero]

Two-sided test

Page 16: Basic Statistics II. Significance/hypothesis tests.

Null hypothesis :

“μ (A) = μ (B) or μ (A) < μ (B) ”

Alternative hypothesis :

“μ (A) > μ (B)”

One-sided test

Page 17: Basic Statistics II. Significance/hypothesis tests.

A one-sided test is only appropriate if a difference in the opposite

direction would have the same meaning or

result in the same action as no difference

Page 18: Basic Statistics II. Significance/hypothesis tests.

Paired-sample t-test

Compares two dependent groups of Normally distributed data

Page 19: Basic Statistics II. Significance/hypothesis tests.

Paired-sample t-test

Mean daily dietary intake of 11 women measured over 10 pre-menstrual and 10 post-menstrual days

Page 20: Basic Statistics II. Significance/hypothesis tests.

Dietary intake example

Pre-menstrual (n=11):

Mean=6753kJ, sd=1142

Post-menstrual (n=11):

Mean=5433kJ, sd=1217

Difference

Mean=1320, sd=367

Page 21: Basic Statistics II. Significance/hypothesis tests.

Dietary intake example

Test statistic = 1320/[367/sqrt(11)]

= 11.9

p<0.001

Page 22: Basic Statistics II. Significance/hypothesis tests.

Dietary intake example

Dietary intake during the pre-menstrual period was significantly greater than that during the post-menstrual period

Page 23: Basic Statistics II. Significance/hypothesis tests.

The equivalent non-parametric tests

• Mann-Whitney U-test

•Wilcoxon matched pairs signed rank sum test

Page 24: Basic Statistics II. Significance/hypothesis tests.

Non-parametric tests

• Based on the ranks of the data

• Use complicated formula

• Hence computer package is

recommended

Page 25: Basic Statistics II. Significance/hypothesis tests.

Significance test example II

Page 26: Basic Statistics II. Significance/hypothesis tests.

Type I error

Significant result when null hypothesis is true

(0.05)

Type II error

Non-significant result when null hypothesis is false

[Power = 1 – Type II]

Page 27: Basic Statistics II. Significance/hypothesis tests.

The chi-square test

Used to investigate the relationship between two qualitative variables

The analysis of cross-tabulations

Page 28: Basic Statistics II. Significance/hypothesis tests.

The chi-square test

Compares proportions in two independent samples

Page 29: Basic Statistics II. Significance/hypothesis tests.

Chi-square test example

In an RCT comparing infra-red stimulation (IRS) with placebo on pain caused by osteoarthritis,

9/12 in IRS group ‘improved’ compared with 4/13 in placebo group

Page 30: Basic Statistics II. Significance/hypothesis tests.

Chi-square test example

Improve?

Yes No

Placebo 4 9 13

IRS 9 3 12

13 12 25

Page 31: Basic Statistics II. Significance/hypothesis tests.

Placebo : 4/13 = 31% improve

IRS: 9/12 = 75% improve

Page 32: Basic Statistics II. Significance/hypothesis tests.

Cross-tabulations

The chi-square test tests the null hypothesis of no relationship between ‘group’ and ‘improvement’ by comparing the observed frequencies with those expected if the null hypothesis were true

Page 33: Basic Statistics II. Significance/hypothesis tests.

Cross-tabulations

Expected frequency

= row total x col total

grand total

Page 34: Basic Statistics II. Significance/hypothesis tests.

Chi-square test example Improve?

Yes No

Placebo 4 9 13

IRS 9 3 12

13 12 25

Expected value for ‘4’ = 13 x 13 / 25

= 6.8

Page 35: Basic Statistics II. Significance/hypothesis tests.

Expected values

Improve?

Yes No

Placebo 6.8 6.2 13

IRS 6.2 5.8 12

13 12 25

Page 36: Basic Statistics II. Significance/hypothesis tests.

Test Statistic

= (observed freq – expected freq)2

expected freq

Page 37: Basic Statistics II. Significance/hypothesis tests.

Test Statistic

= (O – E)2

E

= (4 - 6.8)2/6.8 + (9 – 6.2)2/6.2

+ (4 - 6.8)2/6.8 + (9 – 6.2)2/6.2

= 4.9 → p=0.027

Page 38: Basic Statistics II. Significance/hypothesis tests.

Chi-square test example

Statistically significant difference in improvement between the IRS and placebo groups

Page 39: Basic Statistics II. Significance/hypothesis tests.

Small samples

The chi-square test is valid if:

at least 80% of the expected frequencies exceed 5 and all the expected frequencies exceed 1

Page 40: Basic Statistics II. Significance/hypothesis tests.

Small samples

If criterion not satisfied then combine or delete rows and columns to give bigger expected values

Page 41: Basic Statistics II. Significance/hypothesis tests.

Small samples

Alternatively:

Use Fisher’s Exact Test

[calculates probability of observed table of frequencies - or more extreme tables-under null hypothesis]

Page 42: Basic Statistics II. Significance/hypothesis tests.

Yates’ Correction

Improves the estimation of the discrete distribution of the test statistic by the continuous chi-square distribution

Page 43: Basic Statistics II. Significance/hypothesis tests.

Chi-square test with Yates’ correction

Subtract ½ from the O-E difference

(|O – E|-½)2

E

Page 44: Basic Statistics II. Significance/hypothesis tests.

Significance test example III

Page 45: Basic Statistics II. Significance/hypothesis tests.

McNemar’s test

Compares proportions in two matched samples

Page 46: Basic Statistics II. Significance/hypothesis tests.

McNemar’s test example

Severe cold age 14

Yes No

Severe Yes 212 144 356

cold No 256 707 963

age 468 851 1319

12

Page 47: Basic Statistics II. Significance/hypothesis tests.

McNemar’s test example

Null hypothesis =

proportions saying ‘yes’ on the 1st and 2nd occasions are the same

the frequencies for ‘yes,no’ and

‘no,yes’ are equal

Page 48: Basic Statistics II. Significance/hypothesis tests.

McNemar’s test

•Test statistic based on observed and expected ‘discordant’ frequencies

•Similar to that for simple chi-square test

Page 49: Basic Statistics II. Significance/hypothesis tests.

McNemar’s test example

Test statistic = 31.4

=> p <0.001

Significant difference between the two ages

Page 50: Basic Statistics II. Significance/hypothesis tests.

Significance test example IV

Page 51: Basic Statistics II. Significance/hypothesis tests.

Comparison of means

2 groups 2-sample t-test

3 or more groups ANOVA

Page 52: Basic Statistics II. Significance/hypothesis tests.

One-way analysis of variance

Example:

Assessing the effect of treatment on the stress levels of a cohort of 60 subjects.

3 age-groups: 15-25, 26-45, 46-65

Stress measured on scale 0-100

Page 53: Basic Statistics II. Significance/hypothesis tests.

Stress levels

Group Mean (SD)

15-25 (n=20) 52.8 (11.2)

26-45 (n=20) 33.4 (15.0)

46-65 (n=20) 35.6 (11.7)

Page 54: Basic Statistics II. Significance/hypothesis tests.

Graph of stress levels

Age Group

43210

Str

ess

Le

vel

80

70

60

50

40

30

20

10

0

Page 55: Basic Statistics II. Significance/hypothesis tests.

ANOVA

Sum of squares

Df Mean square

F Sig

Between groups

4513.6 2 2256.8 13.8 <0.001

Within groups

9294.8 57 163.1

Total 13808.4 59

Page 56: Basic Statistics II. Significance/hypothesis tests.

Interpretation

Significant difference between the three age-groups with respect to stress levels

But what about the specific (pairwise) differences?

Page 57: Basic Statistics II. Significance/hypothesis tests.

Stress levels

Group Mean (SD)

15-25 (n=20) 52.8 (11.2)

26-45 (n=20) 33.4 (15.0)

46-65 (n=20) 35.6 (11.7)

Page 58: Basic Statistics II. Significance/hypothesis tests.

Multiple comparisons

• Comparing each pair of means in turn gives a high probability of finding a significant result by chance

• A multiple comparison method (eg. Scheffé, Duncan, Newman-Keuls) makes appropriate adjustment

Page 59: Basic Statistics II. Significance/hypothesis tests.

Scheffés test

Comparison

15-25 vs. 26-45 p<0.001

15-25 vs. 46-65 p<0.001

26-45 vs. 46-65 p=0.86

Page 60: Basic Statistics II. Significance/hypothesis tests.

Stress levels

Group Mean (SD)

15-25 (n=20) 52.8 (11.2)

26-45 (n=20) 33.4 (15.0)

46-65 (n=20) 35.6 (11.7)

Page 61: Basic Statistics II. Significance/hypothesis tests.

Comparison of medians

2 groups Mann-Whitney

3 or more groups Kruskal-Wallis

Page 62: Basic Statistics II. Significance/hypothesis tests.

Kruskal-Wallis

Example:

Stress levels

Overall comparison of 3 groups:

p<0.001

Page 63: Basic Statistics II. Significance/hypothesis tests.

Multiple comparisons

• There are no non-parametric equivalents to the multiple comparison tests such as Scheffés

• Need to apply Bonferroni’s correction to multiple Mann-Whitney U-tests

Page 64: Basic Statistics II. Significance/hypothesis tests.

Bonferroni’s correction

For k comparisons between means:

multiply each p value by k

Page 65: Basic Statistics II. Significance/hypothesis tests.

Mann-Whitney U-test

Comparison

15-25 vs. 26-45 p<0.001

15-25 vs. 46-65 p<0.001

26-45 vs. 46-65 p=0.68

Need to multiple each p-value by 3

Page 66: Basic Statistics II. Significance/hypothesis tests.

Significance test example V