Topic 15: Hypothesis Tests and Confidence Intervals for Numerical Data (Spreadsheets)
This activity introduces techniques for inference on a single population mean and for comparing two population means. The \(t\)-distributions are introduced, historical context is provided, and we work through two applications using federal sentencing data on drug-related convictions from the Southern District of New York State.
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.
Through the beginning of this activity, you’ll be asked to use empty cells on a blank excel sheet for calculations. After this initial section, you’ll work with actual criminal sentencing data from the Southern District of New York State. Use the links below to obtain a copy of the spreadsheet containing the relevant data.
- If you are a Google Sheets user, click here to create a copy of the spreadsheet for this activity
- If you are an Excel user, click here to download a copy of the spreadsheet for this activity
Hypothesis Testing and Confidence Intervals for Numerical Data
In this activity, we continue our exploration of statistical inference. Through the past few activities you’ve become more comfortable with hypothesis testing and confidence intervals for categorical variables. Here we extend those frameworks to numerical variables. We’ll first be formally introduced to the family of \(t\)-distributions, and then work through a pair of applications to real criminal sentencing data.
As a reminder, the Standard Error Decision Tree, General Strategy for Conducting Hypothesis Tests, and General Strategy for Constructing Confidence Intervals are all available for reference. The walkthrough video for the decision tree is below, in case you’d like a refresher.
While watching the walkthrough video you probably noticed that the side of the decision tree corresponding to numerical data (inference for the mean, \(\mu\)) is more complex than the side for proportions. Much of this stems from the fact that using a sample standard deviation (\(s\)) as an approximation for the population standard deviation (\(\sigma\)) adds uncertainty to our estimate of the sampling distribution. To account for this added uncertainty, we utilize a class of penalized normal distributions called the \(t\)-distributions. Watch at least one of the introductory videos below.
A Detailed Introduction:
A Shorter Introduction:
What Does the \(t\)-Distribution Look Like?
The videos above have helped us identify scenarios where we should utilize a \(t\)-distribution instead of the standard normal (\(z\)) distribution. There is a simple rule to follow that will help you decide which distribution to use: any time we use a sample standard deviation as a proxy for the population standard deviation in our estimate for the standard error, we should use a \(t\)-distribution.
The plot below shows the standard normal distribution in black, a \(t\)-distribution with 3 degrees of freedom in red, and a \(t\)-distribution with 12 degrees of freedom in blue.

