35
The one sample t-test November 14, 2006

The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

  • View
    216

  • Download
    2

Embed Size (px)

Citation preview

Page 1: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The one sample t-test

November 14, 2006

Page 2: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

From Z to t…

• In a Z test, you compare your sample to a known population, with a known mean and standard deviation.

• In real research practice, you often compare two or more groups of scores to each other, without any direct information about populations.– Nothing is known about the populations that the

samples are supposed to come from.

Page 3: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample

• The single sample t test is used to compare a single sample to a population with a known mean but an unknown variance.

• The formula for the t statistic is similar in structure to the Z, except that the t statistic uses estimated standard error.

Page 4: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

From Z to t…

1

)( 2

n

XXs

n

ssX

X

hyp

s

Xt

X

hypXZ

nX

N

X 2)(

Note lowercas

e “s”.

)1(

)( 22

nn

XXns

2

22 )(

N

XXN

Page 5: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Degrees of Freedom

• The number you divide by (the number of scores minus 1) to get the estimated population variance is called the degrees of freedom.

• The degrees of freedom is the number of scores in a sample that are “free to vary”.

Page 6: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Degrees of Freedom

• Imagine a very simple situation in which the individual scores that make up a distribution are 3, 4, 5, 6, and 7.

• If you are asked to tell what the first score is without having seen it, the best you could do is a wild guess, because the first score could be any number.

• If you are told the first score (3) and then asked to give the second, it too could be any number.

Page 7: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Degrees of Freedom

• The same is true of the third and fourth scores – each of them has complete “freedom” to vary.

• But if you know those first four scores (3, 4, 5, and 6) and you know the mean of the distribution (5), then the last score can only be 7.

• If, instead of the mean and 3, 4, 5, and 6, you were given the mean and 3, 5, 6, and 7, the missing score could only be 4.

Page 8: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Distribution

• In the Z test, you learned that when the population distribution follows a normal curve, the shape of the distribution of means will also be a normal curve.

• However, this changes when you do hypothesis testing with an estimated population variance.– Since our estimate of is based on our sample…– And from sample to sample, our estimate of will

change, or vary…– There is variation in our estimate of , and more

variation in the t distribution.

Page 9: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Distribution

• Just how much the t distribution differs from the normal curve depends on the degrees of freedom.

• The t distribution differs most from the normal curve when the degrees of freedom are low (because the estimate of the population variance is based on a very small sample).

• Most notably, when degrees of freedom is small, extremely large t ratios (either positive or negative) make up a larger-than-normal part of the distribution of samples.

Page 10: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Distribution

• This slight difference in shape affects how extreme a score you need to reject the null hypothesis.

• As always, to reject the null hypothesis, your sample mean has to be in an extreme section of the comparison distribution of means.

Page 11: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Distribution

• However, if the distribution has more of its means in the tails than a normal curve would have, then the point where the rejection region begins has to be further out on the comparison distribution.

• Thus, it takes a slightly more extreme sample mean to get a significant result when using a t distribution than when using a normal curve.

Page 12: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Distribution

• For example, using the normal curve, 1.96 is the cut-off for a two-tailed test at the .05 level of significance.

• On a t distribution with 3 degrees of freedom (a sample size of 4), the cutoff is 3.18 for a two-tailed test at the .05 level of significance.

• If your estimate is based on a larger sample of 7, the cutoff is 2.45, a critical score closer to that for the normal curve.

Page 13: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Distribution

• If your sample size is infinite, the t distribution is the same as the normal curve.

Page 14: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

• Since it takes into account the changing shape of the distribution as n increases, there is a separate curve for each sample size (or degrees of freedom).

• However, there is not enough space in the table to put all of the different probabilities corresponding to each possible t score.

• The t table lists commonly used critical regions (at popular alpha levels).

Page 15: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

• If your study has degrees of freedom that do not appear on the table, use the next smallest number of degrees of freedom.

• Just as in the normal curve table, the table makes no distinction between negative and positive values of t because the area falling above a given positive value of t is the same as the area falling below the same negative value.

Page 16: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

You are a chicken farmer… if only you had paid more attention in school. Anyhow, you think that a new type of organic feed may lead to plumper chickens. As every chicken farmer knows, a fat chicken sells for more than a thin chicken, so you are excited. You know that a chicken on standard feed weighs, on average, 3 pounds. You feed a sample of 25 chickens the organic feed for several weeks. The average weight of a chicken on the new feed is 3.49 pounds with a standard deviation of 0.90 pounds. Should you switch to the organic feed? Use the .05 level of significance.

Page 17: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Hypothesis Testing

1. State the research question.

2. State the statistical hypothesis.

3. Set decision rule.

4. Calculate the test statistic.

5. Decide if result is significant.

6. Interpret result as it relates to your research question.

Page 18: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

• State the research question.– Does organic feed lead to plumper chickens?

• State the statistical hypothesis.

3:

3:

A

O

H

H

Page 19: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

• Set decision rule.

1.711

24125

05.

critt

df

Page 20: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

• Calculate the test statistic.

18.25

90.0

n

ssX

72.218.

349.3

X

hyp

s

Xt

X

hyp

s

Xt

Page 21: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

• Decide if result is significant.– Reject H0, 2.72 > 1.711

• Interpret result as it relates to your research question.– The chickens on the organic feed weigh

significantly more than the chickens on the standard feed.

Page 22: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Try in pairs

Odometers measure automobile mileage. How close to the truth is the number that is registered? Suppose 12 cars travel exactly 10 miles (measured beforehand) and the following mileage figures were recorded by the odometers:

9.8, 10.1, 10.3, 10.2, 9.9, 10.4, 10.0, 9.9, 10.3, 10.0, 10.1, 10.2

Using the .01 level of significance, determine if you can trust your odometer.

s = .19

Mean = 10.1

Page 23: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Hypothesis Testing

1. State the research question.

2. State the statistical hypothesis.

3. Set decision rule.

4. Calculate the test statistic.

5. Decide if result is significant.

6. Interpret result as it relates to your research question.

Page 24: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

• State the research question.– Are odometers accurate?

• State the statistical hypotheses.

10:

10:

A

O

H

H

Page 25: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

• Set the decision rule.

106.3

111121

01.

critt

ndf

Page 26: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

Calculate the test statistic.

06.12

19.

19.132

56.4

132

44.1468914694

)11(12

)20.121(50.1224)12(

)1(

)(

2

22

n

ss

s

s

s

s

nn

XXns

X

1.1012

20.121X

67.106.

0.101.10

X

hyp

s

Xt

X

9.8

10.1

10.3

10.2

9.9

10.4

10.0

9.9

10.3

10.0

10.1

10.2

121.20

X2

96.04

102.01

106.09

104.04

98.01

108.16

100.00

98.01

106.09

100.00

102.01

104.04

1224.50

Page 27: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

• Decide if result is significant.– Fail to reject H0, 1.67<3.106

• Interpret result as it relates to your research question.– The mileage your odometer records is not

significantly different from the actual mileage your car travels.

Page 28: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Confidence Intervals

• You can estimate a population mean based on confidence intervals rather than statistical hypothesis tests.– A confidence interval is an interval of a certain width,

which we feel “confident” will contain the population mean.

– You are not determining whether the sample mean differs significantly from the population mean.

– Instead, you are estimating the population mean based on knowing the sample mean.

Page 29: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

When to Use Confidence Intervals

• If the primary concern is whether an effect is present, use a hypothesis test.

• You should consider using a confidence interval whenever a hypothesis test leads you to reject the null hypothesis, in order to determine the possible size of the effect.

Page 30: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample: Example

You are a chicken farmer… if only you had paid more attention in school. Anyhow, you think that a new type of organic feed may lead to plumper chickens. As every chicken farmer knows, a fat chicken sells for more than a thin chicken, so you are excited. You know that a chicken on standard feed weighs, on average, 3 pounds. You feed a sample of 25 chickens the organic feed for several weeks. The average weight of a chicken on the new feed is 3.49 pounds with a standard deviation of 0.90 pounds. Should you switch to the organic feed? Construct a 95 percent confidence interval for the population mean, based on the sample mean.

Page 31: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample:

Example

12.3

86.3

37.49.3

)18)(.064.2(49.3

)25

9.0)(064.2(49.3

Construct a 95 percent confidence interval.

))((Xconf stX

Page 32: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

The t Test for a Single Sample:

Example

99.2

99.3

50.49.3

)18)(.797.2(49.3

)25

9.0)(797.2(49.3

))((Xconf stX

Construct a 99 percent confidence interval.

Page 33: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Confidence Intervals

• Notice that the 99 percent confidence interval is wider than the corresponding 95 percent confidence interval.

• The larger the sample size, the smaller the standard error, and the narrower (more precise) the confidence interval will be.

Page 34: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Confidence Intervals•It’s tempting to claim that once a particular 95 percent confidence interval has been constructed, it includes the unknown population mean with a 95 percent probability.

•However, any one particular confidence interval either does contain the population mean, or it does not.

•If a series of confidence intervals is constructed to estimate the same population mean, approximately 95 percent of these intervals should include the population mean.

Page 35: The one sample t-test November 14, 2006. From Z to t… In a Z test, you compare your sample to a known population, with a known mean and standard deviation

Next Week

• Finish Chps. 12 & 13

• You are now ready to ready to do the tutorial and the first problem set of homework #4