Statistics 1 for Economics - Proportions and Hypothesis Testing

Introduction to Statistical Variables

  • Population vs. Sample: Statistics involves making inferences about a larger population based on data collected from a sample.
  • Quantitative Variables: Variables that measure a numerical quantity. Examples include:
    • How many hours of sleep do you get?
    • How often do you get up during the night?
    • How high is the blood pressure measured in numerical values?
    • Mean number of hours that adolescents sleep per 2424\ hours.
  • Nominal Variables: Categorical variables represented by qualitative descriptions, often resulting in "yes/no" responses. Examples include:
    • Do you use painkillers or sleeping tablets?
    • Do you usually dream about school?
    • Did you see a scary movie before you went to bed?

Hypothesis Testing for Proportions (Normal Approximation)

  • Assumptions and Conditions: For a large-sample test of a population proportion pp using the Normal distribution, the following must be met:
    • A random sample must be used.
    • np05np_0 \geq 5
    • n(1p0)5n(1 - p_0) \geq 5
  • Null and Alternative Hypotheses:
    • H0:p=p0H_0: p = p_0 (The null hypothesis, representing no change or a specific status quo).
    • H1:p>p0H_1: p > p_0, H1:p<p0H_1: p < p_0, or H1:pp0H_1: p \neq p_0 (The research or alternative hypothesis).
  • Test Statistic: The standardized distance between the sample proportion and the hypothesized proportion:
    • Z=p^p0p0(1p0)nZ = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1 - p_0)}{n}}}
    • Distribution: ZN(0,1)Z \sim N(0, 1).
  • Case Study: Question 1 (RTVL Market Share):
    • Scenario: An advertiser buys time if RTVL's market share is greater than 5%5\%.
    • Data: n=500n = 500, p^=6.2%=0.062\hat{p} = 6.2\% = 0.062, α=1%\alpha = 1\%.
    • Check Conditions:
      • np0=500×0.05=255np_0 = 500 \times 0.05 = 25 \geq 5
      • n(1p0)=500×0.95=4755n(1 - p_0) = 500 \times 0.95 = 475 \geq 5
    • Hypotheses: H0:p=0.05H_0: p = 0.05 vs. H1:p>0.05H_1: p > 0.05.
    • Rejection Region: At α=1%\alpha = 1\%, reject H0H_0 if Zzcrit=2.33Z \geq z_{crit} = 2.33.
    • Sample Realization:
      • zobs=0.0620.050.05×0.95500=1.23z_{obs} = \frac{0.062 - 0.05}{\sqrt{\frac{0.05 \times 0.95}{500}}} = 1.23
    • Decision: Since zobs<zcritz_{obs} < z_{crit} (1.23<2.331.23 < 2.33), do not reject H0H_0.
    • Conclusion: At a significance level of 1%1\%, there is insufficient evidence to infer that the market share is more than 5%5\%.\n

The p-value and Power of the Test

  • p-value Definition: The probability of obtaining evidence at least as strong as the observed sample, assuming the null hypothesis is true.
    • Calculation for Question 1: p-value=P(Zzobs)=P(Z1.23)=10.8907=0.1093p\text{-value} = P(Z \geq z_{obs}) = P(Z \geq 1.23) = 1 - 0.8907 = 0.1093.
  • Power of the Test: The probability of correctly rejecting the null hypothesis when it is false (P(reject H0H0 is false)P(\text{reject } H_0 \mid H_0 \text{ is false})).
  • Calculating Power (Example Q3):
    • Target: Find power if true p=0.09p = 0.09 for the RTVL test at α=1%\alpha = 1\%.
    • Step 1: Find the critical sample proportion (p^crit\hat{p}_{crit}) necessary to reject H0H_0:
      • p^crit=p0+zcrit×p0(1p0)n\hat{p}_{crit} = p_0 + z_{crit} \times \sqrt{\frac{p_0(1 - p_0)}{n}}
      • p^crit=0.05+2.33×0.05×0.95500=0.0727\hat{p}_{crit} = 0.05 + 2.33 \times \sqrt{\frac{0.05 \times 0.95}{500}} = 0.0727
    • Step 2: Calculate the probability of observing p^0.0727\hat{p} \geq 0.0727 given the new population proportion p=0.09p = 0.09:
      • Z=0.07270.090.09×(10.09)500=1.35Z = \frac{0.0727 - 0.09}{\sqrt{\frac{0.09 \times (1 - 0.09)}{500}} } = -1.35
      • Power=P(Z1.35)=0.9115\text{Power} = P(Z \geq -1.35) = 0.9115.

