37
Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Embed Size (px)

Citation preview

Page 1: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Lecture 9 TWO GROUP MEANS TESTS

EPSY 640

Texas A&M University

Page 2: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Two independent groups experiments

• Randomization distributions.

• 6 scores (persons, things) can be randomly split into 2 groups 20 ways:

• 1 2 3 4 5 6 1 2 4 3 5 6 1 2 5 3 4 6 1 2 6 3 4 5 1 3 4 2 5 6

• 1 3 5 2 4 6 1 3 6 2 4 5 1 4 5 2 3 6 1 4 6 2 3 5 1 5 6 2 3 4

• 2 3 4 1 5 6 2 3 5 1 4 6 2 3 6 1 4 5 2 4 5 1 3 6 2 4 6 13 5

• 2 5 6 1 3 4 3 4 5 1 2 6 3 4 6 1 2 6 3 5 6 1 2 4 4 5 6 1 2 3

Page 3: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Two independent groups experiments

• Differences between groups can be arranged as follows:

-3 -1 1 3

-5 -3 -1 1 3 5

-9 -7 -5 -3 -1 1 3 5 7 9

• look familiar? -8.00 -4.00 0.00 4.00 8.00

Difference

0

1

2

3

Co

un

t

Page 4: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

t-distribution

• Gossett discovered it

• similar to normal, flatter tails

• different for each sample size, based on N-2 for two groups (degrees of freedom)

• randomization distribution of differences is approximated by t-distribution

Page 5: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

t-distribution assumptions

• NORMALITY – (W test in SPSS)

• HOMOGENEITY OF VARIANCES IN BOTH GROUPS’ POPULATIONS– Levene’s test in SPSS

• INDEPENDENCE OF ERRORS– logical evaluation– Durbin-Watson test in serial data

Page 6: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Null hypothesis for test of means for two independent groups

• H0: 1 - 2 =0

• H1: 1 - 2 0 .

• fix a significance level, .

• Then we select a sample statistic. In this case we choose the sample mean for each group, and the test statistic is the sample difference

• d = y1 – y2 .

Page 7: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Variance and Standard deviation of differences in the Population

• The variance in the POPULATION of a difference of two independent scores is:

2d = 2

(y1 – y2 ) = 2 y1 + 2

y2

d = 2(y1 – y2 ) = standard error of difference

• Example, 21 = 100, 2

2 = 100,

2(y1-y2) = 100 + 100

= 200

(y1-y2) = 14.14

Page 8: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Variance and Standard deviation of difference in means

• The variance of the difference in POPULATION MEANS is the variance of score difference divided by the sample sizes:

2d = 2

(y1 – y2 ) = (2 y1 /n1 + 2

y2 /n2)

d = 2(y1 – y2 )

• Example, 21 = 100, 2

2 = 100, n1 = 16, n2=16

2(y1-y2) = 100 + 100 = 200 s(y1-y2) = 14.14

2d = 100/16 + 100/16 =12.5

d = 3.54, standard deviation of mean difference

Page 9: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

MEANING OF VARIANCE OF POPULATION MEAN

DIFFERENCE• WE ASSUMED EQUAL VARIANCES

FOR THE TWO POPULATIONS

• THUS, VARIANCE OF DIFFERENCE IS EQUAL TO SINGLE VARIANCE (AVERAGE OF THE TWO VARIANCES) TIMES SUM OF 1/SAMPLE SIZE:

2d = (2

y1 /n1 + 2 y2 /n2) = 2

(1/n1 + 1/n2)

Page 10: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Mean difference = 0

Null Hypothesis

t-distribution, df=16+16-2 = 30

Critical t(30) = 2.042

SD=3.54

2.042 * 3.54 = 7.22 points needed for significance from difference=0

Page 11: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Standard error of mean difference score for unequal sample size

• standard error of the sample difference. It consists of the square root of the average variance of the two samples,

