Unit 3 Beta

Inference for Categorical Data: Proportions: the one-page sheet

3.1 Estimators

A statistic used to estimate a parameter is an estimator, and its value from one sample is a point estimate. Judge an estimator by its sampling distribution: it is unbiased when that distribution is centered at the parameter, and it has low variability when the distribution is narrow. Random selection removes bias; larger random samples reduce variability. Neither fixes the other.

  • An estimator is a statistic used to estimate a parameter: p^\hat{p} for pp, x¯\bar{x} for μ\mu. One sample's value is a point estimate.
  • Bias is about the center: an unbiased estimator has a sampling distribution centered at the parameter.
  • Variability is about the spread of the sampling distribution. For random samples, larger samples give less variability.
  • Bias comes from the method, so a larger sample does not fix it. Variability comes from sample size, so a better method alone does not fix it.
  • The best estimator has no bias and low variability: random selection plus a large enough sample.

a statistic such as p-hat is used as an estimator of the parameter, and its value is a point estimate the statistic has a sampling distribution, with a center and a spread the estimator is unbiased: it is right on average, though single samples still miss the spread of the sampling distribution shrinks, so a typical estimate lands closer to the parameter the center moves away from the parameter, and a bigger sample of the same kind does not move it back

estimator
A statistic used to estimate a parameter, such as the sample proportion <math class="stat-m"><semantics><mrow><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover></mrow><annotation encoding="application/x-tex">\hat{p}</annotation></semantics></math> for the population proportion <math class="stat-m"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math>. Its value from one sample is a point estimate.
unbiased estimator
An estimator whose sampling distribution is centered at the parameter it estimates, so it is right on average over many samples. A biased estimator's sampling distribution is centered too high or too low.

3.2 Sampling Distributions for Sample Proportions

For random samples, p-hat is centered at p with a spread that shrinks as n grows. It has mean p and standard deviation √(p(1 − p)/n) (accurate when the sample is at most 10% of the population) and is approximately normal when np ≥ 10 and n(1 − p) ≥ 10 . Then z = (p-hat − p)/(σ_(p-hat)) turns a question about a sample proportion into a normal probability, which you can tie back to a claim about p .

  • μp^=p\mu_{\hat{p}} = p and σp^\sigma_{\hat{p}}=p(1−p)n= \sqrt{\frac{p(1 - p)}{n}}, using the true pp.
  • 10% condition: nn at most 10% of the population, so the standard deviation formula holds when sampling without replacement.
  • Large counts condition: np≥10np \ge 10 and n(1−p)≥10n(1 - p) \ge 10, so the shape is approximately normal. Never "n≥30n \ge 30" for proportions.
  • When large counts fails, the distribution is skewed: right when pp is near 0, left when pp is near 1.
  • Four times the sample size halves σp^\sigma_{\hat{p}}.

averaging n of them gives σ_(p-hat) = √((p(1 − p))/n) , centered at μ_(p-hat) = p the formula is accurate only when n is at most 10% of the population: the 10% condition the sampling distribution is approximately normal: the large counts condition standardize with z = (p-hat − p)/(σ_(p-hat)) and find probabilities about p-hat from the normal distribution

large counts condition
The check that the sampling distribution of <math class="stat-m"><semantics><mrow><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover></mrow><annotation encoding="application/x-tex">\hat{p}</annotation></semantics></math> is approximately normal: at least 10 expected successes and 10 expected failures, <math class="stat-m"><semantics><mrow><mi>n</mi><mi>p</mi><mo>≥</mo><mn>10</mn></mrow><annotation encoding="application/x-tex">np \ge 10</annotation></semantics></math> and <math class="stat-m"><semantics><mrow><mi>n</mi><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo><mo>≥</mo><mn>10</mn></mrow><annotation encoding="application/x-tex">n(1 - p) \ge 10</annotation></semantics></math> (some books use 5). It is never "<math class="stat-m"><semantics><mrow><mi>n</mi><mo>≥</mo><mn>30</mn></mrow><annotation encoding="application/x-tex">n \ge 30</annotation></semantics></math>" for proportions.
10% condition
When sampling without replacement, the sample size is at most 10% of the population size. Then the selections are close to independent and the standard deviation formula for a statistic is accurate.
standard deviation of the sample proportion
The spread of the sampling distribution of the sample proportion: <math class="stat-m"><semantics><mrow><msub><mi>σ</mi><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover></msub></mrow><annotation encoding="application/x-tex">\sigma_{\hat{p}}</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">=</mo><msqrt><mfrac><mrow><mi>p</mi><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy="false">)</mo></mrow><mi>n</mi></mfrac></msqrt></mrow><annotation encoding="application/x-tex">= \sqrt{\frac{p(1 - p)}{n}}</annotation></semantics></math>, using the true proportion <math class="stat-m"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math>. Four times the sample size halves it.

