12 - CLASSIC STATISTICAL INFERENCE
(Hypothesis Testing and CI’s)
12.1 – Confidence Interval for a Single Population Mean ()
We have already looked at confidence intervals as a method of making decisions about the population mean m. The confidence interval details are summarized below.
(100 - )% Confidence Interval for (e.g. confidence)
Recall the basic form of a confidence interval is as follows:
(estimate) + (table value) * SE(estimate)
For a single population mean a 100(1-)% CI for is:
where and = t-distribution quantile with .
Confidence Level / To find the t-statistic value () use the two-tail a at the top of the columns in the table.95 % (
90 % ()
99 % ()
Before we look at hypothesis testing for a single population mean we will examine the five basic steps in a hypothesis test and introduce some important terminology and concepts.
12. 2 - Steps in a Hypothesis Test
1.
2.
3.
4.
5.
12. 3 - Hypothesis Testing for a Population Mean ()
General Form of Hypotheses for a Population Mean:
Null Hypothesis () / Alternative Hypothesis () / p-value areaUpper-tail
Lower-tail
Two-tailed
(perform test using CI for )
hypothesized value for the mean assuming the null hypothesis is true.
Examples of Formulating Hypotheses:
1) Suppose in the past the north end of a particular lake had a Secchi depth of 8.0 meters. Due to recent development around the lake, researchers believe that there is decreased water clarity in that section of the lake. Set up the appropriate hypotheses for this situation.
2) In the community of Morgan Hill, CA there is concern about the perchlorate level found in well water. EPA guidelines suggest that a water supply should have a mean perchlorate level below 4 ppb (parts per billion). Environmental scientists wish to determine if mean perchlorate level in the Morgan Hill water supply is greater than the safe limit. Set up the appropriate hypotheses for this situation.
Test Statistic (in general)
In general the basic form of most test statistics is given by:
Test Statistic = (think “z-score”)
which measures the discrepancy between the estimate from our sample and the hypothesized value under the null hypothesis. Specifically it gives the number of standard errors above (if positive) or below (if negative) the hypothesized value our observed statistic value is.
Intuitively, if our sample-based estimate is “far away” from the hypothesized value assuming the null hypothesis is true, we will reject the null hypothesis in favor of the alternative or research hypothesis. Extreme test statistic values occur when our estimate is a large number of standard errors away from the hypothesized value under the null. The p-value is the probability, that by chance variation alone, we would get a test statistic as extreme or more extreme than the one observed assuming the null hypothesis is true. If this probability is “small” then we have evidence against the null hypothesis, in other words we have evidence to support our research hypothesis.
Test Statistic for Testing a Single Population Mean () ~ (t-test)
~ t-distribution with df = n – 1.
Assumptions:
When making inferences about a single population mean we assume the following:
1. The sample constitutes a random sample from the population of interest.
2. The population distribution is normal. This assumption can be relaxed when our sample size in sufficiently “large”. How large the sample size needs to be is dependent upon how “non-normal” the population distribution is.
Type I and Type II Errors
Type I and II Errors Example:
Testing Wells for a Perchlorate in Morgan Hill Gilroy, CA.
EPA guidelines suggest that drinking water should not have a perchlorate level exceeding 4 ppb (parts per billion). Perchlorate contamination in California water (ground, surface, and well) is becoming a widespread problem. The Olin Corp., a manufacturer of road flares in the Morgan Hill area from 1955 to 1996 was is the source of the perchlorate contamination in the this area.
Suppose you are resident of the Morgan Hill area which alternative do you want well testers to use and why? (Which has the more serious type I error, A or B?)
A B
or
Examples: Testing a Single Population Mean
Example 1: Secchi Disc Readings in Seneca Lake (New York)
In 1997 the mean Secchi depth recorded at the north end of Seneca Lake was 8.0 meters. In 1999 a depth study was conducted on the north end of the lake on similar dates as in the 1997 study yielding the data below:
9.0 9.0 10.5 8.0 9.2 7.0 8.3 6.0 7.1 4.7 7.8 6.0
7.9 6.5 8.3 7.4
Is there evidence to suggest the Secchi depth has decreased on the north end of the lake?
From the JMP output we see the following:
· Normality appears to be satisfied here.
· Notice the CI for the mean Secchi depth is (6.89 m, 8.44 m).
Hypothesis Test:
1)
2) Choose a =
Test statistic
3) Compute test statistic
4) Find p-value (use t-Probability Calculator.JMP)
5) Make decision and interpret
Performing the t-Test in JMP:
To perform a t-test in JMP, select Test Mean from the Secchi Depth pull-down menu and enter value for mean under the null hypothesis, 8.0 in this example.
Example 2: Testing Wells for a Perchlorate in Morgan Hill & Gilroy, CA
Hypothesis Test:
1)
2) Choose a =
Test statistic
3) Compute test statistic
4) Find p-value (use t-Probability Calculator.JMP)
5) Make decision and interpret
Performing a t-Test in JMP:
To perform a t-test in JMP, select Test Mean from the Perchlorate pull-down menu and enter value for mean under the null hypothesis, 4.0 in this example.
Should we be using the mean as a measure of the typical perchlorate concentration found in these wells? Why or why not?
Consider the log base 10 of the perchlorate levels instead.
Hypothesis Test in Log Scale:
Confidence Interval in the Log Base 10 Scale
Making Inferences About a Population Proportion (p)
12. 4 - Confidence Interval for a Single Population Proportion (p)
We have already discussed the confidence interval as a means of make a decision about the value of the population proportion, p. The CI results are summarized below.
Confidence Interval for p
100(1 - )% CI for p
Here sample proportion which is the number of “successes” in our sample divided by the sample size, , and z = equals a standard normal table value that corresponds to our desired confidence level.
Confidence Level / z95 % ( / 1.96
90 % () / 1.645
99 % () / 2.576
12.5 - Hypothesis Tests for the Population Proportion (p)
Test Statistic
standard normal
When our sample size is small or we want an exact test we can use the binomial distribution to calculate the p-value, i.e. use the Binomial Exact Test.
Example: Hypertension During Finals Week
In the college-age population in this country (18 – 24 yr. olds), about 9.2% have hypertension (systolic BP 140 mmHg and/or diastolic BP 90 mmHg). Suppose a sample of n = 196 WSU students is taken during finals week and 29 have hypertension.
Do these data provide evidence that the percentage of students who are hypertensive during finals week is higher than 9.2%?
Hypothesis Test:
2) Choose a =
Test statistic
3) Compute test statistic
4) Find p-value (use Standard Normal Table)
5) Make decision and interpret
Binomial Exact Test Use n = 196 and p = .092 (hypothesized value under Ho)
Exact p-value =
Find a 95% Confidence Interval for p:
12.5 - Comparing Two Population Means using Independently
Drawn Samples ()
Example 1: Effect of Cadmium Oxide on Hemoglobin Levels in Dogs
An experiment was conducted to determine the examine the potential effect cadmium oxide might have on the hemoglobin levels of dogs. It is thought that cadmium oxide exposure would lead to decreased hemoglobin levels. 10 dogs were randomly assigned to the control group and 15 were randomly assigned to the cadmium oxide exposure group.
Research Question: Is there evidence to suggest the cadmium oxide exposure lowers the hemoglobin level found in dogs?
To answer the question of interest we need tools for comparing the population mean hemoglobin level for dogs not exposed to cadmium oxide vs. that for dogs that have had cadmium oxide exposure, i.e. how does compare to ?
Basic Idea:
Case 1 ~ Equal Populations Variances/Standard Deviations (=ß common variance to both populations)
Assumptions:
For this case we make the following assumptions
1. The samples from the two populations were drawn independently.
2. The population variances/standard deviations are equal.
3. The populations are both normally distributed. This assumption can be relaxed
when the samples from both populations are “large”.
100(1 - )% Confidence Interval for ()
where
is called the “pooled estimate of the common variance ”. The degrees of freedom for the t-distribution is . The t-quantiles are same as those for the single population mean case described above.
CI Example: Cadmium Exposure and Hemoglobin Levels
Hypothesis Testing with Independent Samples () (Section 7.2)
The general null hypothesis says that the two population means are equal, or equivalently there difference is zero. The alternative or research hypothesis can be any one of the three usual choices (upper-tail, lower-tail, or two-tailed). For the two-tailed case we can perform the test by using a confidence interval for the difference in the population means discussed above.
Test Statistic
where the is as defined in the confidence interval section above.
Testing Example: Cadmium Exposure and Hemoglobin Levels
Conducting the Test in JMP
Case 2 ~ Unequal Populations Variances/Standard Deviations ()
Assumptions:
For this case we make the following assumptions
1. The samples from the two populations were drawn independently.
2. The population variances/standard deviations are NOT equal.
(This can be formally tested or use rule o’thumb)
3. The populations are both normally distributed. This assumption can be relaxed
when the samples from both populations are “large”.
100(1 - )% Confidence Interval for ()
where
The t-quantiles are the same as those we have seen previously.
Hypothesis Testing
Test Statistic
t-distribution with df = (using formula above)
where the is as defined above.
Example: Mean Cell Radii of Malignant vs. Benign Breast Tumors
In your previous work with these data you noticed that the radii of malignant breast tumor cells were generally larger than the radii of benign breast tumor cells. Assuming the researchers initially hypothesized that cancerous breast tumor cells have larger mean radii than non-cancerous cells, conduct a test to see if this is supported by these data.
The cell radii of the malignant tumors certainly appear to be larger than the cell radii of the benign tumors. The summary statistics support this with sample means/medians of rough 17 and 12 units respectively. The 95% CI’s for the mean cell radius for the two tumor groups do not overlap, which further supports a significant difference in the cell radii exists.
Can we assume the population variances are equal?
Formally Testing the Equality of Population Variances
In JMP
Because we conclude that the population variances are unequal we should use the non-pooled version to the two-sample t-test. No one does this by hand, so we will use JMP.
12.6 - Comparing Two Population Means Using
Dependent Samples or Matched Pairs
When using dependent samples each observation from population 1 has a one-to-one correspondence with an observation from population 2. One of the most common cases where this arises is when we measure the response on the same subjects before and after treatment. This is commonly called a “pre-test/post-test” situation. However, sometimes we have pairs of subjects in the two populations meaningfully matched on some pre-specified criteria. For example, we might match individuals who are the same race, gender, socio-economic status, height, weight, etc... to control for the influence these characteristics might have on the response of interest. When this is done we say that we are “controlling for the effects of race, gender, etc...”. By using matched-pairs of subjects we are in effect removing the effect of potential confounding factors, thus giving us a clearer picture of the difference between the two populations being studied.
DATA FORMAT
Matched Pair1
2
3
... / ... / ... / ...
n
The hypotheses are
Test Statistic for a Paired t-test
t-distribution with df = n - 1
Note: the hypothesized value for the mean paired difference under the null.
Assumptions:
1. The samples are random and meaningfully paired, i.e. are dependent.
2. Paired differences from two populations must be normally distributed.
100(1-)% CI for
where comes from the appropriate quantile of t-distribution df = n – 1.
This interval has a 100(1-)% chance of covering the true mean paired difference.
Example: Effect of Captopril on Blood Pressure
In order to estimate the effect of the drug Captopril on blood pressure (both systolic and diastolic) the drug is administered to a random sample n = 15 subjects. Each subjects blood pressure was recorded before taking the drug and then 30 minutes after taking the drug. The data are shown below.
Research Questions:
· Is there evidence to suggest that Captopril results in a mean systolic blood pressure decrease of at least 10 mmHg* on average in patients 30 minutes after taking it? (* It is decided that a mean change of less than 10 mmHg is of no physiological importance.)
· Is there evidence to suggest that Captopril results in a mean diastolic blood pressure decrease of at least 5 mmHg* on average in patients 30 minutes after taking it? (* It is decided that a mean change of less than 5 mmHg is of no physiological importance.)
For each blood pressure we need to consider paired differences of the form
For paired differences defined this way, positive values correspond to a reduction in their blood pressure ½ hour after taking Captopril. To answer the research questions above we need to conduct the following hypothesis tests:
and
Below are the relevant statistical summaries of the paired differences for both blood pressure measurements.
The t-statistics for both tests are given below: