Backt Tests and Two-Way Tables: Inference for Means and Categorical Data
Study Guide - Smart Notes
Tailored notes based on your materials, expanded with key definitions, examples, and context.
t Tests and Two-Way Tables
t Distribution for Inferences About a Mean
When the population standard deviation is unknown, the t distribution is used to make inferences about the population mean. This is common in practical statistics, as the population standard deviation is rarely known.
Student's t Distribution: Used when sampling from a normal population with unknown standard deviation. For a sample of size n with sample mean \( \bar{x} \) and sample standard deviation s, the t variable is:
This follows a Student's t distribution with degrees of freedom \( df = n - 1 \).
Properties of a t Distribution
The distribution is symmetric about the mean (0).
The distribution depends on the degrees of freedom parameter (df).
The t distribution is bell-shaped, with 'thicker' tails than the standard normal distribution.
As the degrees of freedom increase, the t distribution approaches the standard normal distribution.
Critical Values for the t Distribution
Critical values are used to determine rejection regions for hypothesis tests and to construct confidence intervals.
For a given confidence level, the critical value t is the value such that the area under the curve between -t and t equals the desired confidence level.
Critical values can be found using t-distribution tables or technology (e.g., Excel).
If the exact degrees of freedom are not in the table, use the closest lower value.
Finding Critical Values for 95% Confidence
Use the column for "0.05 area in two tails" in the t-distribution table.
In Excel, use the function: =T.INV.2T(0.05, df) where df is degrees of freedom, df = n - 1.
Confidence Intervals for μ When σ is Unknown
To estimate the population mean when the population standard deviation is unknown, use the t distribution to construct a confidence interval.
where
\( \bar{x} \): sample mean
\( s \): sample standard deviation
\( n \): sample size
\( E = t \frac{s}{\sqrt{n}} \): maximum margin of error
\( t \): critical value for the desired confidence level and degrees of freedom
Note: For small samples, the population should be approximately normal. For large samples (n ≥ 30), the Central Limit Theorem applies.
Example
Given a sample of fat content in hot dogs: 25.2, 21.3, 22.8, 17.0, 29.8, 21.0, 25.5, 16.0, 20.0, 19.5
Compute \( \bar{x} \) and \( s \), then construct a 95% confidence interval for the mean fat content.
Hypothesis Tests for a Mean μ When σ is Unknown
To test hypotheses about a population mean when σ is unknown, use the t distribution with \( df = n - 1 \).
Test statistic:
Compare the test statistic to the critical value from the t table or technology.
Types of Tests:
Two-tailed test: Reject the null hypothesis only if the test statistic is greater than or equal to the critical value or less than or equal to the negative of the critical value.
Right-tailed test: Reject the null hypothesis only if the test statistic is greater than or equal to the critical value.
Left-tailed test: Reject the null hypothesis only if the test statistic is less than or equal to the negative of the critical value.
How to Find Critical Values for t
Use a t-distribution table:
"0.05 area in two tails" for a two-tailed test.
"0.05 area in one tail" for a one-tailed test.
For a left-tailed test, use the negative of the critical value listed.
Use Excel functions:
Two-tailed test: =T.INV.2T(0.05, df)
One-tailed test: =T.INV(0.05, df) (gives a negative value for left-tailed test)
P-values for t-tests
The P-value is the probability, under the null hypothesis, of obtaining a result as extreme or more extreme than the observed result. It can be found using technology or statistical tables.
Calculate the test statistic:
Use the Excel function: =T.DIST(t, df, true)
Compare the P-value to the significance level (e.g., 0.05) to decide whether to reject the null hypothesis.
Example
Given sample data and a hypothesized mean, calculate the test statistic and P-value, then state your conclusion regarding the null and alternative hypotheses.
Hypothesis Testing with Two-Way Tables
Two-Way Tables (Contingency Tables)
A two-way table (or contingency table) displays the relationship between two categorical variables by organizing one variable in rows and the other in columns. The entries are frequencies (counts).
Example Table
A&S | COB | COE | Total | |
|---|---|---|---|---|
Male | 73 | 40 | 16 | 129 |
Female | 80 | 30 | 16 | 126 |
Total | 153 | 70 | 32 | 255 |
Additional info: A&S = College of Arts & Sciences, COB = College of Business, COE = College of Engineering.
Probability Calculations from Two-Way Tables
To find the probability of a specific event, divide the relevant cell count by the grand total.
To find joint or conditional probabilities, use the appropriate row or column totals.
Example Table
Drove while drinking alcohol | Did not drive while drinking alcohol | |
|---|---|---|
Tested while driving | 731 | 3054 |
Did not test while driving | 156 | 4564 |
Expected Frequency in Two-Way Tables
The expected frequency for a cell in a two-way table is the frequency that would be expected if there were no relationship between the row and column variables.
Example
Given the above table, calculate the expected frequencies for each cell using the formula.
The χ² (Chi-Square) Statistic
The chi-square statistic measures how much the observed frequencies differ from the expected frequencies in a two-way table.
For each cell, identify the observed frequency (O) and expected frequency (E).
Calculate for each cell.
The chi-square statistic is the sum of all these values:
Hypothesis Tests with Two-Way Tables
Form the hypotheses:
Null hypothesis (H0): The row and column variables are independent.
Alternative hypothesis (Ha): The row and column variables are dependent.
Calculate the chi-square statistic.
Determine the critical value for the given confidence level using a table or technology.
Compare the test statistic to the critical value:
If is less than the critical value, do not reject H0.
If is greater than or equal to the critical value, reject H0.
How to Find Critical Values for a Chi-Square Test
Use a chi-square distribution table or technology to find the critical value for the given significance level.
In Excel, use: =CHISQ.INV(area, df), where
area = 1 - significance level
df = (number of rows - 1) × (number of columns - 1)
For example, for a 2 × 2 table and significance level 0.05, use =CHISQ.INV(0.95, 1).
Example
Given the high school student table, test the claim at the 0.05 level that texting while driving is independent of drinking while driving.
Given the undergraduate major table, test whether choice of major is independent of gender at the 0.05 significance level.
Additional info: These procedures are foundational for categorical data analysis and are widely used in social sciences, biology, and business analytics.