3.3 Constructing a Confidence Interval for a Population Proportion

A confidence interval for p is p-hat ± z*√(p-hat(1 − p-hat)/n) : the point estimate plus or minus a margin of error. Check random, 10% and large counts (sample successes and failures at least 10) in words first. Larger samples shrink the margin of error; higher confidence levels stretch it.

  • Interval = statistic ± (critical value)(standard error). For one proportion: p^±z∗p^(1−p^)n\hat{p} \pm z^*\sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}.
  • z∗z^*: 1.645 for 90%, 1.96 for 95%, 2.576 for 99%. Area below z∗z^* is C+1−C2C + \frac{1 - C}{2}.
  • Conditions in words: random sample; nn at most 10% of the population; at least 10 successes and 10 failures in the sample.
  • Margin of error =z∗⋅SE= z^* \cdot \text{SE}. It shrinks with a larger nn (4 times nn halves it) and grows with the confidence level.
  • Name the procedure in full: one-sample z interval for a proportion.

in 95% of random samples, p-hat lands within 1.96 standard deviations of p in 95% of samples, p is within 1.96 standard deviations of p-hat we use the standard error √(p-hat(1 − p-hat)/n) in its place p-hat ± z*√((p-hat(1 − p-hat))/n) captures p for the stated share of samples

confidence interval
A range of values for a parameter, built as statistic ± (critical value)(standard error). For one proportion, the one-sample z interval is <math class="stat-m"><semantics><mrow><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mo>±</mo><msup><mi>z</mi><mo>∗</mo></msup><msqrt><mfrac><mrow><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mo stretchy="false">)</mo></mrow><mi>n</mi></mfrac></msqrt></mrow><annotation encoding="application/x-tex">\hat{p} \pm z^*\sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}</annotation></semantics></math>.
standard error
An estimate of a statistic's standard deviation computed from the sample, used when the parameter in the formula is unknown. For a proportion's interval, <math class="stat-m"><semantics><mrow><mtext>SE</mtext></mrow><annotation encoding="application/x-tex">\text{SE}</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">=</mo><msqrt><mfrac><mrow><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mo stretchy="false">)</mo></mrow><mi>n</mi></mfrac></msqrt></mrow><annotation encoding="application/x-tex">= \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}</annotation></semantics></math>.
critical value
The multiplier <math class="stat-m"><semantics><mrow><msup><mi>z</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">z^*</annotation></semantics></math> in a confidence interval: the standard normal value with the confidence level's area between <math class="stat-m"><semantics><mrow><mo form="prefix" lspace="0" rspace="0">−</mo><msup><mi>z</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">-z^*</annotation></semantics></math> and <math class="stat-m"><semantics><mrow><msup><mi>z</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">z^*</annotation></semantics></math>. It is 1.645 for 90%, 1.96 for 95% and 2.576 for 99%.
margin of error
How far a confidence interval reaches on each side of the point estimate: <math class="stat-m"><semantics><mrow><mtext>ME</mtext><mo>=</mo><msup><mi>z</mi><mo>∗</mo></msup><mo>⋅</mo><mtext>SE</mtext></mrow><annotation encoding="application/x-tex">\text{ME} = z^* \cdot \text{SE}</annotation></semantics></math>. A larger sample makes it smaller; a higher confidence level makes it larger.
conditions for inference
What must be true for an inference method to work, checked in words with numbers: random (a random sample or random assignment), 10% (when sampling without replacement), and a shape condition such as large counts.
confidence level
The success rate of the method that builds a confidence interval: for 95% confidence, about 95% of intervals built from many random samples capture the parameter. It sets the critical value.

3.4 Justifying a Claim Based on a Confidence Interval for a Population Proportion

Interpret an interval with its level, its ends and the parameter in context; interpret the level as the long-run capture rate of the method. Values inside the interval are plausible. An interval gives convincing evidence for a claim like "greater than 0.60" only when every value in it is greater than 0.60; a claimed value inside the interval is plausible, which is not the same as proven.

  • Interval: "We are 95% confident that the interval from __ to __ captures the true proportion of all __."
  • Level: "If we took many random samples of this size and built a 95% interval from each, about 95% of the intervals would capture the true proportion."
  • Values inside the interval are plausible. A claim is supported (convincing evidence) only when the whole interval is on the claimed side.
  • Never: "95% probability that pp is in the interval", "95% of the data", or anything about the sample proportion.
  • Higher confidence gives a longer interval, so more values stay plausible.

