pharmaceutical statistics lecture 14 hypothesis testing: the difference between two population means

31
Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Upload: percival-ward

Post on 19-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Pharmaceutical Statistics

Lecture 14Hypothesis Testing:

The Difference Between Two PopulationMeans

Page 2: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Hypothesis Testing: The Difference Between TwoPopulation Means

• Hypothesis testing involving the difference between two population means is most frequently employed to determine whether or not it is reasonable to conclude that the population means are not equal. Using the same methodology, it is possible to test the hypothesis that the difference is equal to, greater than orequal to, or less than or equal to some value other than zero.

• In such cases, one of the following hypotheses may be formulated:H0: μ1 – μ2 = 0, HA: μ1 – μ2 ≠ 0H0: μ1 – μ2 ≥ 0, HA: μ1 – μ2 0 H0: μ1 – μ2 ≤ 0, HA: μ1 – μ2 0

Page 3: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

A) When we withdraw two samples from two populations thatare normally distributed with known σ1 and σ2

• Test statistic for the null hypothesis of equal populationmeans (H0: μ1 – μ2 = 0, HA: μ1 – μ2 ≠ 0) is:

• The subscript H indicates that the difference is a hypothesized parameter (in this case (μ1-μ2)H=0).

x1 x 2

z

(x1 x2 ) (1 2 )H

21

22

n1 n2

Page 4: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

ExampleResearchers are interested to know if there is any difference in the mean uric acid levels between normal individuals and individuals with Down’s syndrome. They collected samples from each population and uric acid level were determined in each samples. Analysis results are summarized below:

Assume that samples were drawn from normally distributed population with variance equal to 1 for the Down’s syndrome population and 1.5 for the normal population.

A) Construct the proper hypothesis to test if there is significant difference between the two population means;

B) Test your constructed hypothesis using the experimental data.C) Decide on your hypothesis andD) Conclude on the difference in mean uric acid levels between the two studied

populationsE) Calculate the P-value

Normal individuals With Down’s Syndrome

Number of volunteers 15 12

Uric acid sample mean(mg/100 mL)

4.5 3.4

Page 5: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

• We are interested in any significant difference, so we consider the null hypothesis with equal means

H0: μ1 – μ2 = 0, HA: μ1 – μ2 ≠ 0

An alternative way of stating the hypothesis is as followsH0: μ1 = μ2, HA: μ1 ≠ μ2

• The test statistic is:

• Calculation of the test statistic:

z x1 x 2

(x1 x2 ) (1 2 )H

21

22

n1 n2

zX N X D

(xN x D ) (N D )H

2 2

D N

nN

nD

1 1.5

1215

(4.5 3.4) 0

1.1 2.57

0.4282

Page 6: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

• Decision rule: We use the z-stat. Let α=0.05, the critical valuesof z are 1.96 and -1.96. Reject H0 unless -1.96 z 1.96

• Statistical decision to reject H0 since +2.57 +1.96• Conclude that on the basis of the data, there is an indication

that the two population means are not equal.• P-value: 0.0102 (the area to the right of 2.57 and the left of -

2.57)

Page 7: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

B) When we withdraw two samples from two populations that are NOT normally distributed (σ1 and σ2 are unknown) and

the sample size is large

• Test statistic for the null hypothesis of equal population means (H0: μ1 – μ2 = 0, HA: μ1 – μ2 ≠ 0) is:

• The subscript H indicates that the difference is a hypothesized parameter (in this case (μ1-μ2)H=0).

z (x1 x2 ) (1 2 )H

s

s2221n1 n2

If we have no idea about the normality of the parent distributions and their parameters, we use the CLT to justify our use of the z-table to find the reliability coefficient. We use the samples standard deviations to calculate the standard error of the difference. This is only true for large samples

X X1 2

sX X1 2

21 1

22 2 [(s / n ) (s / n )]

Page 8: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

• A study was designed to test the effect of disability on the beneficiaryeffects of health promotion. The researchers developed a scale for testing this effect (BHADP), the scale was administered to a sample of 132 disabled (D) and 137 nondisabled (ND) subjects with the following results:

• The authors wish to know if they may conclude on the basis of theseresults that, in general, disabled persons, on the average, score higher on the BHADP scale. Construct the proper hypothesis and test it.Note: use a significance level of 1%.

Sample Mean Score Standard Deviation

D 31.83 7.93

ND 25.07 4.80

Page 9: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example• The statistics were computed from two independent samples that

