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

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

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

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

Using t-tests (related samples)

Statistics for the Social SciencesPsychology 340

Spring 2010

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

PSY 340Statistics for the

Social Sciences t Test for Dependent Means

• Unknown population mean and variance– More realistic, these designs are commonly found in

research,

– Based on having two related groups of observations• Two situations

– One sample, two scores for each person

» Repeated measures design

– Two samples, but individuals in the samples are related

» Related samples, Dependent samples, matched samples

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

PSY 340Statistics for the

Social Sciences

Statistical analysis follows design

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

– Two scores per subject

t =D−μD

sD

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

PSY 340Statistics for the

Social Sciences

participants Pre-test Post-test TestTest

2-levels, All of the participants are in both levels of the IV

levelslevels

Sometimes called “repeated measures” design

Within-Groups Factor

Memory patients before getting the treatment

Memory patients after getting the treatment

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

PSY 340Statistics for the

Social Sciences

Statistical analysis follows design

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

– Two scores per subject

– 2 samples

– Scores are related

- OR -

t =D−μD

sD

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

PSY 340Statistics for the

Social Sciences Matching groups

Group A Group B• Matched groups

– Trying to create equivalent groups

– Also trying to reduce some of the overall variability

• Eliminating variability from the variables that you matched people on

RedShort21yrs

Bluetall

23yrs

Greenaverage22yrs

Browntall

22yrs

ColorHeight

Age

matchedRedShort21yrs

matched Bluetall

23yrs

matchedGreenaverage22yrs

matchedBrown

tall22yrs

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

PSY 340Statistics for the

Social Sciences Testing Hypotheses

– Step 1: State your hypotheses

– Step 2: Set your decision criteria

– Step 3: Collect your data

– Step 4: Compute your test statistics • Compute your estimated standard error

• Compute your t-statistic

• Compute your degrees of freedom

– Step 5: Make a decision about your null hypothesis

• Hypothesis testing: a five step program

Very similar to one sample t-test from earlier

t =D−μD

sD

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

PSY 340Statistics for the

Social Sciences Performing your statistical test

• What are we doing when we test the hypotheses?– Computing a test statistic: Generic test

test statistic =observed difference

difference expected by chance

Could be difference between a sample and a population, or between different samples

Based on standard error or an estimate of the standard error

Compares the differences between groups of related observations to the difference expected by the null hypothesis

Because the groups of observations come from same individuals or matched individuals, the variability is typically reduced

t =D−μD

sD

