hw 6 minitab and excel
Class 6 - Assignment 2
Use Minitab to calculate the confidence interval for two proportions
TASK: Create a confidence interval for the difference of the two proportions (male smokers minus female smokers) found in assignment 1. (Don’t worry, it is just a few clicks in minitab, but I have a lot of screenshots in this file)
Background:
In assignment 1 you determined the proportions of male and female college students that are smokers. You probably took a look at these results and checked whether the proportions of male and female smokers are indeed different. If not go back and check!
Answer: For this sample of males and females there is a difference in smoking rates.
The statistical question should now be obvious to you:
Does the observed difference in smoking rates (proportions) in this sample also apply to the whole population of college students (maybe at least at that college)?
You already know how to move from a sample mean to a population mean by creating a confidence interval for a sample mean. In the last class (#5) we went over the creation of a confidence interval for a proportion. Now you have two proportions and their difference and you want to know the confidence interval for the difference. No need to worry! Minitab does that for you with one click! You just need to interpret the result.
Step 1:
Define your question (most important step of all)!
We could ask three questions about proportion differences here (because you calculated three types of proportions:
1. What is the difference of the joint proportion between males and females?
This translates to: What is the difference in the proportion of female smokers and male smokers among all subjects in this sample?
2. What is the difference of the column proportions for smokers between males and females?
This translates to: what is the difference of the proportion of males and females among all smokers? Here you would subtract the two column proportions in the smoker column. Note that the column proportions of male vs female smokers add up to 1 (or 100%).
3. What is the difference of the row proportions of smoking rates between males and females?
This translates to: Is there a difference in the proportion of males who smoke (out of all males) and the proportion of females who smoke (out of all females).
Now I am telling you: Only one of these questions makes sense to ask, because only one of these questions is a “fair” question. All the others compare apples to oranges.
Have you already figured out which one? Here’s a hint: the number of male and female subjects are not the same!
Think about is a little more and try to come up with an answer or at least a guess before you read on.
Because the number of male and female subjects are not the same, the joint proportion won’t be fair, because it compares the male and female smokers to all the subjects, and there are fewer females. So of course there would be fewer female smokers even if their smoking rate was the same.
Similarly, the column proportion would not be fair: It takes all smokers (100%) and looks what is the percent of males and females among the smokers (adding up to 100%). However, since we have a lot fewer females in the study, the proportion of females among all smokers will be skewed as well.
The only proportion we can use to answer the question is the row proportion. Here the male smokers are compared to all males in the study (100%) and the female smokers are compared to all females in the study (also 100%). So the row proportions are the only ones that adjust for the different numbers of males and females in the study.
Step 2: Run the two proportion analysis in minitab
1. Open an empty worksheet in minitab.
2. Copy and paste the frequency table (not the summary table) from assignment 1 into the minitab worksheet.
Note 1: We just use the minitab worksheet so we don’t have to go back and forth between windows when doing the analysis. This analysis does not require data in a worksheet!
Note 2: minitab uses the counts (from the frequency table) for this analysis and not the proportions (from the summary table). If you paid good attention you already know why:
The summary table with the proportions loses the information about the number of subjects (grand total as well as male and female totals). However, calculation of confidence intervals requires calculation of the standard error which depends on the number of subjects.
3. Go to STAT > Basic statistics > 2 Proportions
4. Click the small arrow on the top right and select “Summarized data” from the menu.
The menu will change to ask you for the summarized data.
5. Fill in the fields, keeping track of what you call sample 1 and sample 2 (1=male, 2=female, or the other way round). Best to write this down or identify it in your worksheet.
The number of events are the number of smokers (question for each trial / person: are you a smoker? Yes/no – The “Yes” answer is the event)
Important: Think for a moment what the number of trials is in this case. A trial is the same here as asking a question to a person. So the number of trials is the number of people asked. As pointed out above we need the row proportions for this analysis, because we need to adjust for the fact that there were fewer females enrolled in the study. So we need to compare female smokers to all females (number of trials sample 1) and male smokers to all males (number of trials sample 2). The numbers for all males and all females are found the row marginals!
This also makes sense from a statistical point of view: We want a confidence interval for the female ratio and one for the male ratio. Since the total numbers of females are different from the total number of males, the formula for the standard error and therefore the confidence interval will also be different for males and females. So here we need to work with the marginal totals rather than the grand total.
To make it perfectly clear here is a screenshot using the numbers I obtained in my video demo (which was run on a dataset with fewer subjects):
I chose (for myself and recording it; minitab doesn’t ask for this):
sample 1=female,
sample 2=male.
I had 6 female smokers out of 25 females and 13 male smokers out of 37 males in my example.
6. Select your option for the alternative hypothesis:
Note that the 2-sample proportion not only calculates confidence intervals but automatically also runs a hypothesis test. Our null hypothesis would be that there is no difference in the proportions, so the hypothesized difference is 0.
Selecting the alternative hypothesis become tricky as you know by now. If we just want to see whether there is a significant difference in proportion (ex: female smoking rates are smaller OR larger than males) then we click on the Difference ≠ hypothesized difference row. Then minitab will do a two tail test.
If we want to test whether the proportion of female smokers is smaller than the proportion of male smokers, we have to do a tiny bit of math to match the options minitab offers. First, which of the samples did we call sample 1? Let’s assume females were sample 1. If we want to test whether the female proportion is smaller than the male proportion, then [sample 1 proportion (female) – sample 2 proportion (male)] will be negative (or < 0). So we need to click on the first row (Difference < hypothesized difference). Thus, the selection for the alternative hypothesis depends on what you want to test and which sample is named sample 1 and 2.
7. Select your option for the test method:
There are 2 options:
1) to estimate the proportions separately
2) use a pooled estimate of the proportion.
We want to estimate the proportions separately, because the sample size (or “trials” for each of the proportions is different (# males vs # females).
8. Click OK to close the options window, then click OK again to close Two-Sample Proportion analysis window.
9. Copy your results into a new word file and discuss:
(don’t forget to add your name to the file and also to the file name!)
Does the confidence interval indicate that there is a difference at the 95% confidence level?
Does the hypothesis test indicate that the difference is significant?
Do both methods agree on the result?
You estimated the difference in two ways: a) by looking at the confidence interval of the difference. And b) by performing a hypothesis test (using the standard normal distribution, which is not told you here)
If that confidence interval does not enclose the value “0” (in our hypothesis the entire interval should be in the negative range), the difference should turn out to be significant in the hypothesis test. If the confidence interval includes zero, (goes from minus to plus) the difference should not be significant. The reason for this correspondence of the 2 methods is: the confidence interval is calculated at 95%. This corresponds to a p value of 0.05 or 5% for the hypothesis test. So they should come up more or less with the same answer. (I say “more or less” here, because the calculations are based on estimations)
Here are the results from the example I ran:
Descriptive Statistics
For you, these sample proportions should match the row proportions that you calculated in assignment 1.
Note that these sample p numbers are the sample proportions and not the p-value indicating the probability that the null hypothesis can account for the answer.
|
Sample |
N |
Event |
Sample p |
|
Sample 1 |
25 |
6 |
0.240000 |
|
Sample 2 |
37 |
13 |
0.351351 |
Estimation for Difference
|
Difference |
95% Upper Bound for Difference |
|
-0.111351 |
0.079449 |
CI based on normal approximation
(note here: minitab uses the normal distribution (based on central limit theorem)
The difference in the proportions of female and male smokers is -0.111351.
I can get that number by subtracting the 2 row proportions that I calculated. So there is no doubt about that.
The upper limit of the confidence interval (minitabs calls it bound) for the 95% confidence interval is 0.079449.
We only tested for the difference to be smaller than zero. So we only need to check whether the upper confidence limit for the difference is larger than zero or not. The lower limit will be smaller than -0.111351, and will certainly be negative. That doesn’t tell us anything.
Because the upper limit is not negative but positive, that means that the confidence interval for the difference in not entirely in the negative, so there is a chance that the difference could be positive in other samples taken. Interpretation: in 95% of samples taken with this sample size we will see the difference between female and male range from negative to positive values (up to +0.079, or ~ +8%). That means, sometimes the female proportion will be smaller than the male and sometimes it will be the other way round.
Hypothesis test result:
Test
|
Null hypothesis |
H₀: p₁ - p₂ = 0 |
|
Alternative hypothesis |
H₁: p₁ - p₂ < 0 |
|
Method |
Z-Value |
P-Value |
|
Normal approximation |
-0.96 |
0.169 |
|
Fisher's exact |
|
0.259 |
Minitab runs two tests: a z test based on the normal approximation and the so called Fisher’s exact test, which cranks the numbers using the binomial distribution.
Both tests return a p-value of larger than 0.05. So the observed difference in the smoking rate between male and female college students is not statistically significant.
This conclusion also agrees with the conclusion based on the confidence interval.
10. Post your word file with your results or email it to me.