16
EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Embed Size (px)

Citation preview

Page 1: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

EDUC 200CSection 5–Hypothesis Testing Forever

November 2, 2012

Page 2: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Goals

• Quick review of hypothesis testing• Confidence intervals• Stata• Practice Problem• Questions?

Page 3: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Review of the General Idea of Hypothesis Testing

• We’re good at “the SAT question”—given a population mean and standard deviation, how rare is observing a particular score? (we all know our percentile on the GRE, for example, and what that means)

• Hypothesis testing is the same, except we have:– Sample means instead of test scores– Null hypothesis instead of population mean– Standard error instead of standard deviation

• We want to know, is our sample mean likely to have come from the population described by the null hypothesis?

Page 4: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Confidence Intervals

• Allows us to give a range of scores in which we are “confident” that the true mean of the population our sample was drawn from resides.

• We know our sample mean has a 95% chance of being within a certain distance of the mean of the true population from which the sample was drawn (this might not be the null hypothesis population)

• What is this distance?– Depends on the critical t value of our

sample, tα

Page 5: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Confidence intervals with Z-scores

• We know with 95% confidence that our sample mean is no more than 1.96 standard deviations from the true mean.

• That is, the z score of the true mean (of the population from which our sample was drawn…might not be null hypothesis population) is within 1.96 of our sample mean z score.

• Another way to see it: we reject the null hypothesis for any z value not between -1.96 and 1.96.

Page 6: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Confidence Interval math…• The z score of the true mean is always

zero

• Substitute the z score formula

• Multiply by the standard error

• Add the population mean

𝑧𝑋ത− 1.96 ≤ 0 ≤ 𝑧𝑋ത+ 1.96

ሺ𝑋ത− 𝜇ሻ− 1.96∗𝜎𝑋ത≤ 0 ≤ ሺ𝑋ത− 𝜇ሻ+ 1.96∗𝜎𝑋ത

𝑋ത− 1.96∗𝜎𝑋ത≤ 𝜇≤ 𝑋ത+ 1.96∗𝜎𝑋ത

Page 7: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Confidence Intervals

• Thus we have that the true population mean lies, with 95% confidence in the range

• We can generalize this for other levels of confidence by changing our critical z value

• We can also generalize for the t distribution

Page 8: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Stata…

• Quick command to describe your datasummarize varname

• This also has the “detail” option, which gives more detail

• “Summarize” can be shortened to “sum” and “detail” to “d” so we can write

summarize varname, detailOr

sum varname, d

Page 9: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Say we have a sample of reading scores…

. sum rdg

Variable | Obs Mean Std. Dev. Min Max-------------+-------------------------------------------------------- rdg | 300 52.444 9.977027 31 76

. sum rdg, d

RDG------------------------------------------------------------- Percentiles Smallest 1% 33.6 31 5% 36.3 33.610% 38.9 33.6 Obs 30025% 44.2 33.6 Sum of Wgt. 300

50% 52.1 Mean 52.444 Largest Std. Dev. 9.97702775% 60.1 73.390% 65.4 73.3 Variance 99.5410795% 68 76 Skewness .131020399% 73.3 76 Kurtosis 2.272609

Page 10: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Using Stata to test our null hypothesis

• Kenji talked yesterday about running a t-test to test our null hypothesis.

• You can use this to compare the mean of a sample to a particular value.ttest var==[null hyp. value]

Page 11: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

. ttest rdg==50

One-sample t test------------------------------------------------------------------------------Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]---------+-------------------------------------------------------------------- rdg | 300 52.444 .5760239 9.977027 51.31043 53.57757------------------------------------------------------------------------------ mean = mean(rdg) t = 4.2429Ho: mean = 50 degrees of freedom = 299

Ha: mean < 50 Ha: mean != 50 Ha: mean > 50 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000

Page 12: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

. ttest rdg==50

One-sample t test------------------------------------------------------------------------------Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]---------+-------------------------------------------------------------------- rdg | 300 52.444 .5760239 9.977027 51.31043 53.57757------------------------------------------------------------------------------ mean = mean(rdg) t = 4.2429Ho: mean = 50 degrees of freedom = 299

Ha: mean < 50 Ha: mean != 50 Ha: mean > 50 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000

Page 13: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

. ttest rdg==50

One-sample t test------------------------------------------------------------------------------Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]---------+-------------------------------------------------------------------- rdg | 300 52.444 .5760239 9.977027 51.31043 53.57757------------------------------------------------------------------------------ mean = mean(rdg) t = 4.2429Ho: mean = 50 degrees of freedom = 299

Ha: mean < 50 Ha: mean != 50 Ha: mean > 50 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000

Page 14: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Practice Problem • Fifteen years ago a complete survey of undergraduate

students at a large university indicated that the average student smoked an average of 8.3 cigarettes per day. The director of the student health center wishes to determine whether the incidence of cigarette smoking at his university has decreased over the 15-year period. He obtains the following results from a recently selected random sample of undergraduate students:

– What are H0 and H1?

– Can you reject the null hypothesis with α=0.05?– What is the 95% confidence interval for the true value of current mean cigarettes smoked per day?– Draw final conclusions

Page 15: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Confidence Intervals for Hands data

Page 16: EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012

Questions?