behave as simple random samples from a normally distributed population of disabled persons and a population of nondisabled persons.

• Since the population variances are unknown, we will use samplevariances in the calculation of the test statistic.

• Since we have large samples, the central limit theorem allows us touse z as a test statistic.

• Hypotheses:H0: μD – μND ≤ 0 HA: μD – μND >

0or alternatively:

H0: μD ≤ μND

HA: μD > μND

Disabled scores are higher!!

z (x1 x2 ) (1 2 )H

s

s2221n1 n2

Disabled scores are higher!!

Page 10: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

• Decision rule: Let α=0.01. this is a one-tailed (right) test with critical value of z equal to 2.33 (from SND tables, Z0.99).

• Reject H0 since zcomputed = 8.42 > 2.33• The data indicate that, on average, disabled persons score higher on

the BHADP scale than do nondisabled person.

• For this test, p 0.001 (very highly significant)

132 137

(7.93)2 (4.80)2

• Reject H0 if zcomputed≥2.33

• Calculation of the test statistic:

z (31.83 25.07) 0 8.42

Page 11: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

C) When we withdraw two samples from two populations that arenormally distributed (σ1 and σ2 are unknown) and the sample size is

small

• Parent pops: Normally distributed• Variance for pops: Unknown• Sample size: Small

We can not use the z-distribution in this case. We need to use the t-table to find the critical values and we need to use standard deviations of the

two samples to find the standard error in the t-score calculation.

Important note in this case:The calculation of the standard error from s1,n1 and s2, n2 depend on the equality of

the parent populations variances

C.1) If they are equal: we use t-

distribution

C.2) If they are not equal: we use the t’-distribution

Page 12: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

C.1) When we withdraw two samples from two populations that are normallydistributed (σ1 and σ2 are unknown and equal) and the sample size is small

• In this case, we need to consider the samples variances + to use t-table.• Since the sample variance is dependent on the sample size, we need to take this

into consideration for samples with different sizes (n) to calculate the pooledestimate of the common variance

NOTE: If the sample size for both independent samples is equal, we take directly the arithmetic mean of the two samples variances (simple average) .

• The standard error of the estimate will be:

• The test statistic for testing H0: μ1 = μ2 is given by:

ps2 (n 1)s2 (n 1)s2

1 1 22

n1 n2 2

sX 1 X 2 X 1 X 2

s2

p

n1

s2

p

n2

[This formula pools both sample variances with their corresponding weight that based on the sample size]

For critical values: We use the t-tablewith D.F= n1+n2-2

t (x1 x 2 ) (1 2 )H

s2 s2pp

n1 n2

Page 13: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

ExampleIn a study to investigate the lung destruction in cigarette smokers, a lung destructive index was measured in a sample of lifelong nonsmokers and smokers. A larger score indicates greater lung damage. The data is summarized below:

We wish to know if we may conclude that smokers, in general, have greater lung damage measured by this destructive index than do nonsmokers? Assuming that the lung destructive index scores in both populations are approximately normally distributed with equal variances, construct the proper hypothesis and test it.

Non-smokers smokers

Number of volunteers 9 16

Average score 12.4 17.5

Standard deviation 4.8492 4.4711

Page 14: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example• Hypotheses:

H0: μS ≤ μNS, HA: μS μNS

• Test statistic (t-test with pooled variance):

x

NS

p

nS 9, x S 17.5, SS 4.4711............. nNS 16, 12.4, SNS 4.8492

2s S(nS 1)s (n NS NS2 2

nS nNS

1)s 8(4.8492) 15(4.4711)2 2

223

21.2165

s2p

nS

s2

p

nNS

21.2165

21.2165916

t (xS xNS ) (S NS )0

(17.5 12.4) 0 2.6573

Page 15: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

t0.95=1.714 for DF:23

α=5% (0.05)

Confidence=95%

AUC-∞t0.95

• Critical values and Decision rule:let α=0.05 (right-tailed test). the critical values of t is +1.714 (from table withD.F=23, cumm. prop=95%). Reject if tcaclulated > 1.714

Page 16: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example• Statistical decision: we reject H0 because 2.6573>1.714 (falls in

the rejection zone).

• Conclusion: we conclude that smokers may have greater lung damage than nonsmokers.

α=5% (0.05)

t

c

a

l

c

=2.6573

t0.95=1.714 for DF:23

• p value: 0.01>P>0.005, since 2.500 2.65732.8073

