



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Hypothesis testing
Research hypotheses are conjectures or suppositions that motivate the research.
Statistical hypotheses involve restating the research hypotheses in such a way that they may be addressed by statistical techniques.
Formally, a statistical hypothesis testing problem includes two hypotheses. These hypotheses are referred to as the null hypothesis (H 0 ), and the alternative hypothesis (HA).
In statistical hypothesis testing, we start off believing the null hypothesis, and see if the data provide enough evidence to abandon our belief in H 0 in favor of the alternative hypothesis HA.
In the previous example, H 0 : μ = μ 0 = 211 and we considered the alternative hypothesis (HA : μ 6 = μ 0 = 211).
We made plans to collect a sample of 12 US men (with a particular disease) and to record the cholesterol level of each. We want to know if the underlying population mean for this population is different than 211. The null and alternative hypotheses are as follows:
H 0 : μ = μ 0 = 211 and HA : μ 6 = μ 0 = 211 We collect the sample of 12 US men (with a particular disease), record the cholesterol level of each, and figure out that the sample mean, ¯x, is 217. We want to know if the difference between 211 and 217 is too big to be attributed to chance alone. If there is evidence that the sample could NOT have come from a population with mean 211, we reject the null hypothesis.
3
To see if there is evidence that the sample could NOT have come from a population with mean μ = 211, we assume that it did. We then calculate the probability that we see a sample mean as far away (or farther) from 211 than the one we observed.
If this probability is very small, we conclude that our assumption was wrong and that the sample could NOT have come from a population with mean 211 (we reject the null hypothesis).
4 What do we know about the distribution of the sample mean? We know by the CLT that Z = X¯ − μ √^ σn is approximately standard normal. Assume that the null hypothesis, H 0 , is true. If μ = 211, then Z =
is approximately standard normal. We evaluate z =^21746 /−√^21112 and see if this looks like it might be a sample from a standard normal. In particular, we calculate the probability that we would observe a z this far away (or farther) from 0.
z =^21746 /^ −√^21112 = 0.^45
z =^21746 /^ −√^21112 = 0. 45
x
f_X(x)
-4 -2 0 2 4
P (Z < − 0 .45) + P (Z > 0 .45) = 0.326 + 0.326 = 0.652. This probability is relatively large, so it doesn’t seem unusual that z is a sample from a standard normal. Thus, our assumption that true population mean was 211 seems reasonable. As a result, we do not reject the null.
If instead the sample mean had been ¯x = 241 We evaluate z = (^24146) /−√^21112 and see if this looks like it might be a sample from a standard normal. In particular, we calculate the probability that we would observe a z this far away (or farther) from 0.
z =^24146 /^ −√^21112 = 2. 26
x
f_X(x)
-4 -2 0 2 4
0.^ 0.^ 0.^ 0.^
This probability is very small, so it does seem unusual that z is a sample from a standard normal. Thus, our assumption that the true population mean was 211 seems unreasonable. As a result, we reject the null.
7 Some Definitions
Based on our analysis of the data and resulting conclusions, there are two types of errors that we could have made:
A test statistic is a statistic (function of random variables which does not contain any unknown parameters) used to evaluate the validity of a null hypothesis. Oftentimes, it is a function of observable random variables (e.g., X¯) and the parameter of interest in the hypothesis test (e.g., μ = μ 0 ). It is constructed so that we know its distribution.
A p-value for a hypothesis test is the probability, computed under the null hypothesis, that the value of the test statistic would be as extreme or more extreme than the one observed.
8 If the p-value is small, this denotes an unusual observation if H 0 is true. In this case, we might doubt the fact that H 0 is true and reject the null hypothesis.
How “small” is small?
When we define the type I error, α, we are defining what we mean by “unusual” observation. H 0 is rejected when the p-value is less than α.
Let μ be the mean of X in the population of practicing US physcians. The null hypothesis would simply be that physicians on average are allotted just the right amount of time.
H 0 : μ = 0
Consider a two-sided alternative hypothesis. A two-sided alternative hypothesis is just a negation of the null hypothesis, allowing for the population parameter to be either larger or smaller than the value expressed by the null hypothesis.
Two-sided alternative hypothesis
HA : μ 6 = 0
Decide on the type I error rate: α = 0. 05 Recall that X is the time pressure variable and μ is the mean of X in the general population of US physicians. For large samples, we know that the distribution of
X¯ − μ σ/√n is approximately standard normal. Thus, if we assume that the null hypothesis is true, the test statistic
σ/√n will have a standard normal distribution, approximately.
15
Collect the sample and evaluate the test statistic In a sample of 40 physicians, ¯x = 5.9 minutes. Therefore,
z = (^16) /^5 .√^940 = 2. 33
16
z = (^16) /^5 .√^940 = 2. 33 Calculate the p-value:
x
f_X(x)
-4 -2 0 2 4
Here, the p-value is 0.0198. Consider α = 0.05 (±z 1 −α/ 2 shown in blue), H 0 is rejected since p-value is less than α. We conclude that physicians, on average, are under time pressure.
Example: one-sided alternative
Consider the example EXACTLY as we have it above EXCEPT specify a one-sided alternative hypothesis. The null and alternative hypotheses are now:
H 0 : μ ≤ 0 versus HA : μ > 0,
We’ll keep the type I error rate at 0.05 (α = 0.05) The form of the test statistic has not changed. If we assume that the null hypothesis is true,
σ/√n
will have a standard normal distribution, approximately.
Again, we evaluate the test statistic. In our sample of 40 physicians, x¯ = 5.9 minutes. Therefore,
z = 5.^9 16 /
Find the p-value. Here, “as extreme or more extreme” is just as extreme or greater !!
Calculate the p-value:
z = 5.^9 16 /
x
f_X(x)
-4 -2 0 2 4
Here, the p-value is 0.0099. Consider α = 0.05 (z 1 −α shown in blue), H 0 is rejected since p-value is less than α. We conclude that physicians, on average, are under positive time pressure.
19
Summary:
x
f_X(x)
-4 -2 0 2 4
0.^ 0.^ 0.^ 0.^
p-value = P (Z ≤ − 2 .33)+P (Z ≥ 2 .33) = 0.0099+0.0099 = 0. 0198 Consider α = 0.05 (±z 1 −α/ 2 shown in blue), H 0 is rejected since p-value is less than α.
x
f_X(x)
-4 -2 0 2 4
0.^ 0.^ 0.^ 0.^
p-value = P (Z ≥ 2 .33) = 0. 0099 Consider α = 0.05 (z 1 −α shown in blue), H 0 is rejected since p-value is less than α.
20 Note:
We would have rejected the null hypothesis in the first case if the value of the test statistic had been smaller than or equal to -1. (−z 1 −α/ 2 ) or if it had been greater than or equal to 1.96 (z 1 −α/ 2 ) (for α = 0.05).
We would have rejected the null hypothesis in the second case if the value of the test statistic had been greater than or equal to 1. (z 1 −α) (again α = 0.05).
Critical values of a test statistic are the values of the test statistic that determine whether or not the null hypothesis is rejected. In the test that we just discussed with a two-sided alternative, the critical values are -1.96 and 1.96. In the test with a one-sided alternative, the critical value is 1.645.
Pair Twin 1 Twin 2 difference 1 134 128 6 2 139 136 3 3 176 163 13 4 152 153 - 5 166 157 9 6 161 154 7 7 129 125 4 8 122 124 -
In this sample, d¯ = 4.875 and sd = 4.998.
Test H 0 : δ = 0 versus HA : δ 6 = 0, at significance level α = 0.05.
Compute the test statistic
d¯ − 0 sd/√n =^
For 7 degrees of freedom t 0. 975 = 2.365, so the null hypothesis is rejected and we conclude that there is a non-zero difference in grey matter density.
Paired Data
Paired data is where two observations are taken from the same individual or from two individuals who are very similar. For example,
In many cases, the difference in response between the two treatments or states can be computed for each pair (such as “twin 1” − “twin 2”).
27
Suppose that we will sample n pairs (X,Y ). From each pair we compute the difference D = X − Y. Let δ denote the true difference in population means (δ = μ 1 − μ 2 ), where μ 1 is population mean of X and μ 2 is population mean of Y.
With paired data, we are usually interested in testing the hypotheses:
Two-sided H 0 : δ = 0 versus HA : δ 6 = 0
One-sided
H 0 : δ ≤ 0 versus HA : δ > 0
or
H 0 : δ ≥ 0 versus HA : δ < 0