Top Banner
Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010
23

Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

Apr 01, 2015

Download

Documents

Halle Artis
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

Using t-tests (independent samples)

Statistics for the Social SciencesPsychology 340

Spring 2010

Page 2: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences

Statistical analysis follows design

• The one-sample t-test can be used when:– 1 sample

– One score per subject

– Population mean (μ) is known

– but Population standard deviation (σ) is NOT known

t =X − μ

X

sX

Page 3: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Independent samples

• What are we doing when we test the hypotheses?– Consider a new variation of our memory experiment example

Memory treatment

Memory patients Memory

Test

• the memory treatment sample are the same as those in the population of memory patients.• they aren’t the same as those in the population of memory patients

H0:

HA:

Memory placebo

MemoryTest

Compare these two means

XA

XB

Page 4: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences

Statistical analysis follows design

• The independent samples t-test can be used when:

– 2 samples

– Samples are independent

t =(X A − X B ) − (μA − μB )

sX A −X B

Page 5: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

test statistic =observed difference

difference expected by chance

Test statistic

t =(X A − X B ) − (μA − μB )

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t

Observed (sample) means

Page 6: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

test statistic =observed difference

difference expected by chance

Test statistic

t =(X A − X B ) − (μA − μB )

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t

Hypothesized population means• from the Null hypothesis

Page 7: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

test statistic =observed difference

difference expected by chance

Test statistic

t =(X A − X B ) − (μA − μB )

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t

Hypothesized population means• from the Null hypothesis

H0: Memory performance by the treatment group is equal to memory performance by the no treatment group.

So: (μA −μB) =0

Page 8: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

test statistic =observed difference

difference expected by chance

Test statistic

t =X − μ

X

sX

One-sample t

t =(X A − X B ) − (μA − μB )

sX A −X B

Estimated standard error(difference expected by chance)

estimate is based on one sample

We have two samples, so the estimate is based

on two samples

The Estimate of the Standard Error is based on the variability of both

samples

Page 9: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

sX A −X B

=sp

2

nA

+sp

2

nB

“pooled variance”We combine the

variance from the two samples

Number of subjects in group A

Number of subjects in group B

Page 10: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences

s2 =SS

n−1variance

Performing your statistical test

sX A −X B

=sp

2

nA

+sp

2

nB

“pooled variance”We combine the

variance from the two samples

Recall “weighted means,” need to use

“weighted variances” here

sp2 =

SSA + SSB

dfA + dfB

sp2 =

sA2dfA( ) + sB

2dfB( )dfA +dfB

dfA =(nA −1)dfB =(nB −1)

Variance (s2) * degrees of freedom (df)

s2 (n −1) =SS

s2df =SS

Page 11: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

sX A −X B

=sp

2

nA

+sp

2

nB

df = nA + nB − 2

t =(X A − X B ) − (μA − μB )

sX A −X B

=(nA −1) + (nB −1)

sp2 =

SSA + SSB

dfA + dfB

Independent-samples t• Compute your estimated standard error

sp2 =

sA2dfA( ) + sB

2dfB( )dfA +dfB

• Compute your t-statistic

• Compute your degrees of freedom

dfA =(nA −1)dfB =(nB −1)This is the one you use

to look up your tcrit

Page 12: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

Exp.

groupControl group

45

5540

60

43

4935

51

Need to compute the mean and variability for each sample

Dr. Mnemonic develops a new treatment for patients with a memory disorder. He isn’t certain what impact, if any, it will have. To test it he randomly assigns 8 patients to one of two samples. He then gives one sample the new treatment but not the other. Following the treatment period he gives both groups a memory test. The data are presented below. Use α = 0.05.

Page 13: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

Exp.

groupControl group

45

5540

60

43

4935

51

Need to compute the mean and variability for each sample

Control group

= 50

(45-50)2 + (55-50)2 + (40-50)2 + (60-50)2

= 250

SS =A

Dr. Mnemonic develops a new treatment for patients with a memory disorder. He isn’t certain what impact, if any, it will have. To test it he randomly assigns 8 patients to one of two samples. He then gives one sample the new treatment but not the other. Following the treatment period he gives both groups a memory test. The data are presented below. Use α = 0.05.

XA =45 + 55 + 40 + 60

4

XA =50SSA =250

Page 14: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

Exp. group

(43-44.5)2 + (49- 44.5)2 + (35- 44.5)2 + (51- 44.5)2

= 155

SS =B

Exp.

groupControl group

45

5540

60

43

4935

51

Need to compute the mean and variability for each sample

Dr. Mnemonic develops a new treatment for patients with a memory disorder. He isn’t certain what impact, if any, it will have. To test it he randomly assigns 8 patients to one of two samples. He then gives one sample the new treatment but not the other. Following the treatment period he gives both groups a memory test. The data are presented below. Use α = 0.05.

XB =43+ 49 + 35 + 51

4

XA =50SSA =250

XB =44.5SSB =155

= 44.5

Page 15: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

sX A −X B

=sp

2

nA