each sample gives its own interval, while the true proportion stays fixed we say we are 95% confident in one interval, because we cannot tell whether it is one of the misses it is a plausible value, so the interval gives no convincing evidence against it (and does not prove it) that value is not plausible, so the interval gives convincing evidence that the parameter is greater (or less) than it

plausible value
A value inside a confidence interval: the data are consistent with it as the parameter's value. A plausible value is not proven; values outside the interval are not plausible at that confidence level.
convincing evidence
The wording for a conclusion that the data support a claim about a parameter, as in "the interval gives convincing evidence that the true proportion is greater than 0.60". Evidence is never proof.

3.5 Setting Up a Test for a Population Proportion

Set up a test before looking at the data. Write hypotheses about p ( H_0:p = p_0 and a one-sided or two-sided H_a chosen from the question), p defined in context, a significance level α , the procedure named (one-sample z test for a proportion), and the conditions checked in words, with large counts using p_0 .

  • H0:p=p0H_0: p = p_0 always has the equals sign; HaH_a is p<p0p < p_0, p>p0p > p_0 or p≠p0p \ne p_0.
  • Hypotheses are about the parameter pp, never p^\hat{p}. Define pp in context right after them.
  • The direction of HaH_a comes from the question, before the data: never from which way the sample went.
  • α\alpha is the standard of evidence, set in advance. Smaller α\alpha, stricter standard.
  • Procedure: one-sample z test for a proportion. Conditions: random, 10%, large counts with p0p_0.

write H_0:p = p_0 (no change, the claimed value) and H_a (what the study seeks evidence for) the alternative is one-sided; with no direction ("changed") it is two-sided, p ≠ p_0 the significance level α is chosen before the data are collected large counts is checked with p_0 : np_0 ≥ 10 and n(1 − p_0) ≥ 10

null hypothesis
The two claims a significance test weighs, both about a parameter. The null hypothesis <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math> states a specific value (<math class="stat-m"><semantics><mrow><mi>p</mi><mo>=</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p = p_0</annotation></semantics></math>); the alternative hypothesis <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mi>a</mi></msub></mrow><annotation encoding="application/x-tex">H_a</annotation></semantics></math> states what the study seeks evidence for (<math class="stat-m"><semantics><mrow><mi>p</mi><mo>&lt;</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p &lt; p_0</annotation></semantics></math>, <math class="stat-m"><semantics><mrow><mi>p</mi><mo>&gt;</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p &gt; p_0</annotation></semantics></math> or <math class="stat-m"><semantics><mrow><mi>p</mi><mo>≠</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p \ne p_0</annotation></semantics></math>).
significance test
A procedure that uses sample data to weigh the evidence against a null hypothesis about a parameter. For one proportion it is the one-sample z test for a proportion.
significance level
The standard of evidence <math class="stat-m"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math> (alpha), chosen before the data are collected, often 0.05: how unlikely a result must be, if the null hypothesis is true, before the null hypothesis is doubted.
one-sided
A one-sided alternative claims a direction (<math class="stat-m"><semantics><mrow><mi>p</mi><mo>&lt;</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p &lt; p_0</annotation></semantics></math> or <math class="stat-m"><semantics><mrow><mi>p</mi><mo>&gt;</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p &gt; p_0</annotation></semantics></math>); a two-sided alternative claims only a change (<math class="stat-m"><semantics><mrow><mi>p</mi><mo>≠</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p \ne p_0</annotation></semantics></math>). The research question, not the data, decides which.
null value
The specific value of the parameter stated in the null hypothesis, written <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">p_0</annotation></semantics></math> for a proportion, as in <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub><mo>:</mo><mi>p</mi><mo>=</mo><mn>0.70</mn></mrow><annotation encoding="application/x-tex">H_0: p = 0.70</annotation></semantics></math>.

3.6 p-Values

A p-value measures how surprising the data are if H_0 is true. Assuming H_0 is true, standardize the sample proportion with z = (p-hat − p_0)/(√(p_0(1 − p_0)/n)) and find the tail area in the direction of H_a (both tails for ≠ ). That area is the p-value: the chance of a result at least as extreme as the one observed if H_0 is true. Small p-values are evidence against H_0 ; they are never the probability that H_0 is true.

  • Test statistic: zz=p^−p0p0(1−p0)/n= \frac{\hat{p} - p_0}{\sqrt{p_0(1 - p_0)/n}}, with p0p_0 in the square root.
  • p-value: the probability, assuming H0H_0 is true, of a statistic at least as extreme as observed, in the direction of HaH_a. Two-sided: double one tail.
  • Interpret: "Assuming the true proportion of all __ is p0p_0, there is a __ probability of getting a sample proportion of __ or less (more) by chance in a random sample of __."
  • A simulation estimates a p-value: the share of simulated results, made assuming H0H_0, at least as extreme as the real one.
  • Not the probability that H0H_0 is true. A large p-value does not prove H0H_0.

