Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An overview of statistical inference for two proportions and means, focusing on confidence intervals and hypothesis testing. It covers the concepts of sampling distributions, standard deviations, and confidence intervals for proportions and means. Additionally, it discusses hypothesis testing, null distributions, and conducting hypothesis tests to determine if the null hypothesis should be rejected.
Typology: Study notes
1 / 14
This handout covers statistical inference in four situations - one proportion, two proportion, one mean, and two means. Proportions refer to situation where the data is dichotomous (two-values) such as “yes/no”, “male/female”, “success/failure”, and so forth. Means are used for interval/ratio data. In what follows, we color code the text by using red for one proportion, blue for two propor- tions, purple for one mean, and green for two means. Text remaining in black applies to all four scenarios. One population problems are fairly rare in practice. Typically we are interested in comparing two populations (ANOVA and Regression generalizes this to multiple population), such as compar- ing people given a placebo (one population) to people given a new drug (the second population). For one proportion, we are interested in the population proportion p. The population proportion p is estimated by the sample proportion ˆp. Two two proportions, we are interested in the difference of the two population proportion pX − pY that is estimated with ˆpX − pˆY. For one mean, we are interested in the population mean μ that is estimated by X¯, and for two means we are interested in the difference of the population means μX − μY that is estimated by X¯ − Y¯. Note the differences pX − pY and μX − μY are directly related to questions such as “is pX equal to pY ” (equivalent to pX − pY = 0) or “is μX greater than μY ?” (equivalent to μX − μY > 0).
The sampling distribution describes the variation we observe in our estimator as a result of sampling variability, which is the tendency of any statistic to vary in repeated sampling. While statistics vary from sample to sample, they do so in a clear pattern which can be mathematically determined. This pattern is useful for determining how close we think the parameter is to statistic (e.g. how close the population proportion p is to the estimator ˆp, or how close the estimated difference X¯ − Y¯ is to the true difference μX − μY. All these distributions require sample sizes greater than 30. Note that in all cases the center of the sampling distribution is the parameter of interest.
ˆp ∼ N
p,
√ p(1 − p) n
pˆX − pˆY ∼ N
pX − pY ,
√ pX (1 − pX ) nX
pY (1 − pY ) nY
( μ, σ √ n
)
where σ is the population standard deviation.
μX − μY ,
√ σ X^2 nX
σ^2 Y nY
where σX and σY are the respective population standard deviations.
3 Confidence Intervals
If you want to make a confidence interval, note every one of the sampling distribution is normally distributed, with a mean equal to the parameter of interest, and some standard deviation. All confidence intervals we discussed have the form
estimate ± z 1 −(α/2) (standard deviation of estimate)
Because population parameters are unknown, any population parameters appearing in the standard deviations must be estimated
√ p ˆ(1 − pˆ) n
The confidence interval for p is
pˆ ± z 1 −(α/2)
√ p ˆ(1 − pˆ) n
pY (1 − pY ) nY
estimated by
√ p ˆX (1 − pˆX ) nX
pˆY (1 − pˆY ) nY
The confidence interval for pX − pY is
(ˆpX − pˆY ) ± z 1 −(α/2)
√ p ˆX (1 − pˆX ) nX
pˆY (1 − pˆY ) nY
σ √ n
estimated by s √ n
The confidence interval for μ is
X¯ ± z 1 −(α/2) √^ s n
σ Y^2 nY estimated by
√ s^2 X nX
s^2 Y nY
The confidence interval for μX − μY is
( X¯ − Y¯ ) ± z 1 −(α/2)
√ s^2 X nX
s^2 Y nY
4 Hypothesis Testing
Hypothesis testing is a much broader subject than confidence intervals, since it includes investigat- ing the properties of the tests such as power and sample size determination. As before, you need to know whether you are investigating one proportion, two proportions, one mean, or two means.
In all hypothesis tests, there is a “null value” available for the parameter, so you are testing
In addition to the null hypothesis, we also have an alternative hypothesis, which is defined as a direction where we “have something to prove”. The alternative hypothesis is often called the “research hypothesis” and you want it to be the “interesting” result. The alternative hypothesis can include either “>”, “<”, or “ 6 =” (for example the null hypothesis H 0 : μ = μ 0 can be matched with any of H 1 : μ > μ 0 , H 1 : μ < μ 0 , or H 1 : μ 6 = μ 0.
The null distribution is defined as the sampling distribution of our estimate when the null hypothesis is true. The only difference between the null distribution and the sampling distributions in section 2 is that, knowing the null value, we can plug it in the formula.
pˆ ∼ N
p 0 ,
√ p 0 (1 − p 0 ) n
pˆX − pˆY ∼ N
0 ,
√ p ˆ 0 (1 − pˆ 0 ) nX
pˆ 0 (1 − pˆ 0 ) nY
where
pˆ 0 = (#X successes) + (#Y successes) nX + nY
X¯ ∼ N
( μ 0 , s √ n
)
0 ,
√ s^2 X nX
s^2 Y nY
If you are given data and asked to conduct the hypothesis (i.e. determine whether or not to reject the null hypothesis), then you need to compute your estimate, compute the cutoff/s for the rejection region, and determine if the estimate lies in the rejection region. Once you have the null distribution from section 4.2, the hypothesis test proceeds by the same rules regardless of whether you are working with one proportion, two proportions, one mean, or two means. If the alternative hypothesis is “>”, you reject if your estimate is greater than the 1 − α percentile of the null distribution. If the alternative hypothesis is “<”, you reject if your estimate is less than the α percentile of the null distribution. If the alternative hypothesis is “ 6 =”, you reject if your estimate is less than the α/2 percentile of the null distribution OR if your estimate is greater than the 1 − (α/2) percentile of the null distribution. The “p-value” of a hypothesis test is defined as the point where 1) you would reject H 0 for any α above the p-value, and 2) you would not reject H 0 for any α below the p-value. To find this value, you have to equate your observed estimate to the cutoff of the hypothesis test, and then solve for α. The cutoff, of course, depends on the direction of the alternative hypothesis. If the alternative hypothesis is “ 6 =” and your data is greater than the null value, the cutoff is σnullz 1 −(α/2) + (null value), where σnull is the standard deviation of the null distribution. You need to set your estimate equal to this cutoff, which results in
σnullz 1 −(α/2) + (null value) = estimate
estimate − (null value) σnull = z 1 −(α/2)
Thus, find Z in the margin of the Z-table, and equate the result to 1 − (α/2)
Example - suppose the null value is 6, the null standard deviation is 0.14, and the estimate is 6.25. Compute
The probability a Z is less than 1.79 is 0.9633. Equating 0.9633 to 1 − (α/2), we find α = 0.0734, which is the p-value.
Sample problems
pˆ ∼ N (0. 4 ,
√ (0.4)(1 − 0 .4)/200 = 0.0346)
Since the alternative is “<” we reject if ˆp is less than α percentile of the null distribution. The 0 .1 percentile of a Z is − 1 .28, so the 0.1 percentile of the null distribution is (0.0346)(− 1 .28)+ 0 .4 = 0.3557. Our observed ˆp = 0.32 is less than 0.3557, so we reject H 0. As for the p-value. Note our observed data corresponds to a Z of
Equating − 2 .31 = zα, we find the probability below Z = − 2 .31 is 0.0104 = α, so 0.0104 is the p-value.
pˆX − pˆY ∼ N
0 ,
√ (0.5060)(1 − 0 .5060) 160
The alternative is “ 6 =”, so the cutoffs are the α/2 and 1 − (α/2) percentiles of the null distribution, where α = 0.01 here. The α/2 and 1 − (α/2) percentiles of a Z are − 2 .57 and 2 .57. The α/2 percentile of the null distribution is (0.0546)(− 2 .57) + 0 = (− 0 .1403) and (0.0546)(2.57) + 0 = 0.1403. The observed difference of (− 0 .0352) is well within those cutoffs, so we do not reject H 0. As for the p-value, the observed difference is less than the null value, so we compute the Z value and equate it to zα/ 2. The Z value is
− 0. 0352 − 0
The probability a Z is less than (− 0 .64) is 0.2611. Equating this to α/2, we find the p-value is 0. 5222
X¯ ∼ N (3, s/√n = 0. 65 /
Since the alternative hypothesis is “<”, we want to find the α = 0.05 percentile of the null distribution. The α = 0.05 percentile of a Z is (− 1 .64), and the 0.05 percentile of the null distribution is (0.0705)(− 1 .64) + 3 = 2.8844. The observed X¯ = 2.78 is less than the cutoff, so we reject H 0. As for the p-value, we compute Z and equate it to the zα.
The probability a Z is less than (− 3 .12) is 0.0009, which we equate to α and thus the p-value is 0.0009.
0 ,
√
Since the alternative is “>”, the cutoff is the 1 − α percentile of the null distribution. When α is not given, we use α = 0.05. The 0.05 percentile of a Z is 1.64 and the 0.05 percentile of the null distribution is (1.62)(1.64) + 0 = 2.6568. The observed difference of X¯ − Y¯ =
The probability a Z is less than 1.97 is 0.9756. Equating that to 1 − α, we find α = 0. 0244 and thus the p-value is 0.0244.
In a power calculation, you will be given enough information to construct the hypotheses, α, a value of the parameter in the alternative hypothesis, and possibly some more information depending on the setting (see below). To compute the power, you need to compute the alternative distribution, and then determine the probability, under the alternative distribution, that the null hypothesis would be rejected. The alternative distribution is very similar to the null distribution, EXCEPT for the key dif- ference that the parameter is assumed to be the alternative value, not the null value.
pˆ ∼ N
p 0 ,
√ p 0 (1 − p 0 ) n
ˆpX − pˆY ∼ N
d 1 ,
√ p ˆ 0 (1 − pˆ 0 ) nX
pˆ 0 (1 − pˆ 0 ) nY
where ˆp 0 is the value proposed in the problem.
( μ 1 , s √ n
)
where σ^2 can be used in place of s if σ^2 is given as part of the problem
d 1 ,
√ s^2 X nX
s^2 Y nY
where σX or σY may be used instead of sX and sY if they are given.
To actually compute the power, follow these steps. First, compute the null distribution and the cutoffs for the hypothesis test (the cutoffs found as in section 4.3). Then compute the probability the alternative distribution assigns to the rejection region.
Sample problems
pˆ ∼ N (0. 2 ,
√ (0.2)(1 − 0 .2)/300 = 0.0231)
and the alternative distribution is
pˆ ∼ N (0. 22 ,
√ (0.22)(1 − 0 .22)/300 = 0.0239)
The cutoff is the 1 − α percentile of the null distribution. The 1 − 0 .01 = 0.99 percentile of a Z is 2.33, so the 0.99 percentile of the null distribution is (0.0231)(2.33) + 0.2 = 0.2538. We reject if ˆp is greater than 0.2538. According to the alternative distribution, the probability ˆp > 0 .2538 id
( Z >
) = 1 − 0 .9207 = 0. 0793
So the power (0.0793) is very small in this example.
pˆX − ˆpY ∼ N
0 ,
√ (0.7)(1 − 0 .7) 150
while the alternative distribution is (note the second term does not change)
pˆX − pˆY ∼ N
(− 0 .10),
√ (0.7)(1 − 0 .7) 150
The cutoff is the α = 0.05 percentile of the null distribution. The 0.05 percentile of a Z is − 1 .64, so the α = 0.05 percentile of the null distribution is (0.0495)(− 1 .64) + 0 = (− 0 .08118). Thus, we reject if the observed difference ˆpX − pˆY is less than (-0.08118). The power of the test is the probability the alternative distribution places below (− 0 .08118). To find this
( Z <
) = 0. 6480
So the power is 0.6480.
while the alternative distribution is
X¯ ∼ N (45, 10 /
The cutoffs are the α/2 = 0.005 and 1 − (α/2) = 0.995 percentile of the null distribution. The corresponding percentiles of a Z are − 2 .58 and 2.58. Thus, the cutoff from the null distribution are (1)(− 2 .58) + 50 = 47.42 and (1)(2.58) + 50 = 52.58. We reject if X¯ is outside that region. The probability the alternative distribution places on the rejection region is the sum of the probability of being below 47.42 and the probability of being above 52.58.
P
( Z <
) = 0. 9922
( Z >
) = 0
Note the second value is off the chart. Thus, the power here is the sum of these two values (one of which is 0), so the power is 0.9922.
0 ,
√ 102 70
while the alternative distribution is (note the second term does not change)
3 ,
√ 102 70
The cutoffs are the α/2 = 0.01 and 1 − (α/2) = 0.99 percentiles of the null distribution. The corresponding percentiles of a Z are − 2 .33 and 2.33. Thus, the cutoff from the null distribution are (1.9821)(− 2 .33) + 0 = − 4 .6183 and (1.9821)(2.33) + 0 = 4.6183. We reject if X¯ − Y¯ is outside that region. The probability the alternative distribution places on the rejection region is the sum of the probability of being below (− 4 .6183) and the probability of being above (4.6183).
( Z <
) = 0
( Z >
) = 0. 7939
Adding these values together (one of which is 0), the power is 0.7939.
Another problem faced in hypothesis testing is determining a sample size sufficient to both achieve a specific value of type I error (α) and a specified power. The solution to this problem is based on equating percentiles of the null distribution (corresponding to the cutoffs of the hypothesis test) with percentiles of the alternative distribution (those required to get to the appropriate power). As before, you will need the null and alternative distribution (and whatever information was required to compute the power alone). Your equation depends on the direction of the alternative hypothesis. If the alternative hypothesis is “>”, you need to equate the 1 − α percentile of the null distribution to the 1 − P OW percentile of the alternative distribution (where POW is the desired power). Then solve for n. If the alternative hypothesis is “>”, equate the α percentile of the null distribution to the P OW percentile of the alternative distribution. If the alternative hypothesis is “ 6 =”, then remember there are two cutoffs. We only use the one in the direction of the specified alternative value. If the alternative value is less than the null value, equate the α/2 percentile of the null distribution to the P OW percentile of the alternative distribution. If the alternative value is greater than the null value, equate the 1 − (α/2) percentile of the null distribution to the 1 − P OW percentile of the alternative distribution.
Sample Problems
ˆp ∼ N (0. 40 ,
√ (0.4)(1 − 0 .4)/n = 0. 4899 /
n)
and the alternative distribution is
pˆ ∼ N (0. 42 ,
√ (0.42)(1 − 0 .42)/n = 0. 4936 /
n)
To find the required sample size, we note that we have a “ 6 =” alternative and that the alternative value is greater than the null value. Thus, we need to equate the 1 − (α/2) = 0 .995 percentile of the null distribution to the 1 − P OW = 0.10 percentile of the alternative distribution. The 0.995 percentile of a Z is 2.58, so the 0.995 percentile of the null distribution is (0. 4899 /
n)(2.58)+ 0 .40. The 0.10 percentile of a Z is (− 1 .28), so the 0.10 percentile of the alternative distribution is (0. 4936 /
n)(− 1 .28) + 0.42. Equating these values and solving for n
n
n
n = 8984. 2
So we need at least 8985 observations (a lot because we are expecting α to be so small and simultaneously detect a small difference).
pˆX − pˆY ∼ N
0 ,
√ (0.6)(1 − 0 .6) n
n
n
while the alternative distribution is (note the second term does not change)
pˆX − pˆY ∼ N
− 0. 03 ,
√ (0.6)(1 − 0 .6) n
n
n
To find the minimum sample size for a “<” alternative, we need to equate the α = 0. 05 percentile of the null distribution to the P OW = 0.8 percentile of the alternative distribution. The 0.05 percentile of a Z is (− 1 .64), sothe 0.05 percentile of the null distribution is
while the 0.80 percentile of a Z is 0.84 so the 0.80 percentile of the alternative distribution is
Equating these
n
n
n = 3279. 85
so n must be at least 3280.
X¯ ∼ N (4, 2. 3 /√n)
while the alternative distribution is
X¯ ∼ N (4. 5 , 2. 3 /√n)
Since the alternative is “>”, we want to equate the 1 − α = 0.95 percentile of the null distribution with the 1 − P OW = 0.3 percentile of the alternative distribution. The 0.95 percentile of a Z is 1.64 and the 0.95 percentile of the null distribution is
while the 0.30 percentile of a Z is (− 0 .52) so the 0.30 percentile of the alternative distribution is
Equating these
n
n
n = 98. 72
We need at least 99 observations.
0 ,
√ 52 n
n
n
while the alternative distribution is (note the second term does not change)
2 ,
√ 52 n
n
n
Because the alternative is “ 6 =” and the alternative value (2) is greater than the null value (0), we equate the 1 − (α/2) = 0.975 percentile of the null distribution to the 1 − P OW = 0. 10 percentile of the alternative distribution.
The 0.975 percentile of a Z is 1.96, so the 0.975 percentile of the null distribution is
while the 0.10 percentile of a Z is (− 1 .28) and thus the 0.10 percentile of the alternative distribution is
Equating these
n
n
n = 194. 20
So we need a sample size of at least 195 in each group.