Distributions and Test Statistics

  • Counts (X):
    • XBinomial(n,p)X \sim Binomial(n, p).
    • Mean: μ=E(X)=np\mu = E(X) = np.
    • Variance: σ2=V(X)=np(1p)\sigma^2 = V(X) = np(1 - p).
    • Standardization: Z=Xnpnp(1p)N(0,1)Z = \frac{X - np}{\sqrt{np(1 - p)}} \sim N(0, 1).
  • Proportions (\hat{p}):
    • Sample proportion p^=Xn\hat{p} = \frac{X}{n}.
    • Expected Value: E(p^)=pE(\hat{p}) = p.
    • Variance: V(p^)=p(1p)nV(\hat{p}) = \frac{p(1 - p)}{n}.
    • Standardization: Z=p^pp(1p)nN(0,1)Z = \frac{\hat{p} - p}{\sqrt{\frac{p(1 - p)}{n}}} \sim N(0, 1).

Confidence and Prediction Intervals

  • Confidence Interval (CI): Used to estimate the unknown population parameter pp.
    • Formula: p=p^±zα/2×p^(1p^)np = \hat{p} \pm z_{\alpha/2} \times \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}
    • Example (NOB Market Share): n=500n = 500, p^=0.332\hat{p} = 0.332, Confidence Level = 90%90\%.
    • Calculation: α=10%    α/2=0.05    z0.05=1.645\alpha = 10\% \implies \alpha/2 = 0.05 \implies z_{0.05} = 1.645.
    • Margin of Error=1.645×0.332×0.668500=0.035\text{Margin of Error} = 1.645 \times \sqrt{\frac{0.332 \times 0.668}{500}} = 0.035.
    • Interval: 0.332±0.035    [0.297<p<0.367]0.332 \pm 0.035 \implies [0.297 < p < 0.367].
    • Width of the interval: 2×margin=2×0.035=0.0702 \times \text{margin} = 2 \times 0.035 = 0.070 (or 7.0%7.0\%).
  • Prediction Interval: Used to determine the range in which a future sample proportion p^\hat{p} is expected to fall based on a known population parameter pp.
    • Formula: p^=p±zα/2×p(1p)n\hat{p} = p \pm z_{\alpha/2} \times \sqrt{\frac{p(1 - p)}{n}}
    • Example (Lock-down Support): Known p=0.62p = 0.62, n=100n = 100, 90%90\%\ probability.
    • p^=0.62±1.645×0.62×0.38100=0.62±0.08\hat{p} = 0.62 \pm 1.645 \times \sqrt{\frac{0.62 \times 0.38}{100}} = 0.62 \pm 0.08.
    • Range: [0.54<p^<0.70][0.54 < \hat{p} < 0.70].

Sample Size Determination

  • Objective: Find the minimum sample size nn to achieve a specific margin of error (BB) or bound.
  • Derivation:
    • zα/2×p^(1p^)nBz_{\alpha/2} \times \sqrt{\frac{\hat{p}(1 - \hat{p})}{n}} \leq B
    • nzα/22×p^(1p^)B2n \geq \frac{z_{\alpha/2}^2 \times \hat{p}(1 - \hat{p})}{B^2}
  • Case 1: Available Estimate: If a previous sample proportion p^\hat{p} exists (e.g., 0.3320.332), use it in the formula.
    • Example: n1.6452×0.332×0.6680.012=6001.3    n6002n \geq \frac{1.645^2 \times 0.332 \times 0.668}{0.01^2} = 6001.3 \implies n \geq 6002.
  • Case 2: No Information (Conservative Approach): If p^\hat{p} is unknown, use p^=0.50\hat{p} = 0.50 to maximize the required nn because the product p^(1p^)\hat{p}(1 - \hat{p}) is largest at 0.50.5.
    • p^=0.50    p^(1p^)=0.25\hat{p} = 0.50 \implies \hat{p}(1 - \hat{p}) = 0.25
    • Example: n1.6452×0.50×0.500.012=6765.06    n6766n \geq \frac{1.645^2 \times 0.50 \times 0.50}{0.01^2} = 6765.06 \implies n \geq 6766.

