Chapter 6

38
Chapter 6 Inferences Regarding Locations of Two Distributions

description

Chapter 6. Inferences Regarding Locations of Two Distributions. Comparing 2 Means - Independent Samples. Goal: Compare responses between 2 groups (populations, treatments, conditions) - PowerPoint PPT Presentation

Transcript of Chapter 6

Page 1: Chapter 6

Chapter 6

Inferences Regarding Locations of Two Distributions

Page 2: Chapter 6

Comparing 2 Means - Independent Samples

• Goal: Compare responses between 2 groups (populations, treatments, conditions)

• Observed individuals from the 2 groups are samples from distinct populations (identified by (1,1) and (2,2))

• Measurements across groups are independent (different individuals in the 2 groups)

• Summary statistics obtained from the 2 groups:

222

111

:Size Sample :Dev. Std. :Mean :2 Group

:Size Sample :Dev. Std. :Mean :1 Group

nsy

nsy

Page 3: Chapter 6

Sampling Distribution of

• Underlying distributions normal sampling distribution is normal

• Underlying distributions nonnormal, but large sample sizes sampling distribution approximately normal

• Mean, variance, standard error (Std. Dev. of estimator):

21 YY

2

22

1

21

2

22

1

212

21

2121

21

21

21

nn

nnYYV

YYE

YY

YY

YY

Page 4: Chapter 6

Small-Sample Test for Normal Populations

• Case 1: Common Variances (12 = 2

2 = 2)

• Null Hypothesis:• Alternative Hypotheses:

– 1-Sided: – 2-Sided:

• Test Statistic:(where Sp2 is a “pooled” estimate of 2)

0210 : H

021: AH

021: AH