p-hat is approximately normal with mean p_0 and standard deviation √(p_0(1 − p_0)/n) the test statistic z = (p-hat − p_0)/(√(p_0(1 − p_0)/n)) says how many standard deviations it is from p_0 that area is the p-value: the chance of a result at least this extreme if H_0 is true the result would be rare under H_0 , which is evidence against H_0 and for H_a (but never proof)

test statistic
A standardized measure of how far a sample statistic is from the null value: <math class="stat-m"><semantics><mrow><mfrac><mrow><mtext>statistic</mtext><mo>−</mo><mtext>parameter</mtext></mrow><mtext>standard error of the statistic</mtext></mfrac></mrow><annotation encoding="application/x-tex">\frac{\text{statistic} - \text{parameter}}{\text{standard error of the statistic}}</annotation></semantics></math>. For one proportion, <math class="stat-m"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">=</mo><mfrac><mrow><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mo>−</mo><msub><mi>p</mi><mn>0</mn></msub></mrow><msqrt><mrow><msub><mi>p</mi><mn>0</mn></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>0</mn></msub><mo stretchy="false">)</mo><mo>/</mo><mi>n</mi></mrow></msqrt></mfrac></mrow><annotation encoding="application/x-tex">= \frac{\hat{p} - p_0}{\sqrt{p_0(1 - p_0)/n}}</annotation></semantics></math>.
p-value
The probability, assuming the null hypothesis is true, of getting a statistic at least as extreme as the one observed, in the direction of the alternative. It is not the probability that the null hypothesis is true.

3.7 Carrying Out a Test for a Population Proportion

A complete test runs state, plan, do, conclude. It states hypotheses about p with α , names the one-sample z test for a proportion and checks random, 10% and large counts with p_0 , computes z and the p-value, then concludes: compare the p-value with α , reject or fail to reject H_0 , and say whether there is convincing evidence for H_a about the true proportion of all ..., in context. Never accept H_0 , and claim cause only from a randomized experiment.

  • Four steps: State (H0H_0, HaH_a, α\alpha, pp defined), Plan (procedure, conditions), Do (zz, p-value), Conclude.
  • Conclusion: "Because the p-value of __ is less than α\alpha = __, we reject H0H_0. There is convincing evidence that the true proportion of all __ is __ than __."
  • Fail to reject: "there is not convincing evidence that ...", still naming the direction of HaH_a. Never "accept H0H_0" or "prove".
  • A two-sided test at α=0.05\alpha = 0.05 almost always rejects when p0p_0 is outside the 95% interval, and fails to reject when it is inside.
  • Random sampling lets you generalize; only random assignment lets you claim cause.

the result is too unusual under H_0 : reject H_0 , and there is convincing evidence for H_a fail to reject H_0 : there is not convincing evidence for H_a (which does not make H_0 true) the conclusion applies to the population that was sampled the test can show a change but not what caused it

reject the null hypothesis
The decision in a significance test. Reject <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math> when the p-value is less than <math class="stat-m"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math>: there is convincing evidence for <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mi>a</mi></msub></mrow><annotation encoding="application/x-tex">H_a</annotation></semantics></math>. Fail to reject <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math> when the p-value is greater than <math class="stat-m"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math>: there is not convincing evidence for <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mi>a</mi></msub></mrow><annotation encoding="application/x-tex">H_a</annotation></semantics></math>. A test never accepts <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math>.

3.8 Potential Errors When Performing Tests

A Type I error rejects a true H_0 (probability α ); a Type II error fails to reject a false H_0 (probability β , against a specific alternative). Describe each with the condition first and its consequence in context. Power = 1 − β is the chance of detecting a real effect; it grows with the sample size, with α , and with the distance between the true value and p_0 .

  • Type I: H0H_0 true, but we reject it (a false alarm). Probability α\alpha.
  • Type II: HaH_a true, but we fail to reject H0H_0 (a missed effect). Probability β\beta, which depends on the true value.
  • Describe an error with the condition first: "if the true proportion of all __ is __, but we find (do not find) convincing evidence that ...", then the consequence in context.
  • Power =1−β= 1 - \beta: the probability of rejecting H0H_0 when a specific alternative is true.
  • More power: larger nn (best), larger α\alpha, or a true value farther from p0p_0. For a fixed nn, lowering α\alpha raises β\beta.