tcalc=2.6573

Page 17: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

C.2) When we withdraw two samples from two populations that are normally distributed (σ1 and σ2 are unknown and NOT equal) and the

sample size is small• We can not use the t-table to find the critical values for D.F= n1+n2-2.• Solution: Instead of finding the critical values from the tables, we need to

compute it taking into consideration the critical values for each sampling distributions and the weight of each sample.

1 / 2t ' w1t1 w2t2

1w w 2

1w s2

1

n1

2w 2s2

n2

t1 t1 / 2 ....... for: n1 1

t2 t1 / 2 ....... for: n2 1

How to compute the critical valuesfor two-tailed test?

1t ' w1t1 w2t2

1w w 2

1w s2

1

n1

2w 2s2

n2

t1 t1 ....... for: n1 1

t2 t1 ....... for: n2 1

How to compute the critical valuesfor one-tailed test?

_ _

(x x ) ( )t 1 2 1 2 0

s2 s21 2

n1 n2

And we use S1

and S2 in the formula of t-test

Page 18: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

α/2=2.5% (0.025)

t1 / 2'

w1t1 w2t2

1w w 2

1w s21

n1

2w s2

2

n2

t1 t1 / 2 ....... for: n1 1

t2 t1 / 2 ....... for: n2 1

t1-α/2=t97.5%=t0.975

α=5% (0.05)1t ' w1t1 w2t2

w w1 2

1w 1s2

n1

w2 2s2

n2

t1 t1 ....... for: n1 1

t2 t1 ....... for: n2 1

For a two sided test, reject H0 if the computed value of t is either greater than or equal to the critical values t`(1-α/2)

or less than or equal to the negative of that value.

t1-α=t95%=t0.95

For a one-sided test with the rejection region in the right tail of the sampling distribution, reject H0 if the computed t is equal to or greater than the critical t`1-α.

For a one-sided test with the rejection region in the left tail of the sampling distribution,reject H if the computed t is equal to or smaller than the negative of the critical t`

1-α0

computed.

Page 19: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

The research team want to know if they can conclude that the two population means are different. Assuming that both populations are approximately normally distributed, construct the proper hypothesis and test it?.

Researchers wish to know if two populations differ with respect to the mean value of the total serum complement activity (CH50). The data consist of CH50

determinations on apparently normal subjects (n2=20 ) and subjects with

disease (n1=10 ). The sample means and standard deviations are:

_ s1 33.8

s2 101.1

x1 62.6_

x2 47.2

The populations are normally distributed with unknown variances that areunequal. With this in mind we will use t’-stat.

Page 20: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

• Hypothesis:H0: μ1 – μ2 = 0

HA: μ1 – μ2 ≠ 0• Test statistic:

_ _

t (x 1 x 2 ) (1 2 )0

s

s2221n1

n2

• We obtain the critical value by the equation:

1 2

t`w w w1t1 w2t2

(1 )2

Two-tailed test!!

Page 21: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

t '1 / 2

1 2w w 114.244 5.1005 w1t1 w2t2

114.244(2.2622) 5.1005(2.0930) 2.255

1w s2

1

n1

33.82

10 114.244

s22

w2 n 2

10.12

20 5.1005

t1 t1 / 2 ....... for : n1 1........... 2.2622

t2 t1 / 2 ....... for : n2 1.......... 2.0930

Using t-table with DF=9 and cumm prop=0.975(let α=0.05)

Using t-table with DF=19 and cumm prop=0.975 (let α=0.05)

Page 22: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

