One Sample and Two Sample T- tests Introduce t test Hypothesis testing using a t test Paired t...

33
One Sample and Two Sample T-tests Introduce t test Hypothesis testing using a t test Paired t test Independent samples t test

Transcript of One Sample and Two Sample T- tests Introduce t test Hypothesis testing using a t test Paired t...

Page 1: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One Sample and Two Sample T-tests Introduce t test Hypothesis testing using a t test Paired t test Independent samples t test

Page 2: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Recap Single score compared to a known

distribution

Sample mean compared to a known sampling distribution (central limit theorem)

z X

X

Xz

Page 3: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Example test of a hypothesis Say the 8:00 stats students average 6.85

hours of sleep on weeknights. UNT Daily reports that students as a whole

average 7.5 hours of sleep per weeknight (standard deviation of 2.5).

Do the stats students get less sleep on average?

Page 4: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Example test of a hypothesis Hypothesis: UNT students average 7.5

hours of sleep (s = 2.5)

Data from stat students: 6.85 65X N

X

Xz

)65/5.2(

5.785.6 z

Page 5: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Example test of a hypothesis Z = -2.10 Consult table: what is the probability of

coming up with a z value of -2.10 (which is just a transformation of our mean of 6.85) or more extreme ?

p = .018

Page 6: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Example test of a hypothesis Another way to phrase our answer is that

the probability of getting a mean of 6.85 or less hours slept when we were expecting 7.7 is .018.

Question: are 8:00am stats students typical in their sleeping habits?

Is their mean sleeping average significantly different than what we’d expect?

Page 7: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Example test of a hypothesis Formally

Ho : μ = 7.7 H1 : μ ≠ 7.7

If the probability of the result is less than some criterion we’ve set up (e.g. p = .10), then we reject the null hypothesis (Ho ), and believe that our sample mean comes from a population with a mean that is different from the hypothesized population mean. The difference between the sample mean ( ) and the

hypothesized population mean (μ) is statistically significant.

Not just due to sampling error

X

Page 8: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One and two-tailed tests There are two ways to state our

alternative hypothesis For example

Ho : μ = 7.7 H1 : μ ≠ 7.7

However, seeing as we were dealing with an 8:00am class, it wouldn’t have seemed unlikely to have expected these folks to sleep less than typical UNT students. In other words Ho : μ = 7.7 H1 : μ < 7.7

Page 9: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One and two-tailed tests In the first case we have a non-directional

hypothesis, also called a two-tailed test We are expecting extreme results that are some

distance greater than or less than the hypothesized population mean (but we’re not sure which)

In the second case we had a directional hypothesis, one-tailed test We expect our result to be greater than the

hypothesized mean Or we expect our result to be greater than the

hypothesized mean We only test one of these two outcomes

Page 10: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One and two-tailed tests What difference does it make? Say I was going to state that any outcome

with a probability of < .05 would be deemed statistically significant

What z-score am I hoping to find for a one-tailed test vs. a two-tailed test in order to claim significance?

Page 11: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One-tailed test

H1: µ < some value H1: µ > some value

Page 12: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Two-tailed test

H1: µ ≠ some value

We don’t know if it’ll be greater than or less than

Page 13: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One and two-tailed tests Note that the critical z-value that we’d need to

reach the .05 level is different for each test. In the one-tailed situation, we only need a z score

of +1.645 or –1.645 (depending on whether we our alternative hypothesis states that the result will be greater than or less than the hypothesized population mean) Gist: Easier to find a result that qualifies as significant

(more statistical power) In the two-tailed situation, we need a z score of

1.96 Tougher

Page 14: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Two-tailed rejection Question: can you claim a directional

result from a two-tailed test?

Page 15: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One and two-tailed tests Why don’t we just do a one-tailed test all

the time? Sometimes we don’t know one way or

another and/or are just looking for a difference of some kind

Even when we have a good idea, our theory could be wrong Cover our ignorance

Page 16: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Limitation to the z-test We need to know (population standard

deviation) to compare things using our normal distribution tables

Most situations we do not know

Page 17: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Solution Remember that the standard deviation has

properties that make it a very good estimate of the population value

We can use our sample standard deviation to estimate the population standard deviation

Page 18: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

T test

Which leads to:

where

and

remember degrees of freedom (n-1)

t X

sX

X

ss

n

1

2

n

XXs

Look familiar?

Page 19: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

t distribution

Gossett, who worked crunching numbers for the Guinness brewing company, had a few too many one day and stumbled upon the t distribution. Having enough wits about him to figure he might regret his actions the next day, he sent off his work to the journal under the pseudonym “Student”.

However the work, like Guinness itself, has stood the test of time as a quality product Student’s t distribution

We need to use a variety of distributions for t depending on df (sample size)

Page 20: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

What’s the difference?

Why a “t” now not a “z”? The difference involves using our

sample standard deviation to estimate the population standard deviation

Standard deviation is positively skewed, and so slightly underestimates the population value. Our standard error part of the formula

will also be smaller than it should, which would lead to a larger value of z than should be X

s

n

Page 21: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

How is t different? Since s likely to be smaller than the

appropriate value of more likely to produce a larger z than if we had used the actual

So instead we use the t-distribution which accounts for this

Because we are trying to estimate , how well s does depends on the sample size

The t-distribution is normal for an infinitely large sample size With larger samples our ‘important’ t-scores will be

close to the ‘important’ z-scores (1.645, 1.96, 2.58)

Page 22: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

What about when n is not large? Most of the time we do not have a very

large n With smaller samples, s is more likely to

underestimate positively skewed sampling distribution of s

As n gets larger and larger the t distribution more closely approximates the normal distribution

Page 23: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

So now that we have something we call a t, how do we know what the critical value of t will be to reject the null hypothesis?

Page 24: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Looking up t distributions Table A.2 in book Use both df and to determine the critical value

I mean, what the heck is alpha?

The alpha level is simply going to be whatever our criterion for statistical significance is going to be Our alpha level is associated with a particular t-value

(critical value) It is also associated with making a type of error (but

we’ll get to that later)

Page 25: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Looking up t distributions Normally if the printout of our results shows the p-value to

be less than some criterion we’ve set up (e.g. .05), we reject the null hypothesis

But I don’t have a printout!

You calculate the t- score. If the t-score is beyond the critical t-value listed in the table that is associated with the .05 or .01 alpha levels (you get to pick your cutoff) for a one or two-tailed test, you reject the null hypothesis

Saves having to write a t-score for every p-value possible like we did for the normal distribution

Note: you would get a p-value from a stats program and should report it More info is better

Page 26: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Important point We will talk more about this later, but

alpha level and the p-value are not the same thing

We are entering dangerous territory!

Page 27: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Comparing t to z When = .05, then z (two tails) = 1.96 What are the comparable values of t with:

1 df, 3 df, 5 df, 15 df, 30 df, 60 df, 120 df?

Note your table: As with the z-test we performed, t-tests can be one-tailed or two

Page 28: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

One vs Two-tailed test

For which is it easier to obtain a ‘significant’ result- .05 one-tailed or .05 two-tailed test?

Page 29: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Previous Example: New version The UNT Daily claims in its recruiting

literature that its students get an average of 8 hours of sleep a night (no s reported)

Collected sleep data from 25 grad students, this sample has a mean of 7.2 hours sleep, s = 1.5

Page 30: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Plug in the numbersFormula

where

t=

= = -2.667

What else do we need to know?

t X

sX

X

ss

n

7.2 8

1.5 / 25

.08

.3

Page 31: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Critical value of t Degrees of freedom (df) = n-1 = 25 - 1 = 24 Critical value at the .05 alpha level

t.05(24) = +2.064 In this situation we are looking for a value greater than

+2.064 or less than –2.064 (a two-tailed test) The t score observed from our data (-2.667) falls

beyond the critical value Therefore p < .05 Conclusion?

Page 32: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Summary of hypothesis testing (or at least one way to go about it)

1) State the research question2) State the null hypothesis, which simply gives

us a value to test, and alternative hypothesis3) Construct a sampling distribution based on the

null hypothesis and locate region of rejection (i.e. find the critical value on your table)

4) Calculate the test statistic (t) and see where it falls along the distribution in relation to the critical value (tcv)

5) Reach a decision and state your conclusion

Page 33: One Sample and Two Sample T- tests  Introduce t test  Hypothesis testing using a t test  Paired t test  Independent samples t test.

Your turn...The average grade from year to year in statistics courses at UNT is an 81. This year the stats students (200 thus far) have an average of 83 w/ s = 10. Is this unusual?tcv = ?p = ?t = ?Conclusion?