the test rejects H_0 : a Type I error, with probability α the test fails to reject H_0 : a Type II error, with probability β the test rejects H_0 with probability power = 1 − β the curves overlap less or the cutoff is easier to pass, so power rises and β falls

Type I error
Rejecting the null hypothesis when it is true: finding convincing evidence for an effect that is not there. Its probability is the significance level <math class="stat-m"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math>.
Type II error
Failing to reject the null hypothesis when the alternative is true: missing an effect that is there. Its probability, <math class="stat-m"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math>, depends on the true value of the parameter.
power
The probability that a test rejects the null hypothesis when a specific alternative value is true, <math class="stat-m"><semantics><mrow><mn>1</mn><mo>−</mo><mi>β</mi></mrow><annotation encoding="application/x-tex">1 - \beta</annotation></semantics></math>. It increases with the sample size, with <math class="stat-m"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math>, and with the distance between the true value and the null value.

3.9 Sampling Distributions for the Difference Between Sample Proportions

For two independent random samples, p-hat_1 − p-hat_2 is centered at p_1 − p_2 and has standard deviation √((p_1(1 − p_1))/(n_1) + (p_2(1 − p_2))/(n_2)) : the variances add. When all four large counts are at least 10, its distribution is approximately normal, so you can find probabilities with z-scores.

  • Mean: μp^1−p^2\mu_{\hat{p}_1 - \hat{p}_2}=p1−p2= p_1 - p_2.
  • Standard deviation: σp^1−p^2\sigma_{\hat{p}_1 - \hat{p}_2}=p1(1−p1)n1+p2(1−p2)n2= \sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}}. Add variances, never standard deviations.
  • Shape: approximately normal when n1p1n_1 p_1, n1(1−p1)n_1(1-p_1), n2p2n_2 p_2 and n2(1−p2)n_2(1-p_2) are each at least 10.
  • Conditions: two independent random samples (or two randomly assigned groups), and each sample less than 10% of its population when sampling without replacement.

each sample proportion has its own chance error, and so does their difference p-hat_1 − p-hat_2 the difference is centered at p_1 − p_2 , so it is an unbiased estimator of the true difference the variances add: σ² = (p_1(1 − p_1))/(n_1) +(p_2(1 − p_2))/(n_2) , and the standard deviation is its square root the sampling distribution is approximately normal, so z-scores and normal areas give probabilities

difference in sample proportions
The statistic <math class="stat-m"><semantics><mrow><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>1</mn></msub><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\hat{p}_1 - \hat{p}_2</annotation></semantics></math>, one sample proportion minus another. Its sampling distribution has mean <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mn>1</mn></msub><mo>−</mo><msub><mi>p</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">p_1 - p_2</annotation></semantics></math> and, for independent samples, standard deviation <math class="stat-m"><semantics><mrow><msqrt><mrow><mfrac><mrow><msub><mi>p</mi><mn>1</mn></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mo stretchy="false">)</mo></mrow><msub><mi>n</mi><mn>1</mn></msub></mfrac><mo>+</mo><mfrac><mrow><msub><mi>p</mi><mn>2</mn></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><msub><mi>n</mi><mn>2</mn></msub></mfrac></mrow></msqrt></mrow><annotation encoding="application/x-tex">\sqrt{\frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2}}</annotation></semantics></math>.
independent samples
Two samples where the individuals chosen for one have no link to those chosen for the other, such as separate random samples from two schools. Samples linked person to person, such as husbands and their own wives, are not independent samples.

3.10 Constructing a Confidence Interval for the Difference Between Two Population Proportions

To estimate p_1 − p_2 , use the two-sample z interval (p-hat_1 − p-hat_2) ±z*√((p-hat_1(1 − p-hat_1))/(n_1) + (p-hat_2(1 − p-hat_2))/(n_2)) after checking random, 10% and large counts for each sample. Interpret it as capturing the true difference in proportions, in context and with the order of subtraction named.

  • Two-sample z interval: (p^1−p^2)(\hat{p}_1 - \hat{p}_2)±z∗p^1(1−p^1)n1+p^2(1−p^2)n2\pm z^* \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}.
  • Conditions: two independent random samples or two randomly assigned groups; each sample under 10% of its population; at least 10 successes and 10 failures in each sample.
  • Interpret: "We are 95% confident that the interval from ... to ... captures the true difference in the proportions of ... (group 1 minus group 2)."
  • Random assignment allows a cause-and-effect conclusion; random sampling allows generalizing to the populations.

