student’s t test

26
Student’s t test Student’s t test This test was invented by a This test was invented by a statistician WS Gosset statistician WS Gosset (1867-1937), but preferred (1867-1937), but preferred to keep anonymous so wrote to keep anonymous so wrote under the name “Student”. under the name “Student”.

Upload: stuart-carver

Post on 01-Jan-2016

104 views

Category:

Documents


5 download

DESCRIPTION

Student’s t test. This test was invented by a statistician WS Gosset (1867-1937), but preferred to keep anonymous so wrote under the name “Student”. The t-distribution. William Gosset lived from 1876 to 1937 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Student’s t test

Student’s t testStudent’s t test

This test was invented by a This test was invented by a statistician WS Gosset (1867-statistician WS Gosset (1867-1937), but preferred to keep 1937), but preferred to keep anonymous so wrote under anonymous so wrote under the name “Student”.the name “Student”.

Page 2: Student’s t test

The t-distributionThe t-distribution

William Gosset lived from 1876 to 1937

Gosset invented the t -test to handle small samples for quality control in brewing. He wrote under the name "Student".

Page 3: Student’s t test

t-Statistict-Statistic

ns

xt

/

When the sampled population is normally When the sampled population is normally distributed, the t statistic is Student t distributed, the t statistic is Student t distributed with n-1 degrees of freedom.distributed with n-1 degrees of freedom.

Page 4: Student’s t test

T-testT-test1.1. Test for single meanTest for single mean Whether the sample mean is equal to the predefined

population mean ?

2. Test for difference in means. Test for difference in means Whether the CD4 level of patients taking treatment A is

equal to CD4 level of patients taking treatment B ?

3. Test for paired observationTest for paired observation Whether the treatment conferred any significant benefit ?

Page 5: Student’s t test

T- test for single T- test for single meanmeanThe following are the weight (mg) of each of 20

rats drawn at random from a large stock. Is it likely that the mean weight of these 20 rats are similar to the mean weight ( 24 mg) of the whole stock ?

9 18 21 2614 18 22 2715 19 22 2915 19 24 3016 20 24 32

Page 6: Student’s t test

Steps for test for single meanSteps for test for single mean

1. Questioned to be answered Is the Mean weight of the sample of 20 rats is 24 mg?

N=20, =21.0 mg, sd=5.91 , =24.0 mg

2. Null Hypothesis The mean weight of rats is 24 mg. That is, The

sample mean is equal to population mean.

3. Test statistics --- t (n-1) df

4. Comparison with theoretical value if tab t (n-1) < cal t (n-1) reject Ho, if tab t (n-1) > cal t (n-1) accept Ho,5. Inference

ns

xt

/

x

Page 7: Student’s t test

t –test for single mean t –test for single mean Test statisticsTest statistics

n=20, =21.0 mg, sd=5.91 , n=20, =21.0 mg, sd=5.91 , =24.0 mg=24.0 mg

tt = t = t .05, 19 .05, 19 = 2.093 = 2.093 Accept H Accept H00 if t < 2.093 if t < 2.093Reject HReject H00 if t >= 2.093 if t >= 2.093

x

30.22091.5240.21 ll

t

Inference :Inference :

There is no evidence that the sample is taken There is no evidence that the sample is taken from the population with mean weight of 24 gmfrom the population with mean weight of 24 gm

Page 8: Student’s t test
Page 9: Student’s t test

-1.9

6-1

.96 00

Area = .025Area = .025

Area =.005Area =.005

ZZ

-2.5

75-2

.575

Area = .025Area = .025

Area = .005Area = .005

1.96

1.96

2.57

52.

575

Determining the p-ValueDetermining the p-Value

Page 10: Student’s t test

.95

t0

f(t)

-1.96 1.96

.025

red area = rejection region for 2-sided test

Page 11: Student’s t test

Given below are the 24 hrs total energy Given below are the 24 hrs total energy expenditure (MJ/day) in groups of lean expenditure (MJ/day) in groups of lean and obese women. Examine whether the and obese women. Examine whether the obese women’s mean energy expenditure obese women’s mean energy expenditure is significantly higher ?.is significantly higher ?.

Lean Lean

6.1 7.0 7.56.1 7.0 7.5

7.5 5.5 7.67.5 5.5 7.6

7.9 8.1 8.17.9 8.1 8.1

8.1 8.4 10.28.1 8.4 10.2

10.9 10.9

T-test for difference in means

ObeseObese 8.8 9.2 9.28.8 9.2 9.2 9.7 9.7 10.09.7 9.7 10.0 11.5 11.8 12.811.5 11.8 12.8

Page 12: Student’s t test

T-test for difference in means T-test for difference in means Null HypothesisNull Hypothesis

Obese women’s mean energy expenditure is Obese women’s mean energy expenditure is equal to the lean women’s energy expenditure.equal to the lean women’s energy expenditure.