Page 9: Using t-tests (related 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

sD

=sD

nD

Diff. Expected by chance

Estimated standard error of the differences

df = nD −1

Test statistic

t =D − μ

D

sD

What are all of these “D’s” referring to?

Mean of the differences

Number of difference scores

• Difference scores

– For each person, subtract one score from the other

– Carry out hypothesis testing with the difference scores

• H0 Population of difference scores has a mean = 0

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

PSY 340Statistics for the

Social Sciences Comparing t-tests

test statistic =observed difference

difference expected by chance

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

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t

Observed (sample) means

Related samples t

t =D − μ

D

sD

Difference between Observed (sample) means

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

PSY 340Statistics for the

Social Sciences Comparing t-tests

test statistic =observed difference

difference expected by chance

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

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t Related samples t

t =D − μ

D

sD

Hypothesized population means• from the Null hypothesis

Hypothesized difference betweenPopulation means

• from the Null hypothesis

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

PSY 340Statistics for the

Social Sciences Comparing t-tests

test statistic =observed difference

difference expected by chance

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

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t Related samples t

t =D − μ

D

sD

Hypothesized difference betweenPopulation means

• from the Null hypothesisH0: Memory performance by the treatment group is equal to memory

performance by the no treatment group.

So: (μA −μB) =0

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

PSY 340Statistics for the

Social Sciences Comparing t-tests

test statistic =observed difference

difference expected by chance

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

sX A −X B

t =X − μ

X

sX

One-sample tIndependent-samples t Related samples t

t =D − μ

D

sD

Hypothesized difference betweenPopulation means

• from the Null hypothesisH0: Memory performance by the treatment group is equal to memory

performance by the no treatment group.

So: (μA −μB) =0

Hypothesized population means• from the Null hypothesis

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

sX A −X B

t =D−μD

sD

The numerator’s of both the independent samples and related samples t-tests are numerically identical. I’ve used notational differences to illustrate that one is based on two sets of observations (from the two samples), while the other is based on difference scores.

= 0= 0

Is equal to

The major difference between the two tests comes from how the estimated standard errors are computed.

Page 14: Using t-tests (related 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

What are all of these “D’s” referring to?

Differencescores

2

65

9

22 €

t =D − μ

D

sD

Person Pre-test Post-test

1

23

4

45

5540

60

43

4935

51

(Pre-test) - (Post-test)

H0: There is no difference between pre-test and post-test

HA: There is a difference between pre-test and post-test

μD = 0

μD ≠ 0

Page 15: Using t-tests (related 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

What are all of these “D’s” referring to?

Differencescores

2

65

9

22= 5.5

t =D − μ

D

sD

Person Pre-test Post-test

1

23

4

45

5540

60

43

4935

51

nD = 4

(Pre-test) - (Post-test)

D∑nD

=D

Page 16: Using t-tests (related 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

What are all of these “D’s” referring to?

Person Pre-test Post-testDifferencescores

1

23

4

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD D

D

s

μ−=

5.5

nD = 4

Page 17: Using t-tests (related 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

What are all of these “D’s” referring to?

PersonDifference

scores

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

sD

=sD

nD

t =D − μ

D

sD

-3.5- 5.5 =

0.5- 5.5 =-0.5- 5.5 =

3.5- 5.5 =

12.25

0.250.25

12.25

25 = SSD

D - D (D - D)2

sD =SSD

nD −19.2

14

25=

−=

D

D

s

μ−=

5.5

nD = 4

Page 18: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

sD

=sD

nD

t =D − μ

D

sD

25 = SSD

(D - D)2

sD =SSD

nD −19.2

14

25=

−=

D

D

s

μ−=

5.5 -3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

Page 19: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

sD

=sD

nD

45.14

9.2==

2.9 = sD

D

D

s

μ−=

5.5 -3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

Page 20: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

2.9 = sD

45.1

5.5 Dμ−=

1.45 = sD

?Think back to the null hypotheses

-3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

Page 21: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

2.9 = sD

45.1

5.5 Dμ−=

1.45 = sD

H0: Memory performance at the post-test are equal to memory performance at the pre-test.

μD

= 0

-3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

Page 22: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

2.9 = sD

45.1

05.5 −=

1.45 = sD

8.3=This is our tobs

-3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

Page 23: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

2.9 = sD

45.1

05.5 −=

1.45 = sD

8.3=tobs

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.011 3.078 6.314 12.706 31.821 63.6572 1.886 2.920 4.303 6.965 9.9253 1.638 2.353 3.182 4.541 5.8414 1.533 2.132 2.776 3.747 4.604

α= 0.05 Two-tailed tcrit

df = nD −1

=±3.18

-3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

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

PSY 340Statistics for the

Social Sciences

+3.18 = tcrit

- Reject H0

Performing your statistical test

test statistic =observed difference

difference expected by chance

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

2.9 = sD

45.1

05.5 −=

1.45 = sD

8.3=tobsα= 0.05 Two-tailed tcrit

df = nD −1

=±3.18

-3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4 tobs=3.8

Page 25: Using t-tests (related 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

What are all of these “D’s” referring to?

Person

1

23

4

Pre-test Post-test

45

5540

60

43

4935

51

2

65

9

22D = 5.5

t =D − μ

D

sD

25 = SSD

(D - D)2

2.9 = sD

45.1

05.5 −=

1.45 = sD

8.3=tobsα= 0.05 Two-tailed tcrit

df = nD −1

=±3.18

Tobs > tcrit so we reject the H0

-3.5

0.5-0.5

3.5

D - DDifference

scores

12.25

0.250.25

12.25

nD = 4

Page 26: Using t-tests (related 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€

sD

=sD

nD

t =D−μD

sD

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

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

PSY 340Statistics for the

Social Sciences

Effect Sizes & Power for t Test for Dependent Means

d =μ1 −μ2

σD

estimated d =D−0sD

Remember we don’t know these

7-11

Page 28: Using t-tests (related 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)

• Using Power and effect sizes to determine how many participants you need

7-12

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

PSY 340Statistics for the

Social Sciences Using SPSS: Related samples t

• Entering the data– Different groups of observations go

into separate columns• e.g., pre-test in one column, post-test in a

separate column

Person Pre-test Post-test

1

23

4

45

5540

60

43

4935

51

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

– Identify which columns are the related samples of obs

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

computed-t, degrees of freedom, p-value (Sig.)