the sample difference p-hat_1 − p-hat_2 is the point estimate replace each p by its p-hat to get the standard error, since the p s are unknown go z* standard errors each way: (p-hat_1 − p-hat_2) ±z*√((p-hat_1(1 − p-hat_1))/(n_1) + (p-hat_2(1 − p-hat_2))/(n_2)) say "we are 95% confident that the interval captures the true difference in proportions", naming the order of subtraction

two-sample z interval
A confidence interval for the difference of two population proportions, <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mn>1</mn></msub><mo>−</mo><msub><mi>p</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">p_1 - p_2</annotation></semantics></math>: <math class="stat-m"><semantics><mrow><mo stretchy="false">(</mo><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>1</mn></msub><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(\hat{p}_1 - \hat{p}_2)</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">±</mo><msup><mi>z</mi><mo>∗</mo></msup><msqrt><mrow><mfrac><mrow><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>1</mn></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>1</mn></msub><mo stretchy="false">)</mo></mrow><msub><mi>n</mi><mn>1</mn></msub></mfrac><mo>+</mo><mfrac><mrow><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>2</mn></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>2</mn></msub><mo stretchy="false">)</mo></mrow><msub><mi>n</mi><mn>2</mn></msub></mfrac></mrow></msqrt></mrow><annotation encoding="application/x-tex">\pm z^* \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}</annotation></semantics></math>. It needs two independent random samples (or two randomly assigned groups) and at least 10 successes and 10 failures in each.

3.11 Justifying a Claim Based on a Confidence Interval for the Difference Between Two Population Proportions

To judge a claim with an interval for p_1 − p_2 , look at where 0, or the claimed value, sits. Entirely above or below 0 gives convincing evidence of a difference in that direction; an interval that contains 0 gives no convincing evidence of a difference, which is not proof of equality. State the reason, the evidence and the parameter in context.

  • Entirely above 0: convincing evidence p1>p2p_1 > p_2. Entirely below 0: convincing evidence p1<p2p_1 < p_2. Contains 0: no convincing evidence of a difference.
  • Write the claim with the reason first: "Because every value in the interval is greater than 0, the interval gives convincing evidence that ..."
  • A 95% interval and a two-sided test at α=0.05\alpha = 0.05 nearly always agree about whether 0 is plausible.
  • Containing 0 never proves the proportions are equal; very large samples can make even tiny differences convincing.

ask whether 0 is a plausible value of p_1 − p_2 , that is, whether it is inside the interval the interval gives convincing evidence that p_1 > p_2 (less than 0: that p_1 < p_2 ) equal proportions are plausible, so there is not convincing evidence of a difference, and the interval does not prove there is none check that value the same way: inside the interval means plausible, outside means convincing evidence against it

zero difference
The value <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mn>1</mn></msub><mo>−</mo><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">p_1 - p_2 = 0</annotation></semantics></math>, which means the two population proportions are equal. If a confidence interval for <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mn>1</mn></msub><mo>−</mo><msub><mi>p</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">p_1 - p_2</annotation></semantics></math> contains 0, a difference of zero is plausible and there is not convincing evidence of a difference; if 0 is outside the interval, there is.

3.12 Setting Up a Test for the Difference Between Two Population Proportions

A two-sample z test for p_1 − p_2 starts from H_0:p_1 − p_2 = 0 and an alternative chosen from the question. Because the test assumes H_0 , it pools the samples, p_c = (x_1 + x_2)/(n_1 + n_2) , and checks large counts with p_c , along with two independent random samples (or random assignment) and the 10% condition.

  • Hypotheses: H0:p1−p2=0H_0: p_1 - p_2 = 0 and Ha:p1−p2>0H_a: p_1 - p_2 > 0, <0< 0 or ≠0\ne 0, with each pp defined as a true proportion in context.
  • Pooled proportion: pcp_c=x1+x2n1+n2= \frac{x_1 + x_2}{n_1 + n_2}, the combined successes over the combined sample size. Never the average of p^1\hat{p}_1 and p^2\hat{p}_2.
  • Conditions: two independent random samples or randomly assigned groups; 10% for each sample; large counts with pcp_c.
  • Name it in full: "a two-sample z test for p1−p2p_1 - p_2".

the parameter is p_1 − p_2 , and the procedure is a two-sample z test H_0:p_1 − p_2 = 0 , and H_a says > , < or ≠ as the question asks, chosen before seeing the data estimate it by pooling: p_c = (x_1 + x_2)/(n_1 + n_2) , total successes over total sample size check large counts with p_c : n_1p_c , n_1(1 − p_c) , n_2p_c , n_2(1 − p_c) each at least 10, plus random and 10%