Exact Hypothesis Testing using the Binomial Distribution

  • Conditions: Used when the normal approximation conditions fail (np0<5np_0 < 5 or n(1p0)<5n(1 - p_0) < 5).
  • Procedure:
    1. Define XBinomial(n,p0)X \sim Binomial(n, p_0).
    2. Calculate the exact p-value using binomial probabilities.
    3. Compare p-value to α\alpha.
  • Example: Question 8 (Tourist Agency Loyalty):
    • n=15n = 15, p0=0.20p_0 = 0.20, α=5%\alpha = 5\%.
    • np0=15×0.20=3<5np_0 = 15 \times 0.20 = 3 < 5 (Condition fails).
    • H0:p=0.20H_0: p = 0.20, H1:p>0.20H_1: p > 0.20. Observed xobs=7x_{obs} = 7.
    • p-value=P(X7)=1P(X6)=10.982=0.018p\text{-value} = P(X \geq 7) = 1 - P(X \leq 6) = 1 - 0.982 = 0.018.
    • Decision: Reject H0H_0 (0.0180.050.018 \leq 0.05).
  • Example: Question 9 (Statistics Course Rating):
    • n=20n = 20, p0=0.90p_0 = 0.90, α=5%\alpha = 5\%.
    • n(1p0)=20×0.10=2<5n(1 - p_0) = 20 \times 0.10 = 2 < 5 (Condition fails).
    • H0:p=0.90H_0: p = 0.90, H1:p<0.90H_1: p < 0.90. Observed xobs=17x_{obs} = 17.
    • p-value=P(X17)=0.323p\text{-value} = P(X \leq 17) = 0.323.
    • Decision: Do not reject H0H_0 (0.323>0.050.323 > 0.05).
  • Example: Question 10a (Train Delays - Two-sided):
    • n=25n = 25, p0=0.80p_0 = 0.80, α=5%\alpha = 5\%. Observed xobs=16x_{obs} = 16.
    • H0:p=0.80H_0: p = 0.80, H1:p0.80H_1: p \neq 0.80.
    • p-value=2×P(X16)=2×0.047=0.094p\text{-value} = 2 \times P(X \leq 16) = 2 \times 0.047 = 0.094.
    • Decision: Do not reject H0H_0 (0.094>0.050.094 > 0.05).

Normal Approximation and Continuity Correction

  • Continuity Correction (CC): Adjusting a discrete value by 0.50.5 when using a continuous distribution to approximate a discrete one.
  • Application Rules:
    • If using Counts (XX) and conditions np5np \geq 5 and n(1p)5n(1 - p) \geq 5 are met: Use Normal approximation with CC.
      • Left tail: P(Xx)P(Xccx+0.5)P(X \leq x) \approx P(X_{cc} \leq x + 0.5).
      • Right tail: P(Xx)P(Xccx0.5)P(X \geq x) \approx P(X_{cc} \geq x - 0.5).
    • If using Proportions (p^\hat{p}) and conditions are met: Use the normal test statistic ZZ without CC.
    • If conditions are not met: Use the exact binomial test.
  • Case Study: Question 10b (Train Delay CC Comparison):
    • With CC: Approximation of 2×P(X16)2 \times P(X \leq 16) becomes 2×P(Xcc16.5)2 \times P(X_{cc} \leq 16.5).
      • Z=16.5(25×0.80)25×0.80×0.20=16.5202=1.75Z = \frac{16.5 - (25 \times 0.80)}{\sqrt{25 \times 0.80 \times 0.20}} = \frac{16.5 - 20}{2} = -1.75
      • p-value=2×P(Z1.75)=0.0802p\text{-value} = 2 \times P(Z \leq -1.75) = 0.0802 (Do not reject H0H_0; aligns with exact test).
    • Without CC: Approximation of 2×P(X16)2 \times P(X \leq 16) using raw values.
      • Z=16202=2.00Z = \frac{16 - 20}{2} = -2.00
      • p-value=2×P(Z2.00)=0.0456p\text{-value} = 2 \times P(Z \leq -2.00) = 0.0456 (Incorrectly reject H0H_0).