+ All Categories
Home > Documents > Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last...

Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last...

Date post: 12-Jan-2016
Category:
Upload: aleesha-rice
View: 214 times
Download: 0 times
Share this document with a friend
Popular Tags:
62
Student’s t-test
Transcript
Page 1: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Student’s t-test

Page 2: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

The Truth Ho is true Ho is false

Ho is

rejected

Type I Error

No Error

W

hat

your

dat

a sa

y

Ho is not rejected

No Error

Type II Error

This will happen occasionally, just due to chance.

5% of the time, α

From Last Week

Page 3: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

The Truth Ho is true Ho is false

Ho is

rejected

Type I Error

No Error

W

hat

your

dat

a sa

y

Ho is not rejected

No Error

Type II Error

This will happen occasionally, just due to chance.

Rate traditionally not specified, β

Page 4: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

The Truth Ho is true Ho is false

Ho is

rejected

Type I Error

No Error

W

hat

your

dat

a sa

y

Ho is not rejected

No Error

Type II Error

Power, 1-β

Page 5: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

The Truth Ho is true Ho is false

Ho is

rejected

Type I Error

No Error

W

hat

your

dat

a sa

y

Ho is not rejected

No Error

Type II Error

Significance level1-α

Page 6: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

To calculate Z ,..

• we need to know 3 things:

1. Sample mean

2. Population or Hypothesized mean

3. Standard Error of the mean

ZX

X

Page 7: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

…and where do we get those values?

1. Sample mean - calculate from your sample

2. Hypothesized mean - specify based on your research question

3. Standard Error of the mean - typically don’t have, so must calculate the sample standard deviation of the mean, or standard error.

Page 8: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

nX

2

n

ssX

2

We know how to calculate …

Population standard error

Sample standard error is the same

Page 9: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Xs

XZ

Xs X

So now, …

• Calculate Z as:

• But is a poor estimator of

• Requires HUGE sample size to be unbiased.

Page 10: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Xs

XZ

Xs

Xt

The solution ???

• Toss Z!!

Page 11: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

I said ….

• is a poor estimator of

• Also, as sample size :

Xs X

Xs X

Page 12: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

The consequences of this are:

• For every n, there is a unique distribution of t.

• As n approaches infinity, the t-distribution becomes more and more like the Z-distribution.

Page 13: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

= 1

= 3

=

Degrees of Freedom () influence the shape of the t-distribution.

= n-1

Page 14: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

0.025 0.025

Z

1.96-1.96 0

Critical Z’s …

Page 15: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

0.025 0.025

t

0

Critical t’s …

? ?

Page 16: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

0.025 0.025

t4.303-4.303 0

= 2

0.025 0.025

t

2.064-2.064 0

= 24

Critical t’s …

Page 17: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

T-table from Samuels and Witmer

Page 18: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Hypothesis testing using t

• Calculating t and comparing it to t from a table

– if |tobserved| < tcritical; do not reject H0

– if |tobserved| tcritical; reject H0

• Calculating t and finding the probability of …

– p(t observed value) = ...

Alpha = 0.05

Alpha = 0.05

Page 19: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Alpha = 0.05

• In a 2-tail test2-tail test with = 9, our critical value of t is: 2.262

• We would write this as:

– t0.05(2), 9 = 2.262

0.025 0.025

t2.262-2.262 0

= 9

Page 20: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Alpha = 0.05

• In a 2-tail test2-tail test with = 24, our critical value of t is: 2.064

• We would write this as:

– t0.05(2), 24 = 2.064

0.025 0.025

t2.064-2.064 0

= 24

Page 21: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Crabs held at 24.3 oC.

25.8 27.324.6 24.026.1 24.522.9 23.925.1 26.224.3 24.824.6 23.523.3 26.325.5 25.428.1 25.523.9 27.024.8 22.925.4

Ho: = 24.3 oC

HA: 24.3 oC

= 0.05n = 25 ( = 24)

Xs

Xt

Critical t

t

_

.. ( )0 05 2 24 2 064

Page 22: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Crabs held at 24.3 oC.

25.8 27.324.6 24.026.1 24.522.9 23.925.1 26.224.3 24.824.6 23.523.3 26.325.5 25.428.1 25.523.9 27.024.8 22.925.4

Xs

Xt

X

s

sX

25 03

180

180

250 27

2

.

.

..

Page 23: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Crabs held at 24.3 oC.

tX

sobs

X

25 03 24 3

0 272 704

. .

..

064.2

_