Notice that all three distributions are bell-shaped, but the \(t\)-distributions have fatter tails than the normal distribution. This means that the \(t\)-distributions have more area/probability in their tails than the standard normal distribution. Also notice that the \(t\)-distribution with 12 degrees of freedom is more similar to the standard normal distribution than the one with 3 degrees of freedom. As degrees of freedom increase, the \(t\)-distribution approaches (becomes more like) the normal distribution.
Using the \(t\)-Distributions
When we introduced the normal distribution, we identified two helper functions that you could use in your spreadsheet formulas: NORM.DIST() to find probabilities (areas to the left of a boundary value) and NORM.INV() to find percentile cutoffs. We have analogous functions for the \(t\)-distribution:
=T.DIST(q, df, TRUE)— finds the probability of a randomly chosen observation falling to the left of the boundary valueqin a \(t\)-distribution withdfdegrees of freedom.=T.INV(p, df)— finds the cutoff value for which the area to the left of that cutoff in a \(t\)-distribution withdfdegrees of freedom isp.
Note that unlike NORM.DIST() and NORM.INV(), these functions have no mean or standard deviation arguments — we always work with standardized variables (via the test statistic formula) when using the \(t\)-distributions.
Let’s practice. Don’t forget to draw pictures — you are much more likely to make mistakes if you skip this step. Use the BlankSheet tab of the spreadsheet you copied at the beginning of this activity for your calculations.
Question 1: Find \(\mathbb{P}\left[t <\right.\) \(\left.\right]\) in a \(t\)-distribution with degrees of freedom.
In your spreadsheet, compute this probability and enter your result below.
Start by drawing a \(t\)-distribution centered at 0. Where does fall — to the left or right of center? Shade the region to the left of your boundary value. Should your answer be larger or smaller than 0.5?
T.DIST() with TRUE as the third argument gives the area to the left of your boundary value — exactly what we want here. In your spreadsheet, type =T.DIST(___, ___, TRUE) with the boundary value as the first argument and the degrees of freedom as the second.
In your spreadsheet, type =T.DIST(___, ___, TRUE), with the first argument filled in by (the boundary value) and the second by (the degrees of freedom). Enter the result below.
pt(boundary1, df = df1)
pt(boundary1, df = df1)Question 2: Find \(\mathbb{P}\left[t >\right.\) \(\left.\right]\) in a \(t\)-distribution with degrees of freedom.
In your spreadsheet, compute this probability and enter your result below.
Draw the \(t\)-distribution and shade the region to the right of . Note that is negative — it falls to the left of center. Should your answer be larger or smaller than 0.5?
T.DIST() with TRUE always gives the area to the left. For a right-tail probability, subtract that result from 1.
In your spreadsheet, type =1 - T.DIST(___, ___, TRUE). Can you fill in the blanks?
In your spreadsheet, type =1 - T.DIST(___, ___, TRUE), where the first blank is filled by (the boundary value) and the second by (the degrees of freedom). Enter the result in the code block.
1 - pt(boundary2, df = df2)
1 - pt(boundary2, df = df2)Question 3: Find the cutoff value in a \(t\)-distribution with degrees of freedom for which the area to the left of the cutoff is .
In your spreadsheet, compute this cutoff and enter your result below.
We are looking for a boundary (cutoff) value rather than a probability. Which function gives us a boundary value — T.DIST() or T.INV()?
Use T.INV() since we want a boundary value.
Draw a picture of the \(t\)-distribution with of the area shaded to the left of a cutoff value. Should your cutoff value be positive or negative? How do you know?
Since the area to the left ( ) is more than 0.5, the boundary value we are looking for must be to the right of the middle of the distribution. The \(t\)-distributions are all centered at 0, so our boundary value must be positive.
In a blank cell of your spreadsheet, use =T.INV(___, ___) where the first argument is the area to the left of the boundary value we are seeking and the second argument is the degrees of freedom for the \(t\)-distribution.
In a blank cell of your spreadsheet, use =T.INV(___, ___) where the first argument is (the area to the left of the boundary value we are seeking) and the second argument is (the degrees of freedom for the \(t\)-distribution).
qt(area3, df = df3)
qt(area3, df = df3)Question 4: Find the critical value associated with a % confidence interval using a \(t\)-distribution with degrees of freedom.
In your spreadsheet, compute this critical value and enter your result below.
Start by drawing a \(t\)-distribution.
A % confidence interval captures the middle % of the distribution. How much area is left over for the two tails combined, and how much is in each tail individually?
The remaining area is , which will be split equally between the two tails. This means that each tail contains an area of .
The remaining area is , which will be split equally between the two tails. This means that each tail contains and area of .
The critical value is the boundary separating the upper tail from the rest of the distribution. What is the total area to the left of that boundary?
The area to the left of the critical value is the lower tail area plus the middle area: + = .
Use T.INV() with this area and the degrees of freedom.
In your spreadsheet, type =T.INV(___, ___), with the first blank filled by and the second blank filled by . Enter the result in the code cell.
qt(1 - (1 - clevel4/100)/2, df = df4)
qt(1 - (1 - clevel4/100)/2, df = df4)We’ve now practiced with two spreadsheet new functions for working with \(t\)-distributions:
=T.DIST(q, df, TRUE)— returns the area to the left of the boundary valueqin a \(t\)-distribution withdfdegrees of freedom. This is the \(t\)-distribution analog of=NORM.DIST(q, 0, 1, TRUE).=T.INV(p, df)— returns the boundary value for which the area to the left ispin a \(t\)-distribution withdfdegrees of freedom. This is the \(t\)-distribution analog of=NORM.INV(p, 0, 1).
As with the normal distribution, you will need to think carefully about how to use these functions to obtain the quantities (areas/probabilities or boundary values) that you are looking for. Drawing a picture will help you.
Applications to Criminal Sentencing
We’ll work with a dataset on Federal Sentencing from the Southern District of New York State. The full dataset is available to you on the SDNYfull tab of the spreadsheet you copied at the beginning of this activity, and the records filtered to only include sentences from drug-related convictions is available on the SDNYdrug tab.
Open you spreadsheet and switch to the SDNYdrug tab. You’ll complete the work for the next scenarios on that tab.
You’ll benefit by recalling and refreshing on the following items. Check back in on the Topic 2: Introduction to Spreadsheets and Topic 3: Descriptive Statistics activities for more details.
- Working with ranges of cells is done via
top_left_cell:bottom_right_cell. That is,C2:F23selects all the cells in the rectangular grid from cellC2(third column, second row) to cellF23(sixth colum, twenty-third row). Similarly,C2:C500selects all the cells in columnCbetween row 2 and row 500. - Spreadsheet software has built-in functions like
AVERAGE(),STDEV(),COUNT(), and more that allow you to quickly run calculations over a range. - Creating grouped summaries can be done via Pivot Tables. You create a pivot table by clicking on a cell inside of your data range, navigating to Insert, and then choosing Pivot Table.
There will be robust hint sequences to help you along the way when you get stuck.
Task 1: Confidence Interval for Average Sentence Length
Construct a 95% confidence interval for the average sentence length for a drug-related conviction in the Southern District of New York State.
To answer the question as asked, we should:
Use an empty cell on the SDNYdrug tab of your spreadsheet to calculate the average sentence length for drug-related convictions in the Southern District of New York State. Enter your result in the code cell below.
Open the SDNYdrug tab of the spreadsheet and find a blank cell to type your formula into.
You want to calculate an average, so your formula will take the form =AVERAGE(___). What is the range of cells you are averaging over?
You want to calculate an average, so your formula will take the form =AVERAGE(___). What is the range of cells you are averaging over?
The sentence lengths, measured in months, are in column F of the sheet.
You want to calculate an average, so your formula will take the form =AVERAGE(___). What is the range of cells you are averaging over?
The sentence lengths, measured in months, are in column F of the sheet and the values are populating rows 2 through 281.
You want to calculate an average, so your formula will take the form =AVERAGE(___). What is the range of cells you are averaging over?
The sentence lengths, measured in months, are in column F of the sheet and the values are populating rows 2 through 281. The range is F2:F281.
Calculate the average sentence length in a blank cell using =AVERAGE(F2:F281). Enter the result in the code cell.
Don’t forget to label the cell so that you don’t forget what it contains.
mean(SDNYdrug$SentenceMonths)
mean(SDNYdrug$SentenceMonths)The standard error formula is:
Open the Standard Error Decision Tree and start from the top of the tree.
Are we conducting inference on a mean (\(\mu\)) or a proportion (\(p\))?
The question “How long was the sentence associated with this conviction?” is answered with a number of months. This is numerical data that is best summarized by a mean. We’re on the right side of the tree.
How many groups/populations are we comparing? Do we know the population standard deviation, \(\sigma\)?
We have just a single population here – all of the individual sentences belong to one group. We don’t know the population standard deviation in sentence lengths.
Note that we can calculate the standard deviation in sentence lengths, but that will only the the standard deviation for the sentences in our sample (\(s\)).
What is the standard error (\(S_E\)) from the box you landed in?
Using your spreadsheet, calculate the standard error for the average sentence length.
Find a blank cell and calculate the standard deviation in sentence lengths first.
You can use =STDEV(___) to calculate the standard deviation. What is the range of values you’re calculating the standard deviation over?
We’re still working with the sentence lengths in months, so the range is the same as it was when we calculated the average sentence length. Use =STDEV(F2:F281) to find the standard deviation and label this cell so that you don’t forget what the number means.
Now find the number of observations.
Now find the number of observations. There are a few ways to do this:
- Recall that your range spanned the cells
F2:F281– there are 280 cells in that range. - Highlight all the cells in the range
F2:F281. Your spreasheet software should tell you the number of cells you have selected near the bottom-right of your window, just below the spreadsheet area. - \(\bigstar\) A formula using
=COUNT(F2:F281)will count all of the cells in the range that contain numeric values. This is the best approach because the others will ignore missing values and your count may be too high.
Now that you have the standard deviation in sentence lengths (about 53.9147 months) and the total sample size (280 observations), compute the standard error using the formula \(S_E = s/\sqrt{n}\)
Using a blank cell, type =53.9147/SQRT(280) (or even better, do the calculation by referencing the cells containing the standard deviation and sample size). Be sure to label the cell and then type the resulting value into the code block.
sd(SDNYdrug$SentenceMonths) / sqrt(nrow(SDNYdrug))
sd(SDNYdrug$SentenceMonths) / sqrt(nrow(SDNYdrug))The distribution to be used is:
The *Standard Error Decision Tree tells you which distribution to use.
Check the box you landed in when finding the standard error (\(S_E\)) formula.
If that box is not a specialty box (ANOVA or \(\chi^2\)) and it contains information about degrees of freedom (\(df\)), then you’re using a \(t\)-distribution with that number of degrees of freedom. Otherwise, you’re using the normal distribution.
The desired level of confidence is:
Now use your spreadsheet to compute the critical value for the confidence interval and enter your result below.
You’ll need to use T.INV().
You’ll nedd to use T.INV(). For a 95% confidence interval, the middle 95% of the distribution is captured, leaving 5% split equally between the two tails. Draw a picture and determine the total area to the left of the upper-tail boundary value (the critical value).
Each tail holds 2.5% of the area, so the total area to the left of the critical value is 0.025 + 0.95 = 0.975. The degrees of freedom is \(n - 1\) where \(n\) is your sample size.
With \(n = 280\), the degrees of freedom is 279. In your spreadsheet, type =T.INV(0.975, 279). Label the cell and input the result into the code block.
qt(0.975, df = nrow(SDNYdrug) - 1)
qt(0.975, df = nrow(SDNYdrug) - 1)With so many observations, the correct critical value differs very little from 1.96 (the value obtained from the normal distribution). Remember that the critical values on the Standard Error Decision Tree are for the normal distribution only. Any time we use a sample standard deviation as a stand-in for the population standard deviation, we should use T.INV() — this will make a larger difference when sample sizes are smaller.
Now use your spreadsheet to compute the lower bound of the 95% confidence interval and enter your result below.
The confidence interval formula is \((\text{point estimate}) \pm (\text{critical value}) \times S_E\). For the lower bound, we subtract the margin of error from the point estimate.
The confidence interval formula is \((\text{point estimate}) \pm (\text{critical value}) \times S_E\).
You have all three values from earlier steps: the point estimate (~42.75 months), the critical value (~1.97), and the standard error (~3.22 months). In your spreadsheet, type =42.75-(1.97*3.22) and press Enter.
mean(SDNYdrug$SentenceMonths) -
qt(0.975, df = nrow(SDNYdrug) - 1) *
(sd(SDNYdrug$SentenceMonths) / sqrt(nrow(SDNYdrug)))
mean(SDNYdrug$SentenceMonths) -
qt(0.975, df = nrow(SDNYdrug) - 1) *
(sd(SDNYdrug$SentenceMonths) / sqrt(nrow(SDNYdrug)))Now compute the upper bound and enter your result below.
Same approach as the lower bound — just add the margin of error instead of subtracting it. In your spreadsheet, type =42.75+(1.97*3.22) and press Enter.
mean(SDNYdrug$SentenceMonths) +
qt(0.975, df = nrow(SDNYdrug) - 1) *
(sd(SDNYdrug$SentenceMonths) / sqrt(nrow(SDNYdrug)))
mean(SDNYdrug$SentenceMonths) +
qt(0.975, df = nrow(SDNYdrug) - 1) *
(sd(SDNYdrug$SentenceMonths) / sqrt(nrow(SDNYdrug)))Which of the following is the correct interpretation of this confidence interval?
Does this sample provide evidence to suggest that the average sentence length for drug-related charges in the Southern District of New York State exceeds three years (36 months)?
Task 2: Hypothesis Test for Difference in Sentence Lengths
Conduct a hypothesis test at the \(\alpha = 0.10\) level of significance to determine whether the sample data provides significant evidence that the average sentence length for white offenders and the average sentence length for non-white offenders differs for drug-related cases in the Southern District of New York State.
To answer the question as asked, we should:
What is the level of significance associated with this test?
Does this hypothesis test involve testing a statement about a mean (\(\mu\)), a proportion (\(p\)), or something else?
How many groups are being compared in this test?
Which of the following are the hypotheses associated with this test?
The null hypothesis (\(H_0\)) is a skeptical claim – “there’s nothing to see here”, while the alternative hypothesis (\(H_a\)) is the claim to be tested.
The claim we’re investigating asks whether or not there is a difference in the average sentence lengths.
Do we know the population standard deviations (\(\sigma\)) for sentence lengths in each group?
Are the observations in the two groups (sentences handed to white offenders and sentences handed to non-white offenders) paired?
Which standard error formula should be used?
Walk through the standard error decision tree using the answers to the questions above.
Which distribution does the test statistic follow?
The box containing your standard error (\(S_E\)) tells you what distribution to use.
If your box contains information about degrees of freedom (\(df\)), then you’re using a \(t\) distribution with that number of degrees of freedom.
Walk through the following steps to calculate the values you’ll need to construct your test statistic.
- Open the
SDNYdrugtab of your spreadsheet. - Click into the data range – somewhere in columns
AthroughF. - Use Insert and choose Pivot Table.
- Verify that the range contains cells from
A1:F281, and approve creating the pivot table in a new sheet. - Drag the
Racecolumn to the Rows field for the pivot table. - Drag the
SentenceMonthscolumn to the Values field for the pivot table. - Change the default summary value to
COUNT. In Google Sheets, you can use the dropdown menu for this. In Excel, click the small “info” icon to the right of the summary value name in the Values field and then choose to summarize by Count. - Repeat steps 6 and 7 twice. You’ll drag the
SentenceMonthscolumn to the Values field and update it to compute theAVERAGEand then again to compute the standard deviation (STDEV).
Number of white offenders: Input the number of white offenders whose sentences we have in our sample below.
length(whiteSentences)
length(whiteSentences)Number of non-white offenders: Input the number of non-white offenders whose sentences we have in our sample below.
length(nonWhiteSentences)
length(nonWhiteSentences)Average sentence length — white offenders: Input the average sentence length for white offenders below.
mean(whiteSentences)
mean(whiteSentences)Average sentence length — non-white offenders: Input the average sentence length for non-white offenders below.
mean(nonWhiteSentences)
mean(nonWhiteSentences)Standard deviation in sentence lengths — white offenders: Input the standard deviation in sentence lengths for white offenders below.
sd(whiteSentences)
sd(whiteSentences)Standard deviation in sentence lengths — non-white offenders: Input the standard deviation in sentence lengths for white offenders below.
sd(nonWhiteSentences)
sd(nonWhiteSentences)Now let’s put the pieces together. Use your spreadsheet for all of the calculations below.
The population parameter in question for this hypothesis test is:
The population parameter here is the difference in population means.
The null value is:
The null value is the expected value of the point estimate under the assumption that the null hypothesis (\(H_0\)) is true.
Check the number to the right of the equal sign in the null hypothesis.
Point estimate — compute in your spreadsheet and enter below:
The parameter is \(\mu_{\text{white}} - \mu_{\text{non-white}}\), so the point estimate is the difference in sample means.
The parameter is \(\mu_{\text{white}} - \mu_{\text{non-white}}\), so the point estimate is the difference in sample means. Subtract the mean sentence for non-white offenders from the mean sentence for white offenders (or vice versa — just be consistent with the way you’ve written your hypotheses).
mean(whiteSentences) - mean(nonWhiteSentences)
mean(whiteSentences) - mean(nonWhiteSentences)Standard error — compute in your spreadsheet and enter below:
The standard error formula is \(S_E = \sqrt{s_1^2/n_1 + s_2^2/n_2}\). You have all four quantities in your pivot table. Use a blank cell in your spreadsheet for your calculation.
In your spreadsheet, type =SQRT((___^2/___)+(___^2/___)) substituting the appropriate values for the blanks. You can either type the values in (just be sure to keep at least four decimal places) or use cell references in the calculation.
In your spreadsheet, type =SQRT((___^2/___)+(___^2/___)) substituting the appropriate values for the blanks. You can either type the values in (just be sure to keep at least four decimal places) or use cell references in the calculation.
- Fill the first blank with the standard deviation for the sentences passed down to white offenders.
- Fill the second blank with the number of sentences to white offenders in our sample data.
- Fill the third blank with the standard deviation for the sentences passed down to non-white offenders.
- Fill the final blank with the number of sentences to non-white offenders in our sample data.
sqrt((sd(whiteSentences)^2 / length(whiteSentences)) +
(sd(nonWhiteSentences)^2 / length(nonWhiteSentences)))
sqrt((sd(whiteSentences)^2 / length(whiteSentences)) +
(sd(nonWhiteSentences)^2 / length(nonWhiteSentences)))Test statistic — compute in your spreadsheet and enter below:
The test statistic formula is \(\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\). You have all three components from the steps above. In your spreadsheet, type =(___ - ___)/___ substituting your computed values.
The test statistic formula is \(\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\). You have all three components from the steps above. In your spreadsheet, type =(___ - 0)/___ substituting your computed values.
- The second blank is the null value.
The test statistic formula is \(\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\). You have all three components from the steps above. In your spreadsheet, type =(-14.92 - 0)/___ substituting your computed values.
- The second blank is the null value.
- The first blank is the point estimate.
The test statistic formula is \(\text{test statistic} = \frac{(\text{point estimate}) - (\text{null value})}{S_E}\). You have all three components from the steps above. In your spreadsheet, type =(-14.92 - 0)/6.99 substituting your computed values.
- The second blank is the null value.
- The first blank is the point estimate.
- The final blank is the standard error.
se <- sqrt((sd(whiteSentences)^2 / length(whiteSentences)) +
(sd(nonWhiteSentences)^2 / length(nonWhiteSentences)))
(mean(whiteSentences) - mean(nonWhiteSentences)) / se
se <- sqrt((sd(whiteSentences)^2 / length(whiteSentences)) +
(sd(nonWhiteSentences)^2 / length(nonWhiteSentences)))
(mean(whiteSentences) - mean(nonWhiteSentences)) / seDegrees of freedom — compute in your spreadsheet and enter below:
For a two-sample \(t\)-test, the degrees of freedom is \(\text{df} = \min(n_1 - 1, n_2 - 1)\) — one less than the smaller of the two sample sizes. Which group had fewer observations?
The white offenders group had only 37 observations while there were 243 observations for non-white offenders.
The white offenders group had only 37 observations while there were 243 observations for non-white offenders.
The degrees of freedom is one less than the smaller of the two sample sizes. That’s 36 here.
min(length(whiteSentences), length(nonWhiteSentences)) - 1
min(length(whiteSentences), length(nonWhiteSentences)) - 1\(p\)-value — compute in your spreadsheet and enter below:
Draw a picture of the \(t\)-distribution with your test statistic marked. The alternative hypothesis is two-sided (\(\neq\)), so both tails contribute to the \(p\)-value. Since both tail areas are equal, compute one tail area and double it.
The alternative hypothesis is two-sided (\(\neq\)), so both tails contribute to the \(p\)-value. Since both tail areas are equal, compute one tail area and double it.
You can use the T.DIST() function with the appropriate boundary value and degrees of freedom to calculate the tail area.
Your tail area is the area away from the center of the distribution. Depending on whether your test statistic is positive or negative, you may need to utilize 1 - T.DIST().
- If your test statistic is negative, then use
=2*T.DIST(___, ___, TRUE)with the first blank filled in by your test statistic and the second by the degrees of freedom to calculate your \(p\)-value. - If your test statistic is positive, then use
=2*(1 - T.DIST(___, ___, TRUE))with the first blank filled in by your test statistic and the second by the degrees of freedom to calculate your \(p\)-value.
se <- sqrt((sd(whiteSentences)^2 / length(whiteSentences)) +
(sd(nonWhiteSentences)^2 / length(nonWhiteSentences)))
ts <- (mean(whiteSentences) - mean(nonWhiteSentences)) / se
df <- min(length(whiteSentences), length(nonWhiteSentences)) - 1
2 * (1 - pt(abs(ts), df = df))
se <- sqrt((sd(whiteSentences)^2 / length(whiteSentences)) +
(sd(nonWhiteSentences)^2 / length(nonWhiteSentences)))
ts <- (mean(whiteSentences) - mean(nonWhiteSentences)) / se
df <- min(length(whiteSentences), length(nonWhiteSentences)) - 1
2 * (1 - pt(abs(ts), df = df))What is the result of the test?
Compare your computed \(p\)-value to \(\alpha = 0.10\). 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. If the \(p\)-value is less than \(\alpha\) then the observed data is surprising.
If our data is surprising under the null hypothesis, then there are two options. First, maybe we just happened to observe an extreme sample by chance. Second, our data wasn’t generated within a reality in which the null hypothesis (\(H_0\)) is true.
Because we observed a sample which was unlikely in the “null reality”, we reject the null hypothesis in favor of the alternative.
The result of the test means that:
Which of the following is an appropriate implication of our result?
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 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
Great work through all of that — and I hope you found the application to sentencing data in the SDNY both interesting and thought-provoking. The problems were scaffolded step-by-step deliberately, to help you see how each individual piece connects to the larger process of conducting inference with numerical data.
- The \(t\)-distributions are a family of penalized normal distributions parameterized by degrees of freedom. As degrees of freedom increase, the \(t\)-distribution becomes closer to the normal distribution.
- Use the \(t\)-distribution any time you use a sample standard deviation (\(s\)) as a substitute for the population standard deviation (\(\sigma\)) in the standard error formula.
- We have two functions for \(t\)-distribution work that you can use in your spreadsheets:
=T.DIST(q, df, TRUE)will return the area to the left of boundary valueq. Continue drawing a picture and having the picture guide you through how to useT.DIST()to calculate the area you want.=T.INV(p, df)provides the boundary value for which the area to the left isp. Use=T.INV(0.975, df)for the critical value of a 95% CI, for example.
- For a single mean, the standard error is \(S_E = s/\sqrt{n}\) and the degrees of freedom is \(n - 1\).
- For comparing two independent means, the standard error is \(S_E = \sqrt{s_1^2/n_1 + s_2^2/n_2}\) and the degrees of freedom is \(\min\{n_1 - 1, n_2 - 1\}\).
- The confidence interval and hypothesis test formulas are the same as before — what changes is the standard error formula and the function used for the critical value or \(p\)-value.
- Statistical significance does not imply proof. Our finding of a significant difference in sentence lengths is evidence that warrants further investigation — it does not prove racial bias, nor does it tell us the direction of the difference without examining the point estimate.
You’ve now completed the core statistical inference toolkit — confidence intervals and hypothesis tests for proportions, differences in proportions, means, and differences in means. In the coming activities, you’ll have the opportunity to practice applying these tools across a variety of mixed scenarios, building fluency in selecting the right method for each situation. The decision tree and general strategy documents will continue to be your primary guides.