Topic 12: Inference Practice (Spreadsheets)

About

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.

Using a Spreadsheet Program

There are times throughout this activity where you’ll be asked to do work inside of your favorite spreadsheet program.

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!


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.

Check Your Understanding: Scenario 1a, Part I

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.

Check Your Understanding: Scenario 1a, Part II

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.

Check Your Understanding: Scenario 1a, Part III

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?

Check Your Understanding: Scenario 1a, Part IV

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.

Check Your Understanding: Scenario 1a, Part V

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.

Check Your Understanding: Scenario 1a, Part VI

The desired level of confidence is:

Check the scenario description.

Check Your Understanding: Scenario 1a, Part VII

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}\).

Check Your Understanding: Scenario 1a, Part VIII

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?

Check Your Understanding: Scenario 1a, Part IX

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.

Check Your Understanding: Scenario 1a, Part X

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.

Check Your Understanding: Scenario 1a, Part XI

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.

Check Your Understanding: Scenario 1b, Part I

To answer the question as asked, we should:

Check Your Understanding: Scenario 1b, Part II

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.

Check Your Understanding: Scenario 1b, Part III

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.

Check Your Understanding: Scenario 1b, Part IV

The value of \(p\) (the estimate for the proportion) should be:

Why Not Use p = 0.50?

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.

Check Your Understanding: Scenario 1b, Part V

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.

Check Your Understanding: Scenario 2, Part I

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?

Check Your Understanding: Scenario 2, Part II

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.

Check Your Understanding: Scenario 2, Part III

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\).

Check Your Understanding: Scenario 2, Part IV

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\).

Check Your Understanding: Scenario 2, Part V

How many groups are being compared in this study?

Check Your Understanding: Scenario 2, Part VI

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.

Hint 1

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.

Hint 2

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\).

Hint 3 (Solved)

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))
Breaking Up Complex Calculations

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.

Hint 1

The test statistic formula is: \[\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\]

Hint 2

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).

Hint 3

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) / se
Check Your Understanding: Scenario 2, Part VII

The 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.

Hint 1

The alternative hypothesis uses \(\neq\), making this a two-tailed test. That means we calculate the area in one tail and multiply by 2.

Hint 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.

Hint 3

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().

Hint 4

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.

Hint 5 (Solved)

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)))
Check Your Understanding: Scenario 2, Part VIII

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.

Check Your Understanding: Scenario 2 — IX

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?

On Pooling Proportions

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.

Question Hash

The hash below encodes your responses to the multiple choice and checkbox questions in this activity.

Exercise Hash

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

Main Takeaways
  • 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.
Looking Ahead

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.