two-sample z test
A significance test of <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub><mo>:</mo><msub><mi>p</mi><mn>1</mn></msub><mo>−</mo><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">H_0: p_1 - p_2 = 0</annotation></semantics></math> about two population proportions, using two independent random samples or two randomly assigned groups. Its standard error uses the pooled proportion <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mi>c</mi></msub></mrow><annotation encoding="application/x-tex">p_c</annotation></semantics></math>.
pooled proportion
The proportion of successes in two samples combined, <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mi>c</mi></msub></mrow><annotation encoding="application/x-tex">p_c</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">=</mo><mfrac><mrow><msub><mi>x</mi><mn>1</mn></msub><mo>+</mo><msub><mi>x</mi><mn>2</mn></msub></mrow><mrow><msub><mi>n</mi><mn>1</mn></msub><mo>+</mo><msub><mi>n</mi><mn>2</mn></msub></mrow></mfrac></mrow><annotation encoding="application/x-tex">= \frac{x_1 + x_2}{n_1 + n_2}</annotation></semantics></math>. A two-sample z test uses it because the null hypothesis says the two proportions are equal.

3.13 Carrying Out a Test for the Difference Between Two Population Proportions

A two-sample z test standardizes the observed difference with the pooled standard error, z = (p-hat_1 − p-hat_2)/(√(p_c(1 − p_c)(1/(n_1) + 1/(n_2)))) , finds the p-value in the direction of H_a , compares it with α , and concludes about the true proportions in context, never accepting H_0 .

  • Test statistic: zz=p^1−p^2pc(1−pc)(1n1+1n2)= \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{p_c(1 - p_c)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}, with pcp_c=x1+x2n1+n2= \frac{x_1 + x_2}{n_1 + n_2}.
  • p-value: area beyond zz in the direction of HaH_a; double one tail for a two-sided test.
  • Conclusion: "Because the p-value of ... is less than (greater than) α\alpha = ..., we reject (fail to reject) H0H_0. There is (is not) convincing evidence that the true proportion ..."
  • Reject: a Type I error is possible. Fail to reject: a Type II error is possible.

the difference p-hat_1 − p-hat_2 is centered at 0, with standard error √(p_c(1 − p_c)(1/(n_1) + 1/(n_2))) z = ((p-hat_1 − p-hat_2) − 0)/(√(p_c(1 − p_c)(1/(n_1) + 1/(n_2)))) counts how many standard errors it lies from 0 that area is the p-value: how often chance alone gives a difference this extreme reject or fail to reject H_0 , then state convincing evidence (or not) for H_a about the true proportions, in context

two-sample z statistic
The test statistic of a two-sample z test for proportions: <math class="stat-m"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">=</mo><mfrac><mrow><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>1</mn></msub><mo>−</mo><msub><mover accent="true"><mi>p</mi><mo stretchy="false">&#x005E;</mo></mover><mn>2</mn></msub></mrow><msqrt><mrow><msub><mi>p</mi><mi>c</mi></msub><mo stretchy="false">(</mo><mn>1</mn><mo>−</mo><msub><mi>p</mi><mi>c</mi></msub><mo stretchy="false">)</mo><mrow><mo fence="true" stretchy="true">(</mo><mrow><mfrac><mn>1</mn><msub><mi>n</mi><mn>1</mn></msub></mfrac><mo>+</mo><mfrac><mn>1</mn><msub><mi>n</mi><mn>2</mn></msub></mfrac></mrow><mo fence="true" stretchy="true">)</mo></mrow></mrow></msqrt></mfrac></mrow><annotation encoding="application/x-tex">= \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{p_c(1 - p_c)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}</annotation></semantics></math>, the observed difference measured in standard errors from 0. The denominator is the standard error built from the pooled proportion <math class="stat-m"><semantics><mrow><msub><mi>p</mi><mi>c</mi></msub></mrow><annotation encoding="application/x-tex">p_c</annotation></semantics></math>.

3.14 Setting Up a Chi-Square Test for Homogeneity or Independence

A chi-square test compares a two-way table of observed counts with the counts expected if H_0 were true. Choose independence (one sample, two variables) or homogeneity (several samples or groups, one variable), state H_0 and H_a in context, find each expected count as row total times column total over the grand total, and check random, 10% and expected counts at least 5.

  • Independence: one random sample, two categorical variables. H0H_0: no association between them in the population.
  • Homogeneity: separate random samples or randomly assigned groups, one categorical variable. H0H_0: the distribution is the same in every population.
  • Expected count =row total×column totalgrand total= \frac{\text{row total} \times \text{column total}}{\text{grand total}}; do not round expected counts.
  • Conditions: random; 10% for each sample; every expected count at least 5.