2

)1()1(

11

)(

21

222

211

21

021

nn

snsns

nns

yyt p

p

obs

Page 5: Chapter 6

Small-Sample Test for Normal Populations

• Decision Rule: (Based on t-distribution with =n1+n2-2 df)

– 1-sided alternative• If tobs t, ==> Conclude • If tobs < t ==> Do not reject

– 2-sided alternative• If tobs t , ==> Conclude • If tobs -t ==> Conclude • If -t < tobs < t ==> Do not reject

Page 6: Chapter 6

Small-Sample Test for Normal Populations

• Observed Significance Level (P-Value)• Special Tables Needed, Printed by Statistical Software

Packages

– 1-sided alternative

• P=P(t tobs) (From the t distribution)

– 2-sided alternative

• P=2P( t |tobs| ) (From the t distribution)

• If P-Value then reject the null hypothesis

Page 7: Chapter 6

Small-Sample (1-100% Confidence Interval for Normal Populations

• Confidence Coefficient (1-) refers to the proportion of times this rule would provide an interval that contains the true parameter value if it were applied over all possible samples

• Rule:

• Interpretation (at the significance level):– If interval contains 0, do not reject H0: 1 = 2

– If interval is strictly positive, conclude that 1 > 2

– If interval is strictly negative, conclude that 1 < 2

212/21

11

nnstyy p

Page 8: Chapter 6

t-test when Variances are Unequal• Case 2: Population Variances not assumed to be equal (1

222)

• Approximate degrees of freedom– Calculated from a function of sample variances and sample sizes (see formula

below) - Satterthwaite’s approximation

– Smaller of n1-1 and n2-1

• Estimated standard error and test statistic for testing H0: 1=2:

11

:df site'Satterthwa

:StatisticTest

:error standard Estimated

2

2

2

22

1

2

1

21

2

2

22

1

21

2

22

1

21

21

21

21

2

22

1

21

21

n

ns

n

ns

ns

ns

ns

ns

yy

yySE

yyt

n

s

n

sYYSE

obs

Page 9: Chapter 6

Example - Maze Learning (Adults/Children)

• Groups: Adults (n1=14) / Children (n2=10)

• Outcome: Average # of Errors in Maze Learning Task

• Raw Data on next slide

Adults (i=1) Children (i=2)Mean 13.28 18.28Std Dev 4.47 9.93Sample Size 14 10

• Conduct a 2-sided test of whether true mean scores differ

• Construct a 95% Confidence Interval for true difference

Source: Gould and Perrin (1916)

Page 10: Chapter 6

Example - Maze Learning (Adults/Children)Name Group Trials Errors AverageH 1 41 728 17.76W 1 25 333 13.32Mac 1 33 453 13.73McG 1 31 528 17.03 Group n Mean Std DevL 1 41 335 8.17 1 14 13.28 4.47R 1 48 553 11.52 2 10 18.28 9.93Hv 1 24 217 9.04Hy 1 32 711 22.22F 1 46 839 18.24Wd 1 47 473 10.06Rh 1 35 532 15.20D 1 69 538 7.80Hg 1 27 213 7.89Hp 1 27 375 13.89Hl 2 42 254 6.05McS 2 89 1559 17.52Lin 2 38 1089 28.66B 2 20 254 12.70N 2 49 599 12.22T 2 40 520 13.00J 2 50 828 16.56Hz 2 40 516 12.90Lev 2 54 2171 40.20K 2 58 1331 22.95

Page 11: Chapter 6

Example - Maze LearningCase 1 - Equal Variances

)2.1,2.11(20.600.5)99.2(074.200.5:%95

EXCEL) (From 1091.|)67.1|(2 :value

074.2||:

67.199.2

00.5

101

141

22.7

28.1828.13:

22.715.5221014

)93.9)(110()47.4)(114(

22,025.

22

CI

TPP

ttRR

tTS

s

obs

obs

p

H0: HA: 0 ( = 0.05)

No significant difference between 2 age groups

Page 12: Chapter 6

Example - Maze LearningCase 2 - Unequal Variances

)36.2,36.12(36.700.5)36.3(19.200.5:%95

19.2||:

49.136.3

00.5

10)93.9(

14)47.4(

28.1828.13:

63.1196.10

46.127

9)86.9(

13)43.1(

86.943.1

86.910

)93.9(43.1

14

)47.4(

63.11,025.

22

22

2*

2

2

22

2

1

21

CI

ttRR

tTS

n

S

n

S

obs

obs

H0: HA: 0 ( = 0.05)

No significant difference between 2 age groups

Note: Alternative would be to use 9 df (10-1)

Page 13: Chapter 6

SPSS Output

Group Statistics

14 13.2761 4.46784 1.19408

10 18.2759 9.93279 3.14102

GROUPAdult

Chi ld

AVE_ERRN Mean Std. Deviation

Std. ErrorMean

Independent Samples Test

4.420 .047 -1.672 22 .109 -4.9998 2.99017 -11.20101 1.20145

-1.488 11.621 .163 -4.9998 3.36034 -12.34787 2.34831

Equal variancesassumed

Equal variancesnot assumed

AVE_ERRF Sig.

Levene's Test forEquality of Variances

t df Sig. (2-tailed)Mean

DifferenceStd. ErrorDifference Lower Upper

95% ConfidenceInterval of the

Difference

t-tes t for Equality of Means

Page 14: Chapter 6

(1)100 Confidence Interval for 1-2

)36.2,36.12(36.700.5)36.3(19.200.5:%95

:9) use couldor 11.63(df Data Maze

1,1 ofsmaller or iteSatterthwadf

: 2 Case

)2.1,2.11(20.600.5)99.2(074.200.5:%95

:22)(df Data Maze

2

11: 1 Case

21

2

22

1

21

2/2122

21

21

212/21

22

21

CI

nn

n

s

n

styy

CI

nndf

nnstyy p

Page 15: Chapter 6

Small Sample Test to Compare Two Medians - Nonnormal Populations

• Two Independent Samples (Parallel Groups)• Procedure (Wilcoxon Rank-Sum Test):

– Null hypothesis: Population Medians are equal H0: M1 = M2

– Rank measurements across samples from smallest (1) to largest (n1+n2). Ties take average ranks.

– Obtain the rank sum for group with smallest sample size (T )

– 1-sided tests:Conclude HA: M1 > M2 if T > TU

– Conclude: HA: M1 < M2 if T < TL

– 2-sided tests: Conclude HA: M1 M2 if T > TU or T < TL

– Values of TL and TU are given in Table 5, p. 1092 for various sample sizes and significance levels.

– This test is mathematically equivalent to Mann-Whitney U-test

Page 16: Chapter 6

Example - Levocabostine in Renal Patients

Non-Dialysis Hemodialysis857 (12) 527 (7)567 (9) 740 (11)626 (10) 392 (2.5)532 (8) 514 (6)444 (5) 433 (4)357 (1) 392 (2.5)T1 = 45 T2 = 33

• 2 Groups: Non-Dialysis/Hemodialysis (n1 = n2 = 6)

• Outcome: Levocabastine AUC (1 Outlier/Group)

• 2-sided Test = 0.05) TL=26, TU = 52, T=45 (Group 1)

• Conclude Medians differ (M1<M2) if T < 26

• Conclude Medians differ (M1>M2) if T > 52

• Neither criteria are met, do not conclude medians differSource: Zagornik, et al (1993)

Page 17: Chapter 6

Computer Output - SPSS

Ranks

6 7.50 45.00

6 5.50 33.00

12

GROUPNon-Dialysis

Hemodialys is

Total

AUCN Mean Rank Sum of Ranks

Test Statisticsb

12.000

33.000

-.962

.336

.394a

Mann-Whitney U

Wilcoxon W

Z

Asymp. Sig. (2-tailed)

Exact Sig. [2*(1-tai ledSig.)]

AUC

Not corrected for ties .a.

Grouping Variable: GROUPb.

Note that SPSS uses rank sum for Group 2 as test statistic

Page 18: Chapter 6

Rank-Sum Test: Normal Approximation

• Under the null hypothesis of no difference in the two groups (let T be rank sum for group 1):

• A z-statistic can be computed and P-value (approximate) can be obtained from Z-distribution

21211

12

)1(

2

)1(nnN

NnnNnTT

12/)1(

2/)1(

21

1

Nnn

NnTTz

T

Tobs

Note: When there are many ties in ranks, a more complex formula for T is often used, see p. 321 of Longnecker and Ott.

Page 19: Chapter 6

Example - Maze Learning

Hl 2 42 254 6.05 1 0 1 0 1D 1 69 538 7.80 2 1 0 2 0Hg 1 27 213 7.89 3 1 0 3 0L 1 41 335 8.17 4 1 0 4 0Hv 1 24 217 9.04 5 1 0 5 0Wd 1 47 473 10.06 6 1 0 6 0R 1 48 553 11.52 7 1 0 7 0N 2 49 599 12.22 8 0 1 0 8B 2 20 254 12.70 9 0 1 0 9Hz 2 40 516 12.90 10 0 1 0 10T 2 40 520 13.00 11 0 1 0 11W 1 25 333 13.32 12 1 0 12 0Mac 1 33 453 13.73 13 1 0 13 0Hp 1 27 375 13.89 14 1 0 14 0Rh 1 35 532 15.20 15 1 0 15 0J 2 50 828 16.56 16 0 1 0 16McG 1 31 528 17.03 17 1 0 17 0McS 2 89 1559 17.52 18 0 1 0 18H 1 41 728 17.76 19 1 0 19 0F 1 46 839 18.24 20 1 0 20 0Hy 1 32 711 22.22 21 1 0 21 0K 2 58 1331 22.95 22 0 1 0 22Lin 2 38 1089 28.66 23 0 1 0 23Lev 2 54 2171 40.20 24 0 1 0 24

158 142T=T1 T2

Adults = Group 1

Page 20: Chapter 6

Example - Maze Learning

32.)16(.2|)9954.|(2 :value- sided2

96.1||:

9954.008.17

175158

08.1712

)25)(10(14

12

)1(

1752

)25(14

2

)1(158

241014 Adults :1 Group

05.0::

2/

21

1

2121

21210

ZPP

zzRR

z

Nnn

NnT

nnNnn

MMHMMH

obs

obs

T

T

A

Page 21: Chapter 6

Computer Output - SPSS

Ranks

14 11.29 158.00

10 14.20 142.00

24

GROUPAdult

Child

Total

AVE_ERRN Mean Rank Sum of Ranks

Test Statisticsb

53.000

158.000

-.995

.320

.341a

Mann-Whitney U

Wilcoxon W

Z

Asymp. Sig. (2-tailed)

Exact Sig. [2*(1-tai ledSig.)]

AVE_ERR

Not corrected for ties .a.

Grouping Variable: GROUPb.

Page 22: Chapter 6

Inference Based on Paired Samples (Crossover Designs)

• Setting: Each treatment is applied to each subject or pair (preferably in random order)

• Data: di is the difference in scores (Trt1-Trt2) for subject (pair) i

• Parameter: D - Population mean difference

• Sample Statistics:

21

2

21

1 dd

n

i id

n

i i ssn

dds

n

dd

Page 23: Chapter 6

Test Concerning D

• Null Hypothesis: H0:D=0 (almost always 0)

• Alternative Hypotheses: – 1-Sided: HA: D > 0

– 2-Sided: HA: D 0

• Test Statistic:

ns

dt

d

obs0

Page 24: Chapter 6

Test Concerning D

Decision Rule: (Based on t-distribution with =n-1 df)1-sided alternative (HA: D > 0)

If tobs t ==> Conclude DIf tobs < t ==> Do not reject D

2-sided alternative (HA: D 0)If tobs t ==> Conclude DIf tobs -t ==> Conclude DIf -t < tobs < t ==> Do not reject D

Confidence Interval for D

n

std d

2/

Page 25: Chapter 6

Example Antiperspirant Formulations

• Subjects - 20 Volunteers’ armpits (df=20-1=19)

• Treatments - Dry Powder vs Powder-in-Oil

• Measurements - Average Rating by Judges– Higher scores imply more disagreeable odor

• Summary Statistics (Raw Data on next slide):

20248.015.0 nsd d

Source: E. Jungermann (1974)

Page 26: Chapter 6

Example Antiperspirant Formulations

Subject Dry Powder Powder-in-Oil Difference1 2 1.9 0.12 2.8 2.4 0.43 1.3 1.5 -0.24 1.8 1.8 05 1.9 1.8 0.16 2.8 2.4 0.47 2 2.2 -0.28 1.5 1.5 09 1.9 1.7 0.2

10 2.9 2.8 0.111 2.9 2.7 0.212 2.3 1.5 0.813 2.3 2.5 -0.214 3.6 3.2 0.415 2.2 2.1 0.116 2.1 1.9 0.217 2.5 2.6 -0.118 2.4 2 0.419 3.1 2.9 0.220 2 1.9 0.1

0.15 Mean0.248151058 Std Dev

Page 27: Chapter 6

Example Antiperspirant Formulations

)266.0,034.0(116.015.0)0555(.093.215.0

:for CI 95%

2.70)2P(tvalue

093.2:

70.20555.

15.0

20248.0

15.0:

differ) effectson (Formulati 0:

effects)n formulatioin difference (No 0:

025.

025.025.

0

n

std

P

tttRR

ns

dtTS

H

H

dD

obs

dobs

DA

D

Evidence that scores are higher (more unpleasant) for the dry powder (formulation 1)

Page 28: Chapter 6

Small-Sample Test For Nonnormal Data

• Paired Samples (Crossover Design)• Procedure (Wilcoxon Signed-Rank Test)

– Compute Differences di (as in the paired t-test) and obtain their absolute values (ignoring 0s). n= number of non-zero differences

– Rank the observations by |di| (smallest=1), averaging ranks for ties

– Compute T+ and T- , the rank sums for the positive and negative differences, respectively

– 1-sided tests:Conclude HA: M1 > M2 if T=T- T0

– 2-sided tests:Conclude HA: M1 M2 if T=min(T+ , T- ) T0

– Values of T0 are given in Table 6, pp 1093-1094 for various sample sizes and significance levels. P-values printed by statistical software packages.

Page 29: Chapter 6

Signed-Rank Test: Normal Approximation

• Under the null hypothesis of no difference in the two groups :

• A z-statistic can be computed and P-value (approximate) can be obtained from Z-distribution

24

)12)(1(

4

)1(

nnnnnTT

24/)12)(1(

4/)1(

nnn

nnTTz

T

Tobs

Page 30: Chapter 6

Example - Caffeine and Endurance

• Step 1: Take absolute values of differences (eliminating 0s)

• Step 2: Rank the absolute differences (averaging ranks for ties)

• Step 3: Sum Ranks for positive and negative true differences

• Subjects: 9 well-trained cyclists

• Treatments: 13mg Caffeine (Condition 1) vs 5mg (Condition 2)

• Measurements: Minutes Until Exhaustion

• This is subset of larger study (we’ll see later)

Source: Pasman, et al (1995)

Page 31: Chapter 6

Example - Caffeine and Endurance

Cyclist mg13 mg5 mg13-mg51 37.55 42.47 -4.922 59.30 85.15 -25.853 79.12 63.20 15.924 58.33 52.10 6.235 70.54 66.20 4.346 69.47 73.25 -3.787 46.48 44.50 1.988 66.35 57.17 9.189 36.20 35.05 1.15

Original Data

Page 32: Chapter 6

Example - Caffeine and Endurance

Cyclist mg13 mg5 mg13-mg5 abs(diff)1 37.55 42.47 -4.92 4.922 59.30 85.15 -25.85 25.853 79.12 63.20 15.92 15.924 58.33 52.10 6.23 6.235 70.54 66.20 4.34 4.346 69.47 73.25 -3.78 3.787 46.48 44.50 1.98 1.988 66.35 57.17 9.18 9.189 36.20 35.05 1.15 1.15

Absolute Differences

Cyclist mg13 mg5 mg13-mg5 abs(diff) rank9 36.20 35.05 1.15 1.15 17 46.48 44.50 1.98 1.98 26 69.47 73.25 -3.78 3.78 35 70.54 66.20 4.34 4.34 41 37.55 42.47 -4.92 4.92 54 58.33 52.10 6.23 6.23 68 66.35 57.17 9.18 9.18 73 79.12 63.20 15.92 15.92 82 59.30 85.15 -25.85 25.85 9

Ranked Absolute Differences

T+ = 1+2+4+6+7+8=28

T- = 3+5+9=17

Page 33: Chapter 6

Example - Caffeine and Endurance

Under null hypothesis of no difference in the two groups (T=T+):

5156.)2578(.2|)65.0|(2 :Value

65.044.8

5.5

44.8

5.2228

44.824

1710

24

)118)(19(9

24

)12)(1(

5.224

90

4

)19(9

4

)1(

ZPP

Tz

nnn

nn

T

Tobs

T

T

There is no evidence that endurance times differ for the 2 doses (we will see later that both are higher than no dose)

Page 34: Chapter 6

SPSS OutputRanks

6a 4.67 28.00

3b 5.67 17.00

0c

9

Negative Ranks

Pos itive Ranks

Ties

Total

MG5 - MG13N Mean Rank Sum of Ranks

MG5 < MG13a.

MG5 > MG13b.

MG5 = MG13c.

Test Statisticsb

-.652a

.515

Z

Asymp. Sig. (2-tailed)

MG5 - MG13

Based on positive ranks .a.

Wilcoxon Signed Ranks Tes tb.

Note that SPSS is taking MG5-MG13, while we used MG13-MG5

Page 35: Chapter 6

Sample Sizes for Given Margin of Error

• Goal: Achieve a particular margin of error (E) for estimating 1-2 (Width of 95% CI will be 2E)– Case 1: Independent Samples (Assumes equal variances)

– Case 2: Paired Samples

2

222/

212/21

2/

2 when

211

E

znnnn

nz

nnzE

2

222/

2/

1

E

zn

nzE d

d

In practice, the variance will need to estimated in a pilot study or obtained from previously conducted work.

Page 36: Chapter 6

Sample Size Calculations for Fixed Power• Goal - Choose sample sizes to have a favorable chance of

detecting a specified difference in 1 and 2

• Step 1 - Define an important difference in means: 21

• Step 2 - Choose the desired power to detect the the clinically meaningful difference (1-, typically at least .80). For 2-sided test:

2

22/

2

2

22/

2

21

:Samples Paired

2 :Samplest Independen

zzn

zznn

d

For 1-sided tests, replace z/2 with z

In practice, variance must be estimated, or given in units of

Page 37: Chapter 6

Example - Rosiglitazone for HIV-1 Lipoatrophy

• Trts - Rosiglitazone vs Placebo• Response - Change in Limb fat mass• Clinically Meaningful Difference - =0.5• Desired Power - 1- = 0.80• Significance Level - = 0.05

63

)5.0(

84.096.12

84.96.1

2

2

21

20.2/

nn

zzz

Source: Carr, et al (2004)

Page 38: Chapter 6

Data Sources• Zagonik, J., M.L. Huang, A. Van Peer, et al. (1993). “Pharmacokinetics of

Orally Administered Levocabastine in Patients with Renal Insufficiency,” Journal of Clinical Pharmacology, 33:1214-1218

• Gould, M.C. and F.A.C. Perrin (1916). “A Comparison of the Factors Involved in the Maze Learning of Human Adults and Children,” Journal of Experimental Psychology, 1:122-???

• Jungermann, E. (1974). “Antiperspirants: New Trends in Formulation and Testing Technology,” Journal of the Society of Cosmetic Chemists 25:621-638

• Pasman, W.J., M.A. van Baak, A.E. Jeukendrup, and A. de Haan (1995). “The Effect of Different Dosages of Caffeine on Endurance Performance Time,” International Journal of Sports Medicine, 16:225-230

• Carr, A., C. Workman, D. Crey, et al, (2004). “No Effect of Rosiglitazone for Treatment of HIV-1 Lipoatrophy: Randomised, Double-Blind, Placebo-Controlled Trial,” Lancet, 363:429-438