Topic 12: Inference Practice (Spreadsheets)
In this activity, we are introduced to a decision tree document for determining how to compute the standard error component of a confidence interval or test statistic. We are also provided with a general framework for approaching hypothesis testing and confidence interval applications, and we practice with three scaffolded examples.
Note. The button above resets multiple choice and checkbox questions. Currently, resetting answer entry cells must be done manually via hitting the Start Over button on each individual interactive cell.
There are times throughout this activity where youâll be asked to do work inside of your favorite spreadsheet program.
- If you are a Google Sheets user, open a blank Google Sheet
- If you are an Excel user, open an empty workbook on your computer or create a blank workbook in Excel online
Inference Practice
In the Topic 11 activity you learned about statistical inference â hypothesis tests and confidence intervals â for categorical variables. In this activity weâll continue where we left off. Youâll start with a video explaining the Standard Error Decision Tree, and then move on to a few practice problems.
A Tour of the Decision Tree
From this point on youâll make heavy use of the Standard Error Decision Tree. The tree may look intimidating, but it contains most of what youâll need for what remains in our introductory course. Letâs start with a tour.
Practice Problems
This section contains three practice problems. Be sure to note any questions you have or trouble you run into. You might also check back with the Topic 11 activity to revisit the videos from Dr. Diez and Dr. McClintock Pileggi, which discussed approaches similar to the ones required for these problems. The links below contain detailed versions of the general strategies for our inference tasks â keep them handy!
- General Strategy for Conducting a Hypothesis Test
- General Strategy for Computing a Confidence Interval
Scenario 1a: The result of a poll was that 48% of 331 randomly sampled Americans who decided not to go to college were forced into that decision because they cannot afford it. Construct a 90% confidence interval for the proportion of non college educated Americans who decided not to go to college because they cannot afford it, and interpret the result in context.
Use your spreadsheet for any necessary computations. Do future-you a favor and label your cells so you can follow your own work.
To answer the question as asked, we should:
Re-read the problem statement. What is being asked for â a probability, a range of plausible values, a yes/no claim decision, or a sample size?
The problem says âconstruct a 90% confidence interval.â Open the General Strategy for Computing a Confidence Interval and work through the steps.
The point estimate is:
The point estimate is your best single guess at the true population proportion. It comes from the sample data.
48% of the 331 sampled Americans said they could not afford college. As a decimal, that is 0.48.
The standard error formula is:
Consult the Standard Error Decision Tree.
Starting from the top of the tree, are we working with means (\(\mu\)) or proportions (\(p\))?
The question being asked to participants is âDid you make the choice not to attend college because you couldnât afford to do so?â. This is a âyes/noâ question that will sort participants into categories. We measure the size of a group with a proportion (\(p\)).
Now how many populations/groups are we comparing?
Weâre on the proportions (\(p\)) side of the tree and we have just a single population/group/sample â all Americans who have chosen not to go to college. What is the formula for the standard error (\(S_E\)) in this situation?
The standard error (rounded to four decimal places) is:
The standard error formula is \(S_E = \sqrt{p(1-p)/n}\). Here \(p = 0.48\) and \(n = 331\). Use SQRT() in your spreadsheet.
Find a blank cell and type =SQRT(___*(1-___)/___) with the blanks filled in by the appropriate values.
In your spreadsheet, type =SQRT(0.48*(1-0.48)/331) and press Enter. Round to four decimal places.
The distribution to be used is:
Weâve only encountered the normal distribution so far. There are other times where the tree will point us to different distributions. Weâll encounter those over the next several activities.
The desired level of confidence is:
Check the scenario description.
The critical value is:
The critical value for common confidence levels is shown at the top of the Standard Error Decision Tree, and also in the table from the Topic 11 activity.
On the tree, the critical values are next to each of the four most common confidence levels. The critical values are under the heading \(z_{\alpha/2}\).
The correct expression for computing the confidence interval is:
The confidence interval formula is \((\text{point estimate}) \pm (\text{critical value}) \cdot S_E\). Which values fill each role here?
The correct lower and upper bounds for the confidence interval are:
Use two separate cells in your spreadsheet â one for the lower bound and one for the upper bound.
The lower bound subtracts the margin of error from the point estimate; the upper bound adds it. The margin of error is the critical value multiplied by the standard error. That is, (\(\left(\text{critical value}\right)\cdot S_E\)).
In your spreadsheet, type =0.48-(1.65*0.0275) for the lower bound and =0.48+(1.65*0.0275) for the upper bound and press Enter on each.
Lower bound: =0.48-(1.65*0.0275) â approximately 0.4346.
Upper bound: =0.48+(1.65*0.0275) â approximately 0.5254.
The correct interpretation of this confidence interval is:
A confidence interval captures a population parameter â not a sample statistic.
Find the correct interpretation template at the bottom of the General Strategy for Constructing a Confidence Interval document
The correct template is: âWe are [XX]% confident that the true [population parameter] is between [lower] and [upper].â
Fill in the bracketed (â[]â) components with the appropriate items given your scenario.
The sample wasnât representative of all Americans. There was another restriction â all Americans who chose not to go to collegeâŚ. Make sure you include this restriction in your interpretation.
Does your interval suggest that a majority of Americans choosing not to go to college have made that choice because they cannot afford it?
A majority would mean the proportion exceeds 50% (0.50).
Look at your confidence interval bounds. Are proportions of 50% or lower plausible?
The interval contains population proportions above 50%, but also proportions below 50%. Since proportions below 50% are plausible, the interval does not suggest that a majority of Americans choosing not to go to college are making that choice because they cannot afford it.
It could be a majority but it could also be a minority.
Scenario 1b: Consider the same scenario. Suppose we wanted the margin of error for the 90% confidence interval to be about 1.5%. How large of a sample would you recommend?
Use your spreadsheet for any necessary computations.
To answer the question as asked, we should:
The value of \(z_{\alpha/2}\) is:
There are two formulas for calculating required sample size on the Standard Error Decision Tree document, can you find them?
The sample size formula for a proportion is \(n \geq \left(\frac{z_{\alpha/2}}{M_E}\right)^2 p(1-p)\).
The value \(z_{\alpha/2}\) is the critical value corresponding to the desired confidence level. What confidence level is requested?
As a reminder, you can find the critical value in the small table in the top-center of the decision tree document. The critical value corresponding to 90% confidence is 1.65.
The value of the margin of error (\(M_E\)) is:
The problem states a desired margin of error of 1.5%. Be careful about units â proportions in our formula are expressed as decimals, not percentages.
The value of \(p\) (the estimate for the proportion) should be:
Using \(p = 0.50\) is a conservative choice that maximizes the required sample size â itâs appropriate when we have no prior information about the proportion. Here, we have a sample estimate of 0.48, so we use that instead. Using 0.50 would have led us to recommend a slightly larger sample than necessary.
The required sample size is:
The sample size formula for a proportion is \(n \geq \left(\frac{z_{\alpha/2}}{M_E}\right)^2 p(1-p)\).
Find a blank cell in your spreadsheet and type =((___/___))^2*(___)*(1 - ___), filling in the blanks with the appropriate values.
The final two blanks are filled in by our best guess at the population proportion (\(p\)). So that partial formula is: =((___/___))^2*(0.48)*(1 - 0.48).
How are the first two blanks filled in?
The first two blanks make up the fraction. This is the critical value (1.65) divided by the desired margin of error (0.015). In your spreadsheet, type =((1.65/0.015)^2)*0.48*(1-0.48) and press Enter.
Can you sample a fraction of a person? Think about whether you should round up or round down.
The formula gives approximately 3,020.16. Always round up to the nearest whole number when determining a required sample size â rounding down would fail to achieve the desired margin of error. The answer is 3,021.
Scenario 2: A USA Today/Gallup poll conducted between 2010 and 2011 asked a group of unemployed and underemployed Americans if they had major problems in their relationships with a spouse or close family member as a result of their employment situation. There were 27% of the 1,145 unemployed respondents and 25% of the 675 underemployed respondents who said they had experienced major relationship problems due to their employment. Conduct a test to determine whether an association exists between the presence of relationship problems and employment status (unemployed vs. underemployed). Use \(\alpha = 0.05\).
Use your spreadsheet for all calculations. Youâll encounter three graded cells among the series of questions below which will check your computed values. Enter the result from your spreadsheet into each cell and press Submit Answer.
To answer the question as asked, we should:
The problem asks whether an âassociation existsâ. Youâre being asked to evaluate a statistical claim. Which type of inference task does that correspond to?
The hypotheses associated with this test are:
How many groups/populations are being compared here?
Weâre comparing two populations (those who are unemployed and those who are underemployed). Are the responses to the question theyâre being asked best summarized using a mean (\(\mu\)) or a proportion (\(p\))?
The question âHave you experienced relationship problems with a spouse or a close family member as a result of your employment situation?â results in a yes/no response. This sorts participants into categories. We summarize categorical variables via proportions.
The null hypothesis (\(H_0\)) is the skeptical claim â âthereâs nothing to see hereâ, while the alternative hypothesis (\(H_a\)) is the claim being tested.
The null hypothesis is that the proportions across the two groups are equal. There is no association between the presence of relationship problems due to employment and the employment status itself. The alternative is that there is an association â the proportions are not the same across the two groups.
The null value is:
The null value is the expected difference in the sample proportions if the null hypothesis is true.
The null value is the number on the right-hand side of the equals sign in the null hypothesis \(H_0\).
The point estimate is:
The point estimate is the âsample versionâ of the expression on the left-hand side of the null hypothesis.
Since \(H_0\) involves \(p_{\text{unemployed}} - p_{\text{underemployed}}\), the point estimate is \(\hat{p}_{\text{unemployed}} - \hat{p}_{\text{underemployed}}\).
\(\hat{p}_{\text{unemployed}} - \hat{p}_{\text{underemployed}} = 0.27 - 0.25 = 0.02\).
How many groups are being compared in this study?
The standard error formula is:
Start at the top of the decision tree. What side are we on, proportions (\(p\)) or means (\(\mu\))?
Weâre working with proportions here, so weâre on the left side of the tree. How many groups/populations are we comparing?
Weâre comparing two groups. What is the formula for the standard error in this situation?
The standard error is \(\displaystyle{S_E = \sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}}}\).
Now compute the standard error in your spreadsheet and enter your result below. If you do any rounding during intermediate steps, carry at least five decimal places.
The standard error formula for comparing two proportions is: \[S_E = \sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}}\]
In your spreadsheet, use SQRT() with two terms added inside it.
The standard error formula for comparing two proportions is: \[S_E = \sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}}\]
Here \(p_1 = 0.27\), \(n_1 = 1145\), \(p_2 = 0.25\), and \(n_2 = 675\).
The standard error formula for comparing two proportions is: \[S_E = \sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}}\]
In your spreadsheet, type =SQRT((0.27*(1-0.27)/1145)+(0.25*(1-0.25)/675)) and press Enter.
sqrt((0.27 * 0.73 / 1145) + (0.25 * 0.75 / 675))
sqrt((0.27 * 0.73 / 1145) + (0.25 * 0.75 / 675))The calculation of the standard error above is difficult because of how much grouping you need to do with parentheses. It can be beneficial to break the calculation up â use a blank cell to calculate the first fraction \(\displaystyle{\frac{p_1\left(1 - p_1\right)}{n_1}}\), another blank cell for the second fraction \(\displaystyle{\frac{p_2\left(1 - p_2\right)}{n_2}}\), and then a third blank cell to calculate the square root of the sum of those two values.
Now compute the test statistic in your spreadsheet and enter your result below.
The test statistic formula is: \[\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\]
The test statistic formula is: \[\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\]
You have all three ingredients: point estimate (0.02), null value (0), and the standard error you just computed (~0.0212).
The test statistic formula is: \[\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\]
In your spreadsheet, type =(0.02-0)/0.0212 and press Enter.
se <- sqrt((0.27 * 0.73 / 1145) + (0.25 * 0.75 / 675))
(0.27 - 0.25) / se
se <- sqrt((0.27 * 0.73 / 1145) + (0.25 * 0.75 / 675))
(0.27 - 0.25) / seThe distribution to be used is:
Weâve still only encountered the normal distribution for inference. Thatâs the one for now. As a reminder, weâll encounter other distributions as we work our way into different parts of the decision tree through the coming activities.
Now compute the \(p\)-value in your spreadsheet and enter your result below.
The alternative hypothesis uses \(\neq\), making this a two-tailed test. That means we calculate the area in one tail and multiply by 2.
The alternative hypothesis uses \(\neq\), making this a two-tailed test. That means we calculate the area in one tail and multiply by 2. Since our test statistic is positive, the relevant tail is the upper (right) tail.
The alternative hypothesis uses \(\neq\), making this a two-tailed test. That means we calculate the area in one tail and multiply by 2. Since our test statistic is positive, the relevant tail is the upper (right) tail.
Calculating the area in the upper tail requires using 1 - NORM.DIST().
The alternative hypothesis uses \(\neq\), making this a two-tailed test. That means we calculate the area in one tail and multiply by 2. Since our test statistic is positive, the relevant tail is the upper (right) tail.
Because of this, weâll calculate the \(p\)-value in an empty cell by typing =2*(1 - NORM.DIST(___, ___, ___, TRUE)), where the first blank is the boundary value (test statistic). After using the test statistic formula, weâre on the standard normal distribution, so the second blank is 0 and the third blank is 1.
Using an empty cell, the \(p\)-value is =2*(1 - NORM.DIST(0.9434, 0, 1, TRUE)).
se <- sqrt((0.27 * 0.73 / 1145) + (0.25 * 0.75 / 675))
z <- (0.27 - 0.25) / se
2 * (1 - pnorm(abs(z)))
se <- sqrt((0.27 * 0.73 / 1145) + (0.25 * 0.75 / 675))
z <- (0.27 - 0.25) / se
2 * (1 - pnorm(abs(z)))The result of the test is:
Compare your computed \(p\)-value to \(\alpha = 0.05\). Is the \(p\)-value smaller than \(\alpha\), or larger?
If the \(p\)-value is at least as large as \(\alpha\), our observed data would not be very surprising under the null hypothesis. What does that mean for our decision?
If our data is not very surprising under the null hypothesis, then maybe it was generated from a reality where that null hypothesis is true.
We donât have evidence to support rejecting the null hypothesis here, but we canât accept the null hypothesis either.
The result of the test stated in context means that:
Failing to reject the null hypothesis is not the same as proving it true. What can we say â and what can we not say â based on the test result?
The null hypothesis for this scenario assumed that the two group proportions \(p_1\) and \(p_2\) were equal. We ignored this fact in our estimate for the standard error. A better approach would be to pool the proportions \(\displaystyle{p_{\text{pooled}} = \frac{p_1\cdot n_1 + p_2\cdot n_2}{n_1 + n_2}}\) and then calculated the standard error as \(\displaystyle{S_E = \sqrt{p_{\text{pooled}}\left(1 - p_{\text{pooled}}\right)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}\).
Note that this pooling approach is indeed better because it accurately reflects the assumption made in the null hypothesis for the test. That being said, we leave pooling proportions out of scope for this activity series at this time.
Good work through these practice problems! Remember to download or print copies of the Standard Error Decision Tree, the General Strategy for Conducting a Hypothesis Test, and the General Strategy for Constructing a Confidence Interval. Youâll refer back to these documents often as you gain familiarity and confidence with statistical inference.
Submit
If you are part of a course with an instructor who is grading your work on these activities, please copy and submit both of the hashes below using the method your instructor has requested.
The hash below encodes your responses to the multiple choice and checkbox questions in this activity.
Click the button below to generate your exercise submission code. This hash encodes your work on the graded exercises in this activity.
You must have attempted the graded exercises before clicking â clicking generates a snapshot of your current results. If you have completed the activity over multiple sessions, please go back through and enter your answer in each graded exercise cell before generating the hash below, to ensure your most recent results are recorded.
Summary
- The Standard Error Decision Tree is your primary reference for identifying which standard error formula applies to a given inference problem. You walk through the tree by asking and answering a series of questions about your inference scenario.
- Confidence intervals and hypothesis tests follow a structured process. The general strategy documents walk you through each step â lean on them until you are comfortable with the procedures.
- Sample size planning allows you to determine how large a sample is needed to achieve a desired margin of error before data collection begins. Using a prior estimate of the proportion (when available) gives a more efficient answer than defaulting to \(p = 0.50\). In a spreadsheet, use
=((z/ME)^2)*p*(1-p)and always round up to the nearest whole number. - Two-proportion hypothesis tests compare the difference in proportions across two groups. The null hypothesis is typically that the difference is zero, and the standard error formula accounts for both groupsâ sample sizes and proportions.
- For the two-tailed p-value, remember that we need to account for both the lower- and upper-tail areas. This is most easily handled by doubling a single tail area. Be sure to draw a picture to help you determine whether you can use
=2*NORM.DIST()or if you need=2*(1 - NORM.DIST()). - When a \(p\)-value exceeds \(\alpha\), we do not have sufficient evidence to reject the null hypothesis â but this is not the same as proving the null is true. Absence of evidence is not evidence of absence.
The inference framework youâve been practicing here will carry forward unchanged throughout the rest of our course. What will change is the specific standard error formula and distribution used, depending on whether youâre working with proportions or means and one, two, or more than two groups. The decision tree will guide you through identifying the appropriate standard error formula and distribution. In the coming activities, weâll explore more of the tree, but our general approaches to inference tasks will remain consistent.