24)2(05.0 t

tCritical

criticalobserved tt ||

Therefore, reject Ho, the sample likely came from a population having a mean that is not 24.3oC.

Page 24: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

In the last example...

• We asked “Is there a difference?”– 2-tailed test2-tailed test

• We can also ask “Is it BIGGER or smaller than some hypothesized value– 1-tailed test1-tailed test

Page 25: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Atkins Mice

• To test the Atkins diet you put a set of mice on a low carb food regime

• If it works, all mice should lose weight

– weight gain on diet should be negative, <0

Page 26: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Atkins mice

0.2-0.5-1.3-1.6-0.7 0.4-0.1 0.0-0.6-1.1-1.2-0.8

Ho: 0

HA: < 0

= 0.05n = 12 ( = 11)

X

s

sX

0 61

0 4008

0 4008

12018

2

.

.

..

Page 27: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Atkins mice

389.318.0

61.0

X

obs s

Xt

796.1

_

11)1(05.0 t

tCritical

Therefore, reject Ho, likely does not come from a population ….

Page 28: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Confidence Limits

• When we set = 0.05,

• if we have a population with mean

• we expect that 5% of all samples drawn randomly from the population, will produce t values that are – larger than t0.05(2),

– smaller than - t0.05(2),

– leaving 95% of the remaining samples to have means that yield t’s between - t0.05(2), and t0.05(2),

Page 29: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

-tX

st

X

0 05 2 0 05 2. ( ), . ( ),

The probability of is 95%.

Confidence Limits

• 95% of all sample means should produce t’s that lie between

• - t0.05(2), and t0.05(2),.

Page 30: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

-tX

st

X

0 05 2 0 05 2. ( ), . ( ),

-t s X t sX X0 05 2 0 05 2. ( ), . ( ),* *

X - t s X t sX X0 05 2 0 05 2. ( ), . ( ),* *

A little math magic ...

Page 31: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

X t s X t sX X- 0 05 2 0 05 2. ( ), . ( ),* *

95% probability that the interval includes

“95% confidence interval”

Lower confidence limit

Upper confidence limit

Page 32: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

XstXCI *%95 ),2(05.0

XX stXCIstX *%95*- ),2(05.0),2(05.0

More magic …

Page 33: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Crabs held at 24.3 oC

25.8 27.324.6 24.026.1 24.522.9 23.925.1 26.224.3 24.824.6 23.523.3 26.325.5 25.428.1 25.523.9 27.024.8 22.925.4

0642242050 .)(. t

XstXCI *%95 ),2(05.0

X

s

sX

25 03

180

180

250 27

2

.

.

..

27.0*064.203.25%95 CI

56.003.25%95 CI

59.2556.059.25%95 CIUpper

47.2456.003.25%95 CILower

Page 34: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

25.5924.47

95% confident that the population mean lies between these values

24.3

95% Confidence interval

• Does not include the hypothesized μ

Page 35: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

XstXCI *%95 ),2(05.0

n

ssX As this gets bigger,

this gets smaller.

The Magnitude of Confidence Limits

• is Influenced by Sample Size

Page 36: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

For examplePopulationN=1000=25=1

Draw random samples of:n=100n=50n=25n=10

from the population.

n Mean 95% CI Lower Upper100 24.84079 0.1816 24.65918 25.0223950 24.91241 0.31996 24.59245 25.2323725 24.86719 0.40142 24.46577 25.2686110 25.16212 0.859 24.30312 26.02112

The Magnitude of Confidence Limits …

Page 37: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

So far, we’ve looked at …

• One sample tests,

• Z and t

• comparing a sample to some specified value.

Page 38: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Hypotheses:

2-tailedHo: A = B

HA: A B

1-tailedHo: A B

HA: A < B

Ho: A B

HA: A > B

or

Two-sample t-test

• testing for differences between two means.

Page 39: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Basically, what we want

• To know is, “ Is it likely that two samples were drawn from the same population? Or is it likely that they were drawn from two different populations?

Page 40: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.
Page 41: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Xs

Xt

Calculating t for a 2-sample testCalculating t for a 2-sample test

• Recall that

Page 42: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Ho: A = B

HA: A B

Ho: A - B = 0

HA: A - B 0

BA XX

BA

s

XXt

Standard error of the difference between the means

Page 43: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

B

p

A

pXX n

s

n

ss

BA

22

BA

BAp

SSSSs

2

Page 44: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Hypotheses:

2-tailed

Ho: A = B (A-B= 0)

HA: A B (A-B 0)

1-tailedHo: A B (A-B 0)

HA: A < B (A-B<0)

Ho: A B (A-B 0)

HA: A > B (A-B>0)

),2(05.0ttobserved

),2(05.0ttobserved

),2(05.0ttobserved

Reject Ho

if

if

Reject Ho

Reject Ho

if

Page 45: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

BAXX n

s

n

ss pp

BA

22

BA

BA SSSSsp

2

Page 46: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

blood clotting times in humans given two experimental drugs.

Drug B8.88.47.98.79.19.6

Drug G9.99.0

11.19.68.7

10.49.5

Page 47: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Scatterplot (sumofsq.STA 10v*25c)

Drug Treatment

Clo

ttin

g T

ime

(M

inu

tes)

7.5

8.0

8.5

9.0

9.5

10.0

10.5

11.0

11.5

Drug B Drug G

Page 48: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Drug B8.88.47.98.79.19.6

Drug G9.99.0

11.19.68.7

10.49.5

Ho: DrugB = DrugG

HA: DrugB DrugG

DrugGDrugB XX

DrugGDrugB

s

XXt

What do we need?Xbar for each drugSS for each drugPooled varianceStdErr of Diff b/w Means

Page 49: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

TimeB

SSDrugBSSDrugG

Mean Mean

8.8 0.0025 9.9 0.02568.4 0.1225 9 0.54767.9 0.7225 11.1 1.84968.7 0.0025 9.6 0.01969.1 0.1225 8.7 1.08169.6 0.7225 10.4 0.4356

52.5 1.695 9.5 0.057668.2 4.0172

n=6 n=78.75 9.742857

TimeG(Xi-8.75) (Xi-9.74)

Page 50: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Pooled Variance,

DrugGDrugB

DrugGDrugBp

SSSSs

2

5193.011

7121.5

65

0172.4695.12

ps

Page 51: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Standard Error of the Difference Between the Means:

DrugGDrugBXX n

s

n

ss pp

DrugGDrugB

22

40.0

1608.00742.00866.0

7

5193.0

6

5193.0

DrugGDrugB XXs

Page 52: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Drug B8.88.47.98.79.19.6

Drug G9.99.0

11.19.68.7

10.49.5

Ho: DrugB = DrugG

HA: DrugB DrugG

475.24.0

74.975.8

DrugGDrugB XX

DrugGDrugB

s

XXt

Page 53: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

475.2observedt

?),2( ttcirtical

What value do we use fordegrees of freedom?

Our total degrees of freedom = sum of degrees of freedom for each drug.

DrugGDrugB

Page 54: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

201.211),2(05.0),2( tttcirtical

11),2(05.0201.2475.2 ttobserved

Therefore, reject Ho, there is a difference between the means.

Page 55: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Drug B8.88.47.98.79.19.6

Drug G9.99.0

11.19.68.7

10.49.5

Ho: DrugB = DrugG

HA: DrugB DrugG

475.24.0

74.975.8

DrugGDrugB XX

DrugGDrugB

s

XXt

201.211),2(05.0),2( tttcirtical

2 Sample, 2 tail t-test

11),2(05.0201.2475.2 ttobserved --> Reject Ho

Page 56: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

2 Sample, 1 tail t-test

Testing the prediction that dietary supplements increase growthrate in lab mice.

Control Group175132218151200219234149

Treatment Group142311337262302195253199

Ho: treatment control

HA: treatment > control

Page 57: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

397.2

controltreatment XX

controltreatment

s

XXt

761.114),1(05.0 ttcirtical

Reject Ho, dietary supplements increased growth rate

Page 58: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Paired sample t-test --> examine the difference between means that are not drawn from independent samples

--> often used in before and after experiments

The 2-sample tests that we have looked at assumes that the 2 samples are independent

Page 59: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Before366044

119355177

After457346124335783

Effects of Monoxodil on density of active hair follicles

Guy#1234567

What we are interested in is: Has there been an appreciable differencedifference within the pairing?

Page 60: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Before366044

119355177

After457346124335783

Effects of Monoxodil on density of active hair follicles

Guy#1234567

The first step is to calculate the difference between the after and before.

After-Before9

1325-266

Ho: before - after= 0

HA: before - after 0

Ho: difference = 0

HA: difference 0

or

(looks a lot like a one sample test)

Page 61: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Before366044

119355177

After457348124335783

Guy#1234567

After-Before9

1345-266

57.57

39

n

diffsX difference

08.381.1

57.5

differenceX

difference

s

Xt

447.26),2(05.0 ttcirtical

Reject Ho

Standard error of the mean difference

Page 62: Student’s t-test. This will happen occasionally, just due to chance. 5% of the time, α From Last Week.

Before366044

119355177

After457348124335783

Guy#1234567

After-Before9

1345-266

943.16),1(05.0 ttcirtical

We could have set this up as a 1-tail test as well.

Ho: difference 0

HA: difference > 0

Reject Ho

08.381.1

57.5

differenceX

difference

s

Xt


Recommended