+sp

2

nB

t =(X A − X B ) − (μA − μB )

sX A −X B

sp2 =

SSA + SSB

dfA + dfB

=250 +155

3+ 3= 67.5€

=67.5

4+

67.5

4= 5.81€

=(50 − 44.5) − (0)

5.81

dfA = (nA −1)

dfB = (nB −1)

Exp.

groupControl group

45

5540

60

43

4935

51XA =50

SSA =250XB =44.5

SSB =155

Dr. Mnemonic develops a new treatment for patients with a memory disorder. He isn’t certain what impact, if any, it will have. To test it he randomly assigns 8 patients to one of two samples. He then gives one sample the new treatment but not the other. Following the treatment period he gives both groups a memory test. The data are presented below. Use α = 0.05.

= 0.95

Page 16: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

Tobs= 0.95Tcrit= ±2.447

sX A −X B

= 5.81

sp2 = 67.5

Proportion in one tail0.10 0.05 0.025 0.01 0.005

Proportion in two tailsdf 0.20 0.10 0.05 0.02 0.01: : : : : :5 1,476 2.015 2.571 3.365 4.0326 1.440 1.943 2.447 3.143 3.707: : : : : :

df = nA + nB − 2 = 6

α = 0.05 Two-tailed

Exp.

groupControl group

45

5540

60

43

4935

51

Dr. Mnemonic develops a new treatment for patients with a memory disorder. He isn’t certain what impact, if any, it will have. To test it he randomly assigns 8 patients to one of two samples. He then gives one sample the new treatment but not the other. Following the treatment period he gives both groups a memory test. The data are presented below. Use α = 0.05.

t =(X A − X B ) − (μA − μB )

sX A −X B

=(50 − 44.5) − (0)

5.81

dfA = (nA −1)

dfB = (nB −1)

XA =50SSA =250

XB =44.5SSB =155

= 0.95

Page 17: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Performing your statistical test

Tobs= 0.95α = 0.05 Two-tailed Tcrit= ±2.447

Exp.

groupControl group

45

5540

60

43

4935

51

sX A −X B

= 5.81

sp2 = 67.5

df = nA + nB − 2 = 6

Dr. Mnemonic develops a new treatment for patients with a memory disorder. He isn’t certain what impact, if any, it will have. To test it he randomly assigns 8 patients to one of two samples. He then gives one sample the new treatment but not the other. Following the treatment period he gives both groups a memory test. The data are presented below. Use α = 0.05.

t =(X A − X B ) − (μA − μB )

sX A −X B

=(50 − 44.5) − (0)

5.81

dfA = (nA −1)

dfB = (nB −1)

XA =50SSA =250

XB =44.5SSB =155

+2.45 = tcrit

- Fail to Reject H0

tobs=0.95

= 0.95

Page 18: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Assumptions: Independent samples t

• Each of the population distributions follows a normal curve (this is an assumption of all t-tests)– T-tests are fairly ‘robust’ against this assumption

• This means that the results generally still hold even if this assumption is violated

• Homogeneity of variance: The two populations have the same variance– SPSS tests this using Levene’s Test

• Two rows in the SPSS output– Us the top row if the p-value for the Levene’s test is greater than 0.05– Use the bottom row if the p-value for the Levene’s test is less than 0.05

• Tests the Null hypothesis that the two groups have equal variances

Page 19: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social SciencesEffect Size for the t Test for Independent Means

• Estimated effect size after a completed study

Estimated d =X1 −X2

sPooled

“pooled standard deviation”

not “pooled variance,” so take the square root of sP2

Page 20: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences

Power for the t Test for Independent Means (.05 significance level)

8-4

Page 21: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences

Approximate Sample Size Needed for 80% Power (.05 significance level)

Page 22: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Statistical Tests Summary

Design Statistical test (Estimated) Standard error

t =(XA −XB)−(μA −μB)

sXA −XB

sXA −XB=

sP2

nA

+sP2

nB

sX =sn

t =X−μX

sX

zX =X−μX

σ X

σ X =σ

nOne sample, σ known

One sample, σ unknown

Two related samples, σ unknown

Two independent samples, σ unknown €

sD

=sD

nD

t =D−μD

sD

Next time

Page 23: Using t-tests (independent samples) Statistics for the Social Sciences Psychology 340 Spring 2010.

PSY 340Statistics for the

Social Sciences Using SPSS: Independent samples t

• Entering the data– Different groups of observations go into

SAME column• e.g., Exp grp and control grp in a single

column

Person Cntrl-grp Exp-grp

1

23

4

45

5540

60

43

4935

51

• Performing the analysis– Analyze -> Compare means -> independent samples t-test

– Identify which columns have the observations (test variable) and which column has the group membership defined (grouping variable)

– Define groups: what numbers correspond to the two groups?

• Reading the output– Means of the different groups, the mean difference, the computed-t,

degrees of freedom, p-value (Sig.), Levene’s test

– Separate column defines the group membership for each observation– e.g., exp grp = 0, control grp = 1