• Since we found the t`(1-α/2) to be equal to 2.255, our critical values will be±2.255 (two-tailed test)

• Our decision rule is reject H0 if the computed t is either ≥2.255 or ≤-2.255.

• Calculation of the test statistic:

• Statistical decision: since -2.255 1.41 2.255, we can not reject the H0.

• On the basis of these results we can not conclude that the two populationmeans are different.

• The p value of this test 0.05

t (62.6 47.2) 0

(3 3.8) 2 (1 0.1) 2

1 0 2 0

15.410 .92

1 .41

Page 23: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Paired Comparisons

• Previously we discussed the difference between two population means assuming that the samples were independent.

• Some times we may want to assess the effectiveness of a treatment or experimental procedure making use of observations resulting from nonindependent samples.

• A hypothesis test based on this type of data is called a paired comparison test.

Page 24: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Why do we need paired test??The objective in paired comparison tests is to eliminate maximum number of

sources of extraneous variations by making the pairs similar with respect to asmany variables as possible.

Not Paired Paired

To study the effect of gold nanoparticles in treating tumors, we induce tumor and then target it with gold nanoparticles which serve as “nanoheaters” upon radiation with laser. In “Not Paired” case, we use two groups that one receives gold nanoparticles and the other does not (control). The difference between treated and control may be due simply a difference in external characteristics between the mice in both groups. To eliminate this difference, we can use one group of mice and induce two identical tumors in the same mouse as you see in the picture to the right. Or we can use the same mice with before/after strategy.

Example

laserNo laserlaser

No laser

Page 25: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Why do we need paired test??• Related or paired observations may be obtained in a

number of ways:– The same subjects may be measured before and after

receiving some treatment.– Same subjects with part of their bodies

(treatment/control, previous slide)– In comparing two methods of analysis, the material to be

analyzed may be divided equally so that one half is analyzed by one method and one half is analyzed by another.

Page 26: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Paired Test• Instead of performing the analysis with individual observations, we use

di, the difference between pairs of observations as the variable of interest.

• When the n sample differences computed from the n pairs of measurements constitute a simple random sample from a normally distributed population of differences, the test statistic for testing hypothesis about the population mean difference μd is:

d dt 0

Sd / n

where:

d is the mean for sample differences

0d is the hypothesized population mean differe

Sd is the standard deviation of the sample differe

n is the number of sample differences

Page 27: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Paired Test

• The t statistic is distributed as Student’s t with n-1 degrees of freedom (this is the general case but not always!!).

• We do not have to worry about the equality of variances in paired comparisons, since our variable is the difference in the reading of the same subject or object.

• If the population variance of the difference is known, we can use z-stat (this is not applicable always)

• If the assumption of normality for the distribution of the differences can not be made, we can use large n and thus use the CLT to justify our use of the z-stat (we approximate σ by the use of sample S)

Page 28: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example• In a study to evaluate the effect of very low calorie diet

(VLCD) on the weight of 9 subjects, the following data was collected before (B) and after (A) treatment:

• The researchers wish to know if these data provide sufficient evidence to allow them to conclude that the treatment is effective in causing weight reduction in those individuals. Assuming that differences between A&B are approximately normally distributed, construct the proper hypothesis and test it (you need to know that this is paired t-test!!!!!)?.

B (Kg)

117.3 111.4 98.6 104.3 105.4 100.4 81.7 89.5 78.2

A(Kg)

83.3 85.9 75.8 82.9 82.3 77.7 62.7 69 63.9

Page 29: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example• We may obtain the differences in one of two ways: by

subtracting the before weights from the after weights (A –B) or by subtracting the after weights from the before weights (B – A).

• If we choose (di=A – B), the differences are:

-34, -25.5, -22.8, -21.4, -23.1, -22.7, -19, -20.5, -14.3

• Assumptions: the observed differences constitute a simple random sample from a normally distributed population of differences with unknown variance (t-test).

• Hypotheses:H0: μd ≥ 0 HA: μd

0

(left-tailed test)(indicating weight reduction)

Page 30: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

• Hypotheses (for (di=A – B)):H0: μd ≥ 0HA: μd 0

(left-tailed test)(indicating weight reduction)

NOTE:If we had obtained the differences by subtracting the

after weights from the before weights (B – A) our hypotheses would have been:

H0: μd ≤ 0 (right-tailed test)HA: μd > 0 (indicating weight reduction)

• If the question had been such that a two-tailed test was indicated (any difference/change), the hypotheses would have been:

H0: μd = 0HA: μd ≠ 0

Page 31: Pharmaceutical Statistics Lecture 14 Hypothesis Testing: The Difference Between Two Population Means

Example

• The test statistic:

-1.860, reject H0 if the computed t is less than or equal to thecritical value.

d d

t 0

Sd /

n

• Decision rule: Let α=0.05, the critical value of t is

d di 203.3

n 9 2 2.5 889

d2s

(di d) 2

n 1 2 8.2 961

t 2 2.5 88 9 0 2 8.2

9619

1 2.74

Reject H0, since -12.7395 is in the rejection

reg We may conclude that the diet program is

effect

-1.860=-t1-α=-t0.95 (n-1=8)

α=5% (0.05)

t'calc=-12.74

P-value<0.001 since -12.74<-5.041 see the table

H0: μd ≥ 0