use a chi-square test: independence for one sample and two variables, homogeneity for several samples or groups and one variable under H_0 , every row has the same column proportions as the whole table expected count = (row total×column total)/(grand total) χ² = ∑ ((O − E)²)/E is large when the table is far from what H_0 predicts, after checking random, 10% and expected counts at least 5

chi-square
The statistic <math class="stat-m"><semantics><mrow><msup><mi>χ</mi><mn>2</mn></msup><mo>=</mo><mo largeop="true" movablelimits="false">∑</mo><mfrac><mrow><mo stretchy="false">(</mo><mi>O</mi><mo>−</mo><mi>E</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mi>E</mi></mfrac></mrow><annotation encoding="application/x-tex">\chi^2 = \sum \frac{(O - E)^2}{E}</annotation></semantics></math>, added over every cell of a table of observed (<math class="stat-m"><semantics><mrow><mi>O</mi></mrow><annotation encoding="application/x-tex">O</annotation></semantics></math>) and expected (<math class="stat-m"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math>) counts. It is 0 when the observed counts match the expected counts exactly and grows as they move apart.
chi-square test for homogeneity
A chi-square test of whether one categorical variable has the same distribution in several populations or treatment groups, using separate random samples or randomly assigned groups. <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math>: the distributions are the same.
chi-square test for independence
A chi-square test of whether two categorical variables are associated in a population, using one random sample classified by both variables. <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math>: there is no association between the variables.
expected count
The count a cell of a two-way table would have, on average, if the null hypothesis were true: <math class="stat-m"><semantics><mrow><mfrac><mrow><mtext>row total</mtext><mo>×</mo><mtext>column total</mtext></mrow><mtext>grand total</mtext></mfrac></mrow><annotation encoding="application/x-tex">\frac{\text{row total} \times \text{column total}}{\text{grand total}}</annotation></semantics></math>. The observed count is the count in the data.

3.15 Carrying Out a Chi-Square Test for Homogeneity or Independence

Carrying out a chi-square test: find each expected count, add the components ((O − E)²)/E to get χ² , use the chi-square distribution with (r − 1)(c − 1) degrees of freedom for the right-tail p-value, compare it with α , and conclude about the association or the distributions in context. The largest components show where the association lies.

  • χ2=∑(O−E)2E\chi^2 = \sum \frac{(O - E)^2}{E} over every cell; each term is a chi-square component.
  • Degrees of freedom: df\text{df}=(rows−1)(columns−1)= (\text{rows} - 1)(\text{columns} - 1).
  • The p-value is always the right-tail area: only large χ2\chi^2 values are evidence against H0H_0.
  • Conclude: "There is (is not) convincing evidence of an association between ... and ... for ..." (independence) or "that the distribution of ... differs among ..." (homogeneity).

the term ((O − E)²)/E is that cell's contribution: large where the table departs from H_0 χ² = ∑ ((O − E)²)/E , which is 0 when the table matches H_0 and grows as it departs the p-value is the area to the right of the observed χ² under that curve conclude about an association (or a difference in distributions) in context, then describe it from the largest terms

degrees of freedom
The number that picks out one member of a family of distributions. For a chi-square test on a two-way table, <math class="stat-m"><semantics><mrow><mtext>df</mtext></mrow><annotation encoding="application/x-tex">\text{df}</annotation></semantics></math><wbr><math class="stat-m"><semantics><mrow><mo form="infix">=</mo><mo stretchy="false">(</mo><mtext>rows</mtext><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mtext>columns</mtext><mo>−</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">= (\text{rows} - 1)(\text{columns} - 1)</annotation></semantics></math>.
chi-square distribution
A family of right-skewed density curves for values of 0 or more, one for each number of degrees of freedom; its mean is the df. If <math class="stat-m"><semantics><mrow><msub><mi>H</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">H_0</annotation></semantics></math> is true and the conditions hold, the <math class="stat-m"><semantics><mrow><msup><mi>χ</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\chi^2</annotation></semantics></math> statistic approximately follows one.
chi-square component
One cell's term <math class="stat-m"><semantics><mrow><mfrac><mrow><mo stretchy="false">(</mo><mi>O</mi><mo>−</mo><mi>E</mi><msup><mo stretchy="false">)</mo><mn>2</mn></msup></mrow><mi>E</mi></mfrac></mrow><annotation encoding="application/x-tex">\frac{(O - E)^2}{E}</annotation></semantics></math> in the chi-square statistic. The cells with the largest components show where the observed counts differ most from what the null hypothesis predicts.