• [(n1 –1)s21 + (n2 – 1)s2

2 ] / (n1 + n2 –2) • multiplied by the sum of 1/sample size

( 1/n1 + 1/n2 ). • Same as previous slide, only difference is

adjusting for difference sample sizes in the two groups

Page 12: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Null hypothesis for test of means for two independent groupst = d / sd

_____________________________________________

= (y1 – y2 )/ { {[(n1 –1)s21 + (n2 – 1)s2

2 ] / (n1 + n2 –2)} { 1/n1 + 1/n2}

Weighted average variance of two groups Sampling weights

Page 13: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Independent Samples Test

3.238 .073 1.342 392 .180 1.393 1.037 -.647 3.432

1.369 375.425 .172 1.393 1.017 -.608 3.393

Equal variancesassumed

Equal variancesnot assumed

t8 SENSE OFINADEQUACY

F Sig.

Levene's Test forEquality of Variances

t df Sig. (2-tailed)Mean

DifferenceStd. ErrorDifference Lower Upper

95% ConfidenceInterval of the

Difference

t-test for Equality of Means

Boy-Girl differences on Sense of Inadequacy on BASC for a nonrandom sample

Page 14: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

REGRESSION APPROACH

ANOVA

Model Sum of Squares df Mean Square F Sig.

Regression 185.97 1 185.97 1.802 .18

Residual 40454.07 392 103.20

Total 40640.04 393

a Predictors: (Constant), SEX

b Dependent Variable: SENSE OF INADEQUACY

Model Summary

Model R R Square Adjusted R Square Std. Error of the Estimate

1 .068 .005 .002 10.16

Predictors: (Constant), SEX

Page 15: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

REGRESSION COEFFICIENTS FOR SEX PREDICTING SENSE

OF INADEQUACY

Coefficientsa

51.834 1.558 33.265 .000

-1.393 1.037 -.068 -1.342 .180

(Constant)

sex

Model1

B Std. Error

UnstandardizedCoefficients

Beta

StandardizedCoefficients

t Sig.

Dependent Variable: t8 SENSE OF INADEQUACYa.

Page 16: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

VENN DIAGRAM OF REGRESSION

Ssresidual =

40454.07

Sense of Inadequacy

sex

SSregression = 185.97

R2 = .005

= 185.97

40640.04

Page 17: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Path Diagram for Group Mean Difference

SEXSENSE OF INADEQUACY

-.068

ERROR

1-.005 =

.997

Page 18: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Correlation representation of the two independent groups experiment

r2pb

• t2 =

(1 – r2pb )/ (n-2)

t2

• r2pb =

t2 + n - 2

Page 19: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Correlation representation of the two independent groups experiment

t2

• rpb =

t2 + n - 2

1/2

Page 20: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Test of point biserial=0

• H0: pb = 0

• H1: pb 0

• is equivalent to t-test for difference for two means.

Page 21: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

POINT-BISERIAL CORRELATION

M F

Y

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

X

m

m

Page 22: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

ExampleWillson (1997) studied two groups of college freshman engineering students, one group

having participated in an experimental curriculum while the other was a random sample

of the standard curriculum. One outcome of interest was performance on the Mechanics

Baseline Test, a physics measure (Hestenes & Swackhammer, 1992). The data for the

two groups is shown below. A significance level of .01 was selected for the hypothesis

that the experimental group performed better than the standard curriculum group

(a directional test):

Group Mean SD Sample size

Exper 47 15 75

Std Cur 37 16 50

__________________________________________

t = (47 – 37) / [(74 y 152) + (49 y 162) / (75 + 50 – 2)][1/75 + 1/50]

_______________________________

= (10) / [(16650 + 12554) / (123)][1/75 + 1/50]

= 1.947The t-statistic is compared with the tabled value for a t-statistic with 123 degrees

of freedom at the .01 significance level, 2.358. The observed probability of occurrence

is 1 - 0.97309 = .02691, greater than the intended level of significance. The conclusion was that the experimental curriculum group, while performing better than the standard, did not significantly outperform them.

Page 23: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Confidence interval around d

• d t {{[(n1 –1)s21 + (n2 – 1)s2

2 ] / (n1 + n2 –2)} { 1/n1 + 1/n2}

• Thus, for the example, using the .01 significance level the confidence interval is

1.393 2.588 (1.037)

= 1.393 2.684 = (-1.281, 4.077)

• This includes 0 (zero) so we do not reject the null hypothesis.

Page 24: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Wilcoxon rank sum test for two independent groups.

• While the t-distribution is the randomization distribution of standardized differences of sample means for large sample sizes, for small samples it is not the best procedure for all unknown distributions. If we do not know that the population is normally distributed, a better alternative is the Wilcoxon rank sum test.

Page 25: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Wilcoxon rank sum test for two independent groups.

Ranks

229 202.74 46428.50

165 190.22 31386.50

394

sex1 male

2 female

Total

t8 SENSE OFINADEQUACY

N Mean Rank Sum of Ranks

Test Statisticsb

17691.500

31386.500

-1.081

.280

.281a

.269

.292

.145a

.136

.154

Mann-Whitney U

Wilcoxon W

Z

Asymp. Sig. (2-tailed)

Sig.

Lower Bound

Upper Bound

99% ConfidenceInterval

Monte Carlo Sig.(2-tailed)

Sig.

Lower Bound

Upper Bound

99% ConfidenceInterval

Monte Carlo Sig.(1-tailed)

t8 SENSE OFINADEQUACY

Based on 10000 sampled tables with starting seed 2000000.a.

Grouping Variable: sexb.

Page 26: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Dependent groups experiments

• d = y1 – y2

• for each pair. Now the hypotheses about the new scores becomes

• H0: = 0

• H1: 0

• The sample statistic is simply the sample difference. The standard error of the difference can be computed from the standard deviation of the difference scores divided by n, the number of pairs

Page 27: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Standard deviation of differences in related (dependent) data

• s2(y1-y2) = s2

1 + s22 -2r12s1s2

• Example, s21 = 100, s2

2 = 144, r12=.7

• s2(y1-y2) = 100 + 144 -2(.7)(10)(12)

• = 244 - 168

• = 76

• s(y1-y2) = 8.72

Page 28: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Dependent groups experiments

• _________________

• sd = [s21 + s2

2 –2r12s1s2 ]/n .

• Then the t-statistic is

• _

• t = d / sd

Page 29: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Dependent groups experimentsIn a study of the change in grade point average for a group of college engineering freshmen,

Willson (1997) recorded the following data over two semesters for a physics course:

Variable N Mean Std Dev

PHYS1 128 2.233333 1.191684

PHYS2 128 2.648438 1.200983

Correlation Analysis: r12 = .5517

To test the hypothesis that the grade average changed after the second semester from the first, for a significance level of .01, the dependent samples t-statistic is

________________________________________

t = [2.648 – 2.233]/ [ 1.1922 + 1.2012 – 2 (.5517) x 1.192 x 1.201]/128

= .415 / .1001

= 4.145

This is greater than the tabled t-value t(128-1) = 2.616. Therefore, it was concluded the students averaged higher the second semester than the first.

Page 30: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

VENN DIAGRAM

SSBetween pairs

SSWithin pairs

SSTreatment

SSTreatment*Pair

Design for pairs of persons, each assigned to experimental or control condition

Page 31: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

VENN DIAGRAM

SSBetween Persons

SSWithin Persons

SSTime

SSTime*Person

Time 1 vs. Time 2 comparison of achievement for a group of persons

Page 32: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Nonparametric test of difference in dependent samples.

• sign test. A count of the positive (or negative) difference scores is compared with a binomial sign table. This sign test is identical to deciding if a coin is fair by flipping it n times and counting the number of heads. Within a standard error of .5n1/2 the number should be equal to n/2 .As n becomes large, the distribution of the number of positive difference

scores divided by the standard error is normal.

• An alternative to the sign test is the Wilcoxon signed rank test or symmetry test

Page 33: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

DIFFERENCE BETWEEN SENSE OF INADEQUACY AND ANXIETY IN BASC SAMPLE- NONPARAMETRIC

Ranks

210a 191.12 40135.50

176b 196.34 34555.50

8c

394

Negative Ranks

Positive Ranks

Ties

Total

t8 SENSE OFINADEQUACY - t12 SENSATION SEEKING

N Mean Rank Sum of Ranks

t8 SENSE OF INADEQUACY < t12 SENSATION SEEKINGa.

t8 SENSE OF INADEQUACY > t12 SENSATION SEEKINGb.

t8 SENSE OF INADEQUACY = t12 SENSATION SEEKINGc.

Page 34: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Test Statisticsb,c

-1.272a

.203

.206

.195

.216

.101

.093

.109

Z

Asymp. Sig. (2-tailed)

Sig.

Lower Bound

Upper Bound

99% ConfidenceInterval

Monte Carlo Sig.(2-tailed)

Sig.

Lower Bound

Upper Bound

99% ConfidenceInterval

Monte Carlo Sig.(1-tailed)

t8 SENSE OFINADEQUACY

- t12 SENSATION

SEEKING

Based on positive ranks.a.

Wilcoxon Signed Ranks Testb.

Based on 10000 sampled tables with starting seed 299883525.c.

Page 35: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

Summary of two group experimental tests of hypothesis

• Table below is a compilation of last two chapters:– sample size– one or two groups– normal distribution or not– known or unknown population variance(s)

Page 36: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

One or Independent Normal Hypotheses Population variance Test Statistic Distribution Two or Distribution known?Groups Dependent Assumed?

_One not applicable Yes H0: = a 2 Known y. - a normal

H1: a z = [ 2 /n ]1/2

One not applicable Yes H0: = a 2 unknown y. - a t with n-1 dfH1: a t =

[ s2 /n ]1/2 One not applicable No H0: = a 2 unknown S = R+i , yi > a Wilcoxon rank sum

H1: aor n+ = i+ , i+ =1 if yi > a, 0 else binomial (sign test)

Page 37: Lecture 9 TWO GROUP MEANS TESTS EPSY 640 Texas A&M University

One or Independent Normal Hypotheses Population variance Test Statistic Distribution Two or Distribution known?Groups Dependent Assumed?

_ _Two Independent Yes H0: 0 - 1 = 0 20 =21 = 2 , y0. – y1.

H1: 0 - 1 0 known z = normal[ 2 (1/n0 + 1/n1) ]1/2

_ _Two Independent Yes H0: 0 - 1 = 0 20 =21 , y0. – y1.

H1: 0 - 1 0 unknown t = t with n0 + n1 –2 df [ s2 (1/n0 + 1/n1) ]1/2

s2 = (n0 –1)s20 + (n1 –1)s21 n0 + n1 –2

Two Independent No H0: 0 - 1 = 0 20 =21 , S = R+i Wilcoxon rank sum H1: 0 - 1 0 unknown for one of

the groups _ _

Two Dependent Yes H0: 0 - 1 = 0 20 =21= 2, y0. – y1.H1: 0 - 1 0 Known z = normal

[ 2 2 ( 1 - ) /n ]1/2 = population correlation between y0 and y1 __ __

Two Dependent Yes H0: 0 - 1 = 0 20 =21= 2, y0. – y1. t with n-1 df H1: 0 - 1 0 inknown t =

[ 2 s2 ( 1 - ) /n ]1/2 r = sample correlation

between y0 and y1s2 = s20 + s21 – 2r12s0s1

Two Dependent No H0: 0 - 1 = 0 20 =21= 2 S =R+i Wilcoxon Ranks sum

H1: 0 - 1 0 unknown for positive differences