Proportions are just means of binary (0/1) variables:
Sample:
| Party | D | R |
|---|---|---|
| Dem | 1 | 0 |
| Rep | 0 | 1 |
| Dem | 1 | 0 |
| Dem | 1 | 0 |
| Rep | 0 | 1 |
(3/5 are Dem)
Sample proportion: \[\widehat{p} = \frac{\text{total voting Dem}}{n} = \frac{1}{n}\sum_{i=1}^n D_i\] \[= \frac{1}{5}\times (1+0+1+1+0) = 3/5\]
This is just the sample mean of the 0/1 variable \(D\) at left.
In a sample of 1,100 voters, 531 suport the Democratic candidate. What proportion of all voters support the Democratic candidate?
Sample proportion: \(\widehat{p} = \frac{531}{1100} = 0.483\) (48.3%)
Standard error: \(s_{\widehat{p}} = \sqrt{\frac{\widehat{p}(1-\widehat{p})}{n}} = \sqrt{\frac{0.483 \times 0.517}{1100}} = 0.015\)
95% confidence interval: \(0.483 \pm 2(0.015) = [0.453, 0.513]\)
48.3% ± 3% = [45.3%, 51.3%] of voters support the Democratic candidate
Mexican Coke vs American Coke
Question:
Can consumers detect a difference? (Common question when changing ingredients/suppliers/processes!)
Should Coca-Cola switch to cane sugar despite higher costs?
The Setup:
Present 3 samples to each participant
2 samples are identical, 1 is different
Ask: “Which one is the odd one out?”
Even with no detectable difference, participants must choose
By pure guessing, each person has 1/3 chance of being correct
If people can detect differences, correct rate should exceed 1/3
Suppose we test 36 participants and there’s truly no difference. How many would we expect to get the right answer?
About 12 (one-third of 36). If there’s no difference, would 11 be surprising? How about 15? Or 24?
The question: Where do we draw the line between “could be chance” and “strong evidence of real difference”?
In groups of 3:
The null hypothesis represents no effect, no difference, no relationship
Examples:
We always start here, even if we believe there is an effect/difference/relationship…
Hypothesis testing is like putting the null hypothesis on trial:
Your role: Be an impartial juror
\[t = \frac{\text{estimate} - \text{hypothesized value}}{\text{standard error}}\]
If the null is true, then each participant’s decision is an independent random variable:
\[ X_i = \begin{cases} 1 & \text{with probability } p = 1/3 \\ 0 & \text{with probability } (1-p) = 2/3 \end{cases} \] From the Central Limit Theorem, \[ \hat{p}\sim N(1/3, s^2_{\hat p}) \Rightarrow \frac{\hat p - 1/3}{s_{\hat p}} \sim N(0,1) \] (approximately)
Scenario: 18 correct out of 36 participants
Interpretation: Our estimate is 2 standard errors away from the null hypothesis value
Definition: Probability of observing a test statistic at least as extreme as what we got, assuming the null hypothesis is true
For our triangle test with \(t = 2.0\), under the null hypothsesis:
Interpretation: If there’s truly no difference, only 2.5% of similar experiments would show 18+ correct answers
Figure 1: Computing the 1-tailed p-value for the triangle test with t-stat of 2.0
Question: Are SAP customers as profitable as industry average?
Data: - Sample: 81 SAP customer firms - Sample mean ROE: 12.6% - Sample standard deviation: 25.7% - Industry average ROE: 15.7%
Null Hypothesis: - \(H_0: \mu = 15.7\%\) (SAP customers have industry average profitability)
Step 1: Standard error of sample mean \[s_{\bar{X}} = \frac{s}{\sqrt{n}} = \frac{25.7}{\sqrt{81}} = 2.86\%\]
Step 2: t-statistic \[t = \frac{\bar{X} - \mu_0}{s_{\bar{X}}} = \frac{12.6 - 15.7}{2.86} = \frac{-3.1}{2.86} = -1.08\]
Step 3: p-value For two-tailed test: p-value = P(|Z| ≥ 1.08) ≈ 0.28
Common Misinterpretation: “p-value = 0.28 means there’s a 28% chance the null hypothesis is true”
This is WRONG!
For SAP Example:
Remember: The p-value assumes the null hypothesis is true to calculate the probability. It can’t tell us the probability that assumption is correct!
Common rule: Reject null hypothesis if p-value < \(\alpha\) for some \(\alpha\), usually 0.05.
Important: “Fail to reject the null” ≠ “Accept null”
A 95% confidence interval contains exactly the values that would not be rejected in a hypothesis test at α = 0.05
SAP Example:
Two hypothesis:
Why: All values in CI are within 2 standard errors of the estimate, so |t| < 2
Many business questions involve comparing groups:
We need methods to compare means and proportions between independent groups
Business Question: A tech company wants to choose between two coding training programs for new hires. Which is more effective?
Study Design: Employees randomly assigned to programs, then tested on standardized coding exercise
Data:
Goal: Estimate difference in population means and test if we have strong evidence it isn’t zero
When comparing two independent groups A and B:
Difference in sample means: \(\bar{X}_A - \bar{X}_B\)
Standard error of the difference: \[s_{\bar{X}_A - \bar{X}_B} = \sqrt{\frac{s_A^2}{n_A} + \frac{s_B^2}{n_B}}\]
where \(s_A, s_B\) are sample standard deviations and \(n_A, n_B\) are sample sizes
Null hypothesis: \(H_0: \mu_{A} - \mu_{B} = 0\) (no difference) v Step 1: Difference in means = 129 - 120 = 9 points
Step 2: Standard error of difference: \[s_{\bar{X}_A - \bar{X}_B} = \sqrt{\frac{20^2}{70} + \frac{25^2}{50}} = \sqrt{5.71 + 12.5} = 4.3\]
Step 3: t-statistic: \[t = \frac{9 - 0}{4.3} = 2.09\]
Step 4: p-value ≈ 0.037 (two-tailed)
Difference in sample means: \(129 - 120 = 9\) points
95% confidence interval for difference: \[9 \pm 2(4.3) = [0.4, 17.6]\]
Interpretation: - All plausible values are positive (0.4 to 17.6 points) - Strong evidence intensive program is more effective on average
What should the company do? It depends!
Here are all the slides for the supplier quality example together:
Business Decision: Manufacturing company choosing between two suppliers for critical components
Data from 6-month evaluation:
When comparing two independent groups A and B:
Difference in sample proportions: \(\hat{p}_A - \hat{p}_B\)
Standard error of the difference: \[s_{\hat{p}_A - \hat{p}_B} = \sqrt{\frac{\hat{p}_A(1-\hat{p}_A)}{n_A} + \frac{\hat{p}_B(1-\hat{p}_B)}{n_B}}\]
where \(\hat{p}_A, \hat{p}_B\) are sample proportions and \(n_A, n_B\) are sample sizes
95% confidence interval for difference in defect rates:
\[(\hat{p}_A - \hat{p}_B) \pm 2 \times s_{\hat{p}_A - \hat{p}_B}\]
\[0.004 \pm 2(0.00112) = 0.004 \pm 0.00224\]
\[[0.0018, 0.0062] \text{ or } [0.18\%, 0.62\%]\]
All plausible values are positive → strong evidence that Supplier A produces more defects
Null hypothesis \(H_0: p_A - p_B = 0\) (no difference in defect rates)
OK, there’s a difference. What should the company do? They puurchase 50,000 parts a year, and:
What do they save going with Supplier A (more defects)?
Best estimate (0.4% difference in defect rates):
Worst case scenario (0.62% upper limit of CI):
Remember: Large samples can detect tiny differences that don’t matter practically!