Professional Documents
Culture Documents
Unit 06 - Intro To Inference - 4 Per Page
Unit 06 - Intro To Inference - 4 Per Page
• Confidence Intervals
Unit 6: Introduction to Inference
Chapter 6 in IPS
• Hypothesis Tests
3 4
1
7/12/2012
x 1.96 , x 1.96 x 1.96 , x 1.96
n n n n
Can we be more confident? Suppose z* and C are related as in Figure 6.4
IPS Figure 6.3 shows the from IPS. We can say that the sample mean will be within the population
confidence intervals based on mean, plus or minus z*σ/√n with 100*C% confidence.
25 random samples. Note
that all but 1 contain the true A confidence interval for the mean with
mean μ confidence level C will have the form:
x z* , x z*
n n
7 8
2
7/12/2012
11 12
3
7/12/2012
13 14
Testing a hypothesis…(cont.)
Testing a hypothesis…(cont.)
2. Calculate the value of the test statistic on which the test will be
based.
• The test statistic measures the difference between the observed 3. Find the probability of getting this test statistic or a more
data and what is expected given the null hypothesis is true. extreme one if the null hypothesis were true.
• This is called the p-value (stands for probability-value)
• The test statistic answers the question, “How many standard
deviations from the hypothesized value is the observed sample • The smaller the p-value, the stronger the evidence against
the null hypothesis.
value?”
• Almost always of the form
4. Come to a conclusion about your hypotheses.
(observed statistic) - (its expected value)
• If the p-value is as small or smaller than the pre-specified
(standard deviation of statistic) level of the test or alpha (), usually 0.05, we say the result
• When will this value be large (in magnitude)? When will it be is statistically significant at level .
close to zero?
15 16
4
7/12/2012
19 20
5
7/12/2012
15
As a 2-sided test: As a 1-sided test:
1. H 0 : 1200 1. H 0 : 1200
H A : 1200 H A : 1200
0.05
10
0.05
Percent
2. 2.
x 1250 1200 x 1250 1200
z 1.670 z 1.670
5 / n 300 / 100 / n 300 / 100
Conclude H0 Conclude H0
• Power and Sample Size H0 true HA true
Conclude HA Conclude HA
23 24
6
7/12/2012
25 26
27 28
7
7/12/2012
Has the cost of living changed in Maine? Before data are collected
• The US Department of Housing and Urban Development publishes a • Suppose we `know’ (perhaps from previous studies) that the
table of Fair Market Rents (FMR) by state to set amounts paid in standard deviation for the rents of all two-bedroom apartments in
voucher programs, Section 8 housing, and other programs Maine is σ = $72
• The data used here oversimplifies the technical details in the • Suppose we wish to design our study so that the margin of error
definition of FMR, but is a good illustration. in a 95% confidence interval for the mean is $25, that is, the
confidence interval will be (approximately) of the form: sample
• In 1997, FMR for two-bedroom apartment in Maine was $590. mean $25
• Suppose we wish to do a study to examine how rents in Maine – How large should our sample of rents be?
compare to FMR. We’ll collect a random sample of rents of two- • Recall the formula for margin of error (m) in a confidence
bedroom apartments. interval for a mean:
m z*
• More specifically, we would like to `decide’ (in 1997), based on data, n
whether or not rents in Maine are different than the fair market rent • From this we can get * 2
( z )( ) 1.96(72)
2
• We’ll eventually use a data set that is a random sample of rents for 32 (just solve for n): n 31.8 32
two-bedroom apartments in Maine in 1997 m 25
• Start with some pre-data calculations… • So what is the Power for this test?
29 30
Calculating Power
Calculating Power • First: determine the rejection region assuming the Null
hypothesis is true (always helps to draw the picture):
• When calculating power, it’s a 2-step Process – We will reject when |z-stat| > 1.96 (far out in tails)
– First: determine the rejection region assuming the Null – What does this mean in terms of the sample mean?
hypothesis is true (what values of x are needed to reject the • x > μ + (1.96)*(σ/√n) = 590 + 1.96*72/√32 = 615
test). • x < μ - (1.96)*(σ√n) = 590 - 1.96*72/√32 = 565
– Second: calculate the probability of finding a sample statistic
(in this case, the sample mean) that falls in the rejection
• Second: calculate the probability of finding a sample mean
region if the alternative hypothesis is actually true that falls in the rejection region if HA is actually true…so we
• What are our hypothesis here? have to pick a specific μ within HA…let’s use μ = 625 here:
– H0: μ = 590 P ( x 615 | A 625) P ( x 565 | A 625) P ( x 615 | A 625) 0
– HA: μ ≠ 590 x A 615 625
P P ( z 0.79) 0.7840
• Let’s do the calculation… / n 72 / 32
8
7/12/2012
Maine rents
• Next step: take a sample of 32 rents and see what happens
• Summary of data below…apparently bad luck on the standard
deviation…we will return to this
35 36