Test statistics :Test statistics :

t x 1 x 2

1

n1

1

n2

(n1 1)s12 (n2 1)s2

2

n1 n2 2

x x

1, 2 - means of sample 1 and sample 2

1, 2 – sd of sample 1 and sample 2

n1 , n2 – number of study subjects in sample 1 and sample 2

t(n1+n2-t(n1+n2-2) 2)

Page 13: Student’s t test

T-test for difference in meansT-test for difference in meansData SummaryData Summary

lean lean ObeseObese

N 13 9N 13 9

8.10 8.10 10.3010.30

S 1.38 S 1.38 1.251.25

82.3

1325.1

932.1

3.101.822

llt

Inference : The cal t (3.82) is higher than tab t at 0.05, 20. ie 2.086 . This implies that there is a evidence that the mean energy expenditure in obese group is significantly (p<0.05) higher than that of lean group

tab t 9+13-2 =20 df = t 0.05,20 =2.086

x

Page 14: Student’s t test
Page 15: Student’s t test

Two sample t-testTwo sample t-test

Difference between means

Sample size

Variability of data

t-test t t ++

Page 16: Student’s t test

ExampleExampleSuppose we want to test the Suppose we want to test the

effectiveness of a program designed effectiveness of a program designed to increase scores on the to increase scores on the quantitative section of the Graduate quantitative section of the Graduate Record Exam (GRE). We test the Record Exam (GRE). We test the program on a group of 8 students. program on a group of 8 students. Prior to entering the program, each Prior to entering the program, each student takes a practice quantitative student takes a practice quantitative GRE; after completing the program, GRE; after completing the program, each student takes another practice each student takes another practice exam. Based on their performance, exam. Based on their performance, was the program effective?was the program effective?

Page 17: Student’s t test

Each subject contributes 2 scores: Each subject contributes 2 scores: repeated measures designrepeated measures design

Student Before Program After Program

1 520 555

2 490 510

3 600 585

4 620 645

5 580 630

6 560 550

7 610 645

8 480 520

Page 18: Student’s t test

Can represent each student with a Can represent each student with a single score: the difference (D) between single score: the difference (D) between the scoresthe scores

StudentBefore Program After Program

D

1 520 555 35

2 490 510 20

3 600 585 -15

4 620 645 25

5 580 630 50

6 560 550 -10

7 610 645 35

8 480 520 40

Page 19: Student’s t test

Approach: test the effectiveness of Approach: test the effectiveness of program by testing significance of Dprogram by testing significance of D

Null hypothesis: There is no Null hypothesis: There is no difference in the scores of before and difference in the scores of before and after programafter program

Alternative hypothesis: program is Alternative hypothesis: program is effective → scores after program will effective → scores after program will be higher than scores before program be higher than scores before program → average D will be greater than zero→ average D will be greater than zero

HH00: µ: µDD = 0 = 0

HH11: µ: µDD > 0 > 0

Page 20: Student’s t test

StudentBefore

ProgramAfter

Program D D2

1 520 555 35 1225

2 490 510 20 400

3 600 585 -15 225

4 620 645 25 625

5 580 630 50 2500

6 560 550 -10 100

7 610 645 35 1225

8 480 520 40 1600

∑D = 180 ∑D2 = 7900

So, need to know ∑D and ∑D2:

Page 21: Student’s t test

Recall that for single samples:Recall that for single samples:

error standard

mean - score

X

obt s

Xt

For related samples:For related samples:

D

Dobt s

Dt

where:

N

ss D

D and

1

2

2

N

N

DD

sD

Page 22: Student’s t test

45.23

188

1807900

1

22

2

N

N

DD

sD

5.228

180

N

DD

Standard deviation of D:Standard deviation of D:

Mean of D:Mean of D:

Standard error:Standard error:

2908.88

45.23

N

ss D

D

Page 23: Student’s t test

D

Dobt s

Dt

Under H0, µD = 0, so:

714.22908.8

5.22

D

obt s

Dt

From Table B.2: for α = 0.05, one-tailed, with df = 7,

t critical = 1.895

2.714 > 1.895 → reject H0

The program is effective.

Page 24: Student’s t test
Page 25: Student’s t test

t-Valuet-Valuet is a measure of:How difficult is it to believe the null hypothesis?

High t Difficult to believe the null hypothesis -

accept that there is a real difference.

Low t Easy to believe the null hypothesis -

have not proved any difference.

Page 26: Student’s t test

In Conclusion !In Conclusion !

Student ‘s t-test will be used:Student ‘s t-test will be used: --- When Sample size is small--- When Sample size is small and for the following situations:and for the following situations: (1) to compare the single sample (1) to compare the single sample

meanmean with the population meanwith the population mean (2) to compare the sample means of (2) to compare the sample means of two indpendent samplestwo indpendent samples (3) to compare the sample means of (3) to compare the sample means of

paired samples paired samples