Modélisation stat

📚 Modélisation_stat.pdf

Brief overview

This document provides a comprehensive guide to statistical modeling and hypothesis testing. It covers fundamental concepts, parametric and non-parametric tests, and both simple and multiple linear regression techniques, offering essential tools for data analysis and interpretation.

Key points

  • Introduction to the principles and errors of hypothesis testing.
  • Parametric tests for simple and composite hypotheses.
  • Comparing independent and dependent samples with parametric tests.
  • Application of non-parametric tests and chi-squared analysis.
  • Simple linear regression models and parameter estimation.
  • Multiple linear regression analysis and model validation.

1. Introduction to hypothesis testing

1.1 Hypothesis testing fundamentals

  • Statistical hypothesis: An assertion about population characteristics, such as parameter values or distribution shape.
  • Hypothesis test: A procedure to make a decision between two competing hypotheses.

📝 Example: A researcher hypothesizes about the average height of a specific plant species.

1.2 Null and alternative hypotheses

  • Null hypothesis (H0): A statement of no effect or no difference, postulating a specific parameter value. It is formulated with the intent of being rejected.
    • Represents the belief that observed differences are due to sampling variability.
  • Alternative hypothesis (H1): A statement that contradicts the null hypothesis. It can represent any compatible hypothesis different from H0.

🔑 Important: H1 is the logical negation of H0.

📝 Example:

  • H0: The average temperature in August in Paris is 20 degrees Celsius (m = 20).
  • H1: The average temperature in August in Paris is not 20 degrees Celsius (m ≠ 20).

1.3 Types of hypothesis tests

A test's nature depends on the alternative hypothesis:

Test TypeAlternative Hypothesis (H1)Description
Unilateralθ > θ0 or θ < θ0One-sided test
Bilateralθ ≠ θ0Two-sided test

🔑 Important: A unilateral test can be specified as a "right-tailed" test (θ > θ0) or a "left-tailed" test (θ < θ0).

1.4 Asymmetry in hypothesis testing conclusions

  • The decision to "accept" H0 does not definitively prove H0 is true.
  • It signifies a lack of sufficient evidence to reject H0.

🔑 Important: Statistical decision-making asymmetry means we reject H0 with a certain confidence, but "fail to reject" H0 implies lack of evidence rather than proof of its truth.

1.5 Risks of error in hypothesis testing

Any statistical decision involves potential errors, categorized into two types:

RealityDecisionOutcomeProbability
H0 is TrueReject H0Type I Errorα (Significance level)
H0 is TrueDo Not Reject H0Correct Decision1 - α
H0 is False (H1 is True)Reject H0Correct Decision1 - β (Power)
H0 is False (H1 is True)Do Not Reject H0Type II Errorβ

1.5.1 Type I error (α)

  • Type I Error: Rejecting the null hypothesis (H0) when it is actually true.
  • Probability of Type I error is denoted by α, also known as the significance level of the test.
  • This probability defines the critical region (or rejection region) W.
  • The complement region (W) is the region of acceptance for H0.
  • Commonly chosen values for α are 0.05 (5%) and 0.01 (1%).

1.5.2 Type II error (β)

  • Type II Error: Failing to reject the null hypothesis (H0) when it is actually false.
  • Probability of Type II error is denoted by β.
  • Power of the test is defined as 1 - β, representing the probability of correctly rejecting H0 when H1 is true.
  • Calculating β requires specifying the parameter value(s) under H1.

> Key relationship: Power (1 - β) is the probability of accepting H1 when H1 is true.

1.5.3 Properties of α and β

  • Distance between hypotheses: As the true parameter value under H1 moves further from the value under H0, the test's power (1 - β) increases, and β decreases.
  • Trade-off between α and β: Decreasing α (reducing Type I error) increases the region of non-rejection, thus increasing β (increasing Type II error risk).
  • Sample size effect: Increasing the sample size n, while keeping α fixed, shrinks the non-rejection region, decreases β, and thus increases the test's power.

> Dynamic Relationship: α decreases → β increases; n increases → β decreases (for fixed α).

1.6 Procedure for developing a hypothesis test

  1. Formulate hypotheses: Precisely state the null (H0) and alternative (H1) hypotheses.
  2. Set significance level: Choose the probability α for Type I error before data collection.
  3. Specify test conditions: Define assumptions about the population distribution, sample size, known/unknown variance, etc.
  4. Select estimator and distribution: Choose an appropriate estimator and determine its probability distribution under both H0 and H1. These distributions must be distinguishable.
  5. Determine critical region: Define the critical region W such that Pr(W|H0) = α.
  6. Establish decision rule: Based on W, formulate the rule for rejecting or not rejecting H0. Calculate β = Pr(W|H1).
  7. Calculate test statistic: Compute the numerical value of the test statistic using the sample data.
  8. Make decision: Compare the calculated test statistic to the critical region to decide whether to reject H0.

> Decision Flow: Formulate H0/H1 → Set α → Define Conditions → Choose Estimator → Determine Critical Region → Calculate Statistic → Decide.

🔑 Important: The entire process of hypothesis testing aims to minimize the risks of making incorrect decisions about population parameters based on sample data.

2. Parametric tests for simple and composite hypotheses

2.1 Introduction to hypothesis testing

  • A hypothesis test involves defining a null hypothesis (H0H_0) and an alternative hypothesis (H1H_1).
  • The goal is to decide whether to reject H0H_0 in favor of H1H_1 based on sample data.
  • Decisions are made using a test statistic (tt) and a critical region (WW).

> 🔑 Important: Rejecting H0H_0 implies the data strongly suggests H1H_1 is true, not that H0H_0 is definitively false.

2.2 Testing simple vs. simple hypotheses

  • This scenario involves precisely defined null and alternative hypotheses:
    • H0:θ=θ0H_0: \theta = \theta_0
    • H1:θ=θ1H_1: \theta = \theta_1
  • Where θ\theta is a parameter of a probability distribution f(x;θ)f(x; \theta).

2.2.1 Neyman-Pearson lemma

  • The Neyman-Pearson lemma provides the most powerful test for simple vs. simple hypotheses.
  • It states that for a given significance level α\alpha, the most powerful test's critical region (WW) is defined by:
    • W={x∈Rn∣L(x;θ1)>kαL(x;θ0)}W = \{x \in \mathbb{R}^n \mid L(x; \theta_1) > k_\alpha L(x; \theta_0)\}
  • L(x;θ)L(x; \theta) is the likelihood function for the sample x=(x1,…,xn)x=(x_1, \dots, x_n).
  • kαk_\alpha is a constant determined by α\alpha such that P(W∣H0)=αP(W|H_0) = \alpha.

> 📝 Example: For testing the mean (mm) of a normal distribution with known variance σ2\sigma^2, H0:m=m0H_0: m = m_0 vs. H1:m=m1H_1: m = m_1, the critical region often simplifies to conditions on the sample mean Xˉ\bar{X}. If m1>m0m_1 > m_0, we reject H0H_0 if Xˉ\bar{X} is sufficiently large.

  • A test derived from the Neyman-Pearson lemma is unbiased, meaning its power (1−β)(1-\beta) is always greater than the significance level α\alpha.

2.2.2 Applying Neyman-Pearson: Example

  • Consider testing the proportion pp of male births.
  • H0:p=0.5H_0: p = 0.5 vs. H1:p=0.48H_1: p = 0.48.
  • With a sample of 900 births, 470 are boys.
  • The test statistic and critical region would be determined based on the likelihood ratio or, in this case, often a normal approximation to the binomial distribution.

2.3 Testing a simple hypothesis against a composite alternative

  • This occurs when the alternative hypothesis involves a range of parameter values.
    • Example: H0:θ=θ0H_0: \theta = \theta_0 vs. H1:θ>θ1H_1: \theta > \theta_1 (where θ1\theta_1 could be equal to θ0\theta_0).
  • The power function β(θ)\beta(\theta) varies for each θ\theta in the alternative hypothesis.
  • The efficiency curve is β(θ)\beta(\theta), and the power curve is 1−β(θ)1-\beta(\theta).

2.3.1 Uniformly Most Powerful (UPP) tests

  • A UPP test for H0:θ=θ0H_0: \theta = \theta_0 against H1:θ>θ1H_1: \theta > \theta_1 exists if the Neyman-Pearson critical region for testing H0:θ=θ0H_0: \theta = \theta_0 against H1:θ=θ1H_1: \theta = \theta_1 (with θ1>θ0\theta_1 > \theta_0) does not depend on the specific value of θ1\theta_1.
  • Such a test remains the most powerful for the composite alternative H1:θ>θ1H_1: \theta > \theta_1 across all its values.

> 🔑 Important: A UPP test does not generally exist for two-sided alternatives (H1:θ≠θ0H_1: \theta \neq \theta_0). This is because a test optimal for θ>θ0\theta > \theta_0 might not be optimal for θ<θ0\theta < \theta_0.

2.3.2 Example: Testing for an increase in mean salary

  • H0:m=2100H_0: m = 2100 DH vs. H1:m>2100H_1: m > 2100 DH.
  • Sample of 25 graduates, Xˉ=2180\bar{X} = 2180 DH, ∑(xi−xˉ)2=24000\sum(x_i - \bar{x})^2 = 24000.
  • Variance is unknown, so a t-distribution is used.
  • The critical region is determined by Xˉ>kα\bar{X} > k_\alpha.
  • For α=0.05\alpha=0.05, kαk_\alpha is calculated using the t-distribution with 24 degrees of freedom.
  • If the observed Xˉ\bar{X} falls in the critical region, H0H_0 is rejected, concluding the average salary has significantly increased.

2.4 Testing between two composite hypotheses

  • This involves situations where both H0H_0 and H1H_1 specify ranges of parameter values.
    • Example: H0:θ≤θ0H_0: \theta \le \theta_0 vs. H1:θ>θ0H_1: \theta > \theta_0.

2.4.1 Lehmann's theorem

  • Lehmann's theorem addresses the existence of UPP tests for certain composite hypotheses.
  • If the likelihood ratio L(x;θ)L(x;θ0)\frac{L(x; \theta)}{L(x; \theta_0)} is a monotone function of a statistic TnT_n for all θ>θ0\theta > \theta_0:
    • For testing H0:θ≤θ0H_0: \theta \le \theta_0 vs. H1:θ>θ0H_1: \theta > \theta_0, a UPP test of level α\alpha has the critical region Tn>kαT_n > k_\alpha.
    • For testing H0:θ≥θ0H_0: \theta \ge \theta_0 vs. H1:θ<θ0H_1: \theta < \theta_0, a UPP test of level α\alpha has the critical region Tn<kαT_n < k_\alpha.

2.4.2 Example: Proportion of defective parts

  • Testing if the percentage PP of defective parts exceeds 3%.
  • H0:P≤0.03H_0: P \le 0.03 vs. H1:P>0.03H_1: P > 0.03.
  • The likelihood ratio for PP and P0=0.03P_0=0.03 is a function of the sample proportion FnF_n.
  • Since this ratio is increasing for P>P0P > P_0, Lehmann's theorem applies.
  • A UPP test rejects H0H_0 if the sample proportion FnF_n is greater than a critical value kαk_\alpha.
  • Using a normal approximation for FnF_n under H0H_0, kαk_\alpha is determined to yield P(Fn>kα∣P0=0.03)=αP(F_n > k_\alpha | P_0=0.03) = \alpha.

2.5 The Likelihood Ratio Test (LRT)

  • The LRT is a general method for constructing tests, particularly useful for composite hypotheses and bilateral tests.
  • It considers the ratio of the supremum of the likelihood function over the parameter space of H0H_0 to the supremum over the parameter space of H0∪H1H_0 \cup H_1.
  • The test statistic is λn(x)=sup⁡θ∈Θ0L(x;θ)sup⁡θ∈Θ0∪Θ1L(x;θ)\lambda_n(x) = \frac{\sup_{\theta \in \Theta_0} L(x; \theta)}{\sup_{\theta \in \Theta_0 \cup \Theta_1} L(x; \theta)}.
  • H0H_0 is rejected if λn(x)≤kα\lambda_n(x) \le k_\alpha.

2.5.1 LRT for bilateral tests

  • The LRT is effective for testing simple hypotheses against two-sided composite alternatives.
  • Example: Testing the mean of a normal distribution: H0:m=m0H_0: m = m_0 vs. H1:m≠m0H_1: m \neq m_0.
  • The LRT statistic λn(x)\lambda_n(x) leads to a critical region of the form ∣Xˉ−m0∣>kα′| \bar{X} - m_0 | > k'_{\alpha}, which is a standard bilateral test structure.

2.5.2 Example: Bolt diameter verification

  • Verifying if a machine producing bolts is well-regulated.
  • H0:m=14.00H_0: m = 14.00 mm vs. H1:m≠14.00H_1: m \neq 14.00 mm.
  • The diameter follows a normal distribution.
  • Sample of 6 bolts, Xˉ=14.13\bar{X} = 14.13 mm.
  • Case 1: Known standard deviation σ=0.15\sigma = 0.15 mm.
    • The test statistic is n(Xˉ−m0)σ\frac{\sqrt{n}(\bar{X}-m_0)}{\sigma}.
    • The critical region is ∣Xˉ−m0∣>kα′|\bar{X} - m_0| > k'_\alpha.
    • kα′k'_\alpha is determined using the standard normal distribution for α=0.01\alpha = 0.01.
    • The calculated critical value is 0.1580.158. Since ∣14.13−14∣=0.13≤0.158|14.13 - 14| = 0.13 \le 0.158, H0H_0 is not rejected; the machine is considered well-regulated.
  • Case 2: Unknown standard deviation.
    • The test statistic uses the sample standard deviation SS: n−1(Xˉ−m0)S\frac{\sqrt{n-1}(\bar{X}-m_0)}{S}.
    • The critical region is ∣Xˉ−m0∣>kα′′|\bar{X} - m_0| > k''_\alpha.
    • kα′′k''_\alpha is determined using the t-distribution with n−1=5n-1=5 degrees of freedom for α=0.01\alpha = 0.01.
    • The calculated critical value is 0.320.32. Since ∣14.13−14∣=0.13≤0.32|14.13 - 14| = 0.13 \le 0.32, H0H_0 is not rejected; the machine is considered well-regulated.

> 🔑 Important: For bilateral tests (H1:θ≠θ0H_1: \theta \neq \theta_0), if a UPP test exists for H0:θ=θ0H_0: \theta = \theta_0 vs. H1:θ>θ0H_1: \theta > \theta_0 and for H0:θ=θ0H_0: \theta = \theta_0 vs. H1:θ<θ0H_1: \theta < \theta_0, these cannot simultaneously be the most powerful test for H1:θ≠θ0H_1: \theta \neq \theta_0, necessitating alternative approaches like the LRT.

3. Comparison of independent and dependent samples using parametric tests

3.1 Independent samples: Gaussian data

Parametric tests for independent samples are used to determine if two distinct groups originate from the same population concerning a specific variable. When assuming Gaussian distributions for both samples, X1∼N(m1,σ12)X_1 \sim N(m_1, \sigma_1^2) and X2∼N(m2,σ22)X_2 \sim N(m_2, \sigma_2^2), the null hypothesis H0:F1(x)=F2(x)H_0: F_1(x) = F_2(x) is typically decomposed into testing equality of means and variances.

🔑 Important: The general problem is testing H0:F1(x)=F2(x)H_0: F_1(x) = F_2(x) vs H1:F1(x)≠F2(x)H_1: F_1(x) \neq F_2(x). For Gaussian data, this simplifies to testing means and variances.

3.1.1 Testing variances (Fisher-Snedecor F-test)

This test specifically addresses the equality of variances between two independent Gaussian populations.

  • Hypotheses:

    • H0:σ12=σ22H_0: \sigma_1^2 = \sigma_2^2
    • H1:σ12≠σ22H_1: \sigma_1^2 \neq \sigma_2^2
  • Test Statistic: The test statistic is the ratio of sample variances, adjusted for sample size: F=n1S12n1−1/n2S22n2−1F = \frac{n_1 S_1^2}{n_1 - 1} \left/ \frac{n_2 S_2^2}{n_2 - 1} \right. Under H0H_0, this statistic follows an FF-distribution with (n1−1,n2−1)(n_1-1, n_2-1) degrees of freedom.

  • Decision Rule: Reject H0H_0 if FF falls outside the interval [Fα/2(n1−1,n2−1),F1−α/2(n1−1,n2−1)][F_{\alpha/2}(n_1-1, n_2-1), F_{1-\alpha/2}(n_1-1, n_2-1)].

3.1.2 Testing means (Student's t-test)

Provided that the variances are not significantly different (or if sample sizes are large), Student's t-test is employed to compare the means of two independent Gaussian samples.

  • Hypotheses:

    • H0:m1=m2H_0: m_1 = m_2
    • H1:m1≠m2H_1: m_1 \neq m_2
  • Test Statistic: The t-statistic for independent samples with pooled variance (assuming σ12=σ22\sigma_1^2 = \sigma_2^2) is: T=Xˉ1−Xˉ2(n1−1)S12+(n2−1)S22n1+n2−21n1+1n2T = \frac{\bar{X}_1 - \bar{X}_2}{\sqrt{\frac{(n_1-1)S_1^2 + (n_2-1)S_2^2}{n_1 + n_2 - 2}} \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}} Under H0H_0, this statistic follows a t-distribution with (n1+n2−2)(n_1 + n_2 - 2) degrees of freedom.

  • Decision Rule: Reject H0H_0 if ∣T∣>t1−α/2(n1+n2−2)|T| > t_{1-\alpha/2}(n_1 + n_2 - 2).

📝 Example: Comparing the lifespan of two brands of light bulbs. After testing variances and finding them non-significant, a t-test is used to compare their average lifespans.

3.2 Independent samples: Non-Gaussian data and large sample sizes

When sample sizes are sufficiently large (n1,n2≥30n_1, n_2 \geq 30), the Central Limit Theorem allows for the application of parametric tests for comparing means, even if the underlying distributions are not strictly Gaussian. The variance test based on the F-distribution is generally not valid in this scenario without Gaussian assumptions.

  • Mean comparison for large samples: Student's t-test formula can be applied to compare means, assuming n1,n2≥30n_1, n_2 \ge 30. This approach is robust to deviations from normality.

3.3 Independent samples: Comparing percentages

This section addresses the comparison of proportions from two independent, large samples.

  • Hypotheses:

    • H0:p1=p2H_0: p_1 = p_2
    • H1:p1≠p2H_1: p_1 \neq p_2
  • Test Statistic: An estimator for the common proportion pp is calculated as f=n1f1+n2f2n1+n2f = \frac{n_1f_1 + n_2f_2}{n_1 + n_2}. The test statistic is then: Z=f1−f2f(1−f)(1n1+1n2)Z = \frac{f_1 - f_2}{\sqrt{f(1-f)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}} For large samples, this statistic approximates a standard normal distribution (N(0,1)N(0,1)).

  • Decision Rule: Reject H0H_0 if ∣Z∣>z1−α/2|Z| > z_{1-\alpha/2}.

📝 Example: Evaluating the effectiveness of an advertising campaign by comparing brand awareness percentages before and after the campaign across two distinct large samples.

3.4 Dependent (paired) samples

When observations are paired, meaning each observation in one sample is related to a specific observation in the other (e.g., repeated measures on the same subjects), the analysis focuses on the differences between paired measurements.

  • Hypotheses:

    • H0:μ1=μ2H_0: \mu_1 = \mu_2 (or equivalently, μd=0\mu_d = 0, where μd\mu_d is the mean difference)
    • H1:μ1≠μ2H_1: \mu_1 \neq \mu_2 (or equivalently, μd≠0\mu_d \neq 0)
  • Test Statistic: Let Di=X1i−X2iD_i = X_{1i} - X_{2i} be the difference for the ii-th pair. The test statistic is based on the mean difference dˉ\bar{d} and its standard deviation sds_d: T=dˉsd/nT = \frac{\bar{d}}{s_d / \sqrt{n}} This statistic follows a t-distribution with (n−1)(n-1) degrees of freedom, where nn is the number of pairs.

  • Decision Rule: Reject H0H_0 if ∣T∣>t1−α/2(n−1)|T| > t_{1-\alpha/2}(n-1).

📝 Example: Assessing if two products are perceived similarly by the same group of consumers, where each consumer rates both products. The test focuses on the average difference in ratings.

3.5 Test on the Pearson correlation coefficient

This test determines if there is a statistically significant linear relationship between two continuous variables.

  • Hypotheses:

    • H0:ρ=0H_0: \rho = 0 (no linear correlation)
    • H1:ρ≠0H_1: \rho \neq 0 (there is a linear correlation)
  • Test Statistic: The sample correlation coefficient is denoted by rr. The test statistic is: T=rn−21−r2T = \frac{r \sqrt{n-2}}{\sqrt{1-r^2}} Under H0H_0, this statistic follows a t-distribution with (n−2)(n-2) degrees of freedom.

  • Decision Rule: Reject H0H_0 if ∣T∣>t1−α/2(n−2)|T| > t_{1-\alpha/2}(n-2).

📝 Example: Investigating the relationship between marketing pressure (variable X) and perfume bottle sales (variable Y) by calculating the Pearson correlation coefficient and testing its significance.

🔑 Important: The choice between independent and dependent samples tests hinges critically on the study design and the nature of the data collection. For Gaussian data, variances are typically tested before means. For large samples, normality assumptions become less critical for mean tests.

4. Non-parametric tests and chi-squared applications

4.1 Introduction to non-parametric tests

  • Non-parametric tests: Hypothesis tests that do not require specification of the population's distribution form.
  • Advantages:
    • Applicable when distributional assumptions (e.g., normality) are unmet.
    • Suitable for small sample sizes where normality is hard to verify.
  • Key non-parametric tests:
    • Chi-squared (χ2\chi^2) goodness-of-fit tests.
    • Chi-squared (χ2\chi^2) independence tests.

4.2 Chi-squared goodness-of-fit tests

Goodness-of-fit tests assess the agreement between observed data and a theoretical model. They address two main scenarios:

  • Adjusting a sample to a given probability distribution:

    • The theoretical distribution (its CDF or PDF) is fully specified.
    • The goal is to verify if the observed sample conforms to this known distribution.
  • Adjusting a probability distribution to a sample:

    • The theoretical distribution is unknown.
    • The form and parameters of the distribution are estimated from the sample characteristics.

🔑 Important: Goodness-of-fit tests evaluate an a priori hypothesis about a distribution; they do not discover the true distribution of a random variable 62.

4.2.1 Choosing a distribution

The selection of a theoretical distribution is guided by:

  • Nature of the phenomenon: Discrete vs. continuous.
  • Distribution shape: Inferred from histograms.
  • Key statistical characteristics: Mean, median, variance.
  • Number of parameters: More parameters allow for better adaptation.

4.2.2 Procedure for goodness-of-fit tests

The general procedure involves:

  1. Hypothesis definition:

    • H0H_0: The observations follow a specified theoretical distribution (F=F0F = F_0).
    • H1H_1: The observations do not follow the specified theoretical distribution (F≠F0F \neq F_0).
  2. Significance level (α\alpha): Pre-defined risk of Type I error (rejecting H0H_0 when true).

  3. Calculate test statistic (dd): Based on observed sample data.

  4. Decision rule:

    • If d>qαd > q_\alpha (critical value) or p-value≤αp\text{-value} \le \alpha, reject H0H_0.
    • If d≤qαd \le q_\alpha or p-value>αp\text{-value} > \alpha, do not reject H0H_0.

> Comparison of decision rules for goodness-of-fit tests:

MethodRejection ConditionNon-rejection Condition
Critical Valued>qαd > q_\alphad≤qαd \le q_\alpha
P-valuep-value≤αp\text{-value} \le \alphap-value>αp\text{-value} > \alpha

4.2.3 The Chi-squared statistic for goodness-of-fit

Let XX be the random variable of interest, with a sample of size nn providing observations categorized into kk modalities or classes. Observed frequencies are N1,…,NkN_1, \dots, N_k, such that ∑i=1kNi=n\sum_{i=1}^k N_i = n.

  • Hypotheses:

    • H0H_0: "X∼LX \sim L" (Observations follow theoretical distribution LL).
    • H1H_1: "X≁LX \nsim L" (Observations do not follow distribution LL).
  • Under H0H_0, distribution LL assigns probabilities p1,…,pkp_1, \dots, p_k to the kk categories.

  • The test statistic is: D2=∑i=1k(Ni−npi)2npiD^2 = \sum_{i=1}^k \frac{(N_i - n p_i)^2}{n p_i}

4.2.4 Asymptotic distribution and degrees of freedom

  • Theorem: As n→∞n \to \infty, D2D^2 asymptotically follows a chi-squared distribution: D2→n→∞χν2D^2 \xrightarrow{n \to \infty} \chi^2_\nu.

  • Degrees of freedom (ν\nu):

    • (k−1)(k - 1): If the theoretical distribution is fully specified (no parameters estimated).
    • (k−m−1)(k - m - 1): If mm parameters were estimated from the observations to define the distribution.
  • Decision rule: Reject H0H_0 if d2>χν,1−α2d^2 > \chi^2_{\nu, 1-\alpha}; otherwise, do not reject H0H_0.

> Chi-squared distribution critical values:

Degrees of Freedom (ν\nu)α=0.05\alpha = 0.05 (1-α\alpha=0.95)
13.84
25.99
37.81
612.59

4.2.5 Important considerations for χ2\chi^2 goodness-of-fit

  • Type II error: Cannot be determined as the distribution of XX is unspecified under H1H_1.

  • Sample size requirement: For the χ2\chi^2 approximation to hold, the expected frequency (npin p_i) in each class should ideally be greater than 5. If not, classes should be merged until this condition is met 67.

> Example of class merging: If classes with expected frequencies below 5 exist, combine them with adjacent classes to satisfy the npi>5n p_i > 5 rule.

4.2.5.1 Example: Poisson distribution fitting

  • Scenario: Analyzing car arrivals at a toll booth over 200 minutes. Observed frequencies for 0 to 11 cars per minute.
  • Objective: Determine a suitable theoretical distribution and test its fit.
  • Procedure:
    • Calculate sample mean (xˉ≈4\bar{x} \approx 4) and variance (σ2≈4.02\sigma^2 \approx 4.02).
    • Calculate expected frequencies (npin p_i) assuming a Poisson distribution with λ=xˉ\lambda = \bar{x}.
    • Apply the χ2\chi^2 statistic formula.
    • For Poisson, ν=k−m−1=12−1−1=10\nu = k - m - 1 = 12 - 1 - 1 = 10 (1 parameter λ\lambda estimated, 12 classes).
    • If d2>χ10,0.952d^2 > \chi^2_{10, 0.95}, reject Poisson.
    • Crucial step: Merge classes with low expected frequencies (e.g., 9, 10, 11 cars) to satisfy npi>5n p_i > 5. The example shows merging for classes ≥9\ge 9 and calculating expected probabilities for these merged classes.
    • The calculation demonstrated merging the last 4 classes and resulted in ν=6\nu=6 for the χ2\chi^2 distribution. 68-69

> Example of Poisson fitting result: After merging classes, the calculated χ2\chi^2 statistic was 2.892.89. With ν=6\nu=6 and α=0.05\alpha=0.05, the critical value χ6,0.952=12.59\chi^2_{6, 0.95} = 12.59. Since 2.89≤12.592.89 \le 12.59, the Poisson distribution is not rejected 69.

4.2.5.2 Example: Uniform distribution testing

  • Scenario: 1000 random numbers generated between 0 and 1.
  • Objective: Test if the sequence is uniformly distributed.
  • Hypotheses:
    • H0H_0: Distribution is uniform on. pi=0.1p_i = 0.1 for each of the 10 classes 1.
    • H1H_1: Distribution is not uniform.
  • Calculation: χ2\chi^2 statistic calculated as 23.4823.48.
  • Degrees of freedom: k−1=10−1=9k - 1 = 10 - 1 = 9 (uniform distribution is fully specified).
  • Conclusion: With α=0.05\alpha=0.05, the critical value χ9,0.952≈16.92\chi^2_{9, 0.95} \approx 16.92. Since 23.48>16.9223.48 > 16.92, H0H_0 is rejected. The sequence is not uniformly distributed. 70-71

4.2.5.3 Example: Normal distribution testing

  • Scenario: Market research data on potential customers' willingness to pay for a new product, grouped into price classes.
  • Objective: Test if the data comes from a normal distribution.
  • Procedure:
    • Estimate mean (xˉ≈59.4\bar{x} \approx 59.4) and standard deviation (σ≈14.34\sigma \approx 14.34) from the grouped data.
    • Calculate expected frequencies (npin p_i) for each class assuming a normal distribution N(xˉ,σ2)N(\bar{x}, \sigma^2). This involves calculating Z-scores for class boundaries and using standard normal CDFs.
    • Apply the χ2\chi^2 statistic formula.
  • Degrees of freedom: k−m−1=7−2−1=4k - m - 1 = 7 - 2 - 1 = 4. Here, m=2m=2 for estimating mean and standard deviation. Correction: The provided calculation uses ν=6−2−1=3\nu = 6 - 2 - 1 = 3. This implies 6 classes, 2 estimated parameters (mean, variance), and 1 for the distribution type. It's common to use k−m−1k-m-1. The document's calculation result suggests ν=3\nu=3 leading to χ3,0.952=7.81\chi^2_{3, 0.95} = 7.81.
  • Conclusion: The calculated statistic (6.986.98) is less than the critical value (7.817.81). H0H_0 (normal distribution) is not rejected. 72-73

> Important distinction in degrees of freedom: ν=k−1\nu = k - 1 when the distribution is fully specified, and ν=k−m−1\nu = k - m - 1 when mm parameters are estimated from data 66.

4.3 Chi-squared test for independence

This test assesses whether two categorical variables are independent or associated.

  • Data structure: Observations are presented in a contingency table with kk rows (categories of variable X) and pp columns (categories of variable Y).

    • NijN_{ij}: Observed frequency in cell (i, j).
    • ni.n_{i.}: Row marginal total for row ii.
    • n.jn_{.j}: Column marginal total for column jj.
    • NN: Total number of observations.
    Y / Xy1y_1y2y_2...yjy_j...ypy_pTotal
    x1x_1n11n_{11}n12n_{12}...n1jn_{1j}...n1pn_{1p}n1.n_{1.}
    ........................
    xix_ini1n_{i1}ni2n_{i2}...nijn_{ij}...nipn_{ip}ni.n_{i.}
    ........................
    xkx_knk1n_{k1}nk2n_{k2}...nkjn_{kj}...nkpn_{kp}nk.n_{k.}
    Totaln.1n_{.1}n.2n_{.2}...n.jn_{.j}...n.pn_{.p}NN

4.3.1 The Chi-squared statistic for independence

  • Hypotheses:

    • H0H_0: Variables X and Y are independent.
    • H1H_1: Variables X and Y are not independent (associated).
  • Under H0H_0, the expected frequency for cell (i, j) is calculated as: nij=ni.×n.jNn_{ij} = \frac{n_{i.} \times n_{.j}}{N}

  • The test statistic is: D2=∑i=1k∑j=1p(Nij−nij)2nijD^2 = \sum_{i=1}^k \sum_{j=1}^p \frac{(N_{ij} - n_{ij})^2}{n_{ij}}

4.3.2 Asymptotic distribution and degrees of freedom

  • Theorem: As n→∞n \to \infty, D2D^2 asymptotically follows a chi-squared distribution: D2→n→∞χ(k−1)(p−1)2D^2 \xrightarrow{n \to \infty} \chi^2_{(k-1)(p-1)}.

  • Degrees of freedom (ν\nu): ν=(k−1)(p−1)\nu = (k-1)(p-1), where kk is the number of rows and pp is the number of columns in the contingency table.

  • Decision rule: Reject H0H_0 if d2>χν,1−α2d^2 > \chi^2_{\nu, 1-\alpha}; otherwise, do not reject H0H_0.

> Key takeaway for independence test: The degrees of freedom for independence tests are calculated as (number of rows - 1) * (number of columns - 1).

4.3.2.1 Example: Independence of socio-professional category and number of children

  • Scenario: Survey of 1205 households classified by socio-professional category (A, B, C, D) and number of children (0 or 1, 2 or 3, >3).
  • Objective: Test for independence between these two classification criteria.
  • Contingency Table: Provided with observed frequencies NijN_{ij}.
  • Procedure:
    • Calculate expected frequencies nijn_{ij} for each cell using the formula ni.×n.jN\frac{n_{i.} \times n_{.j}}{N}.
    • Calculate the χ2\chi^2 statistic D2D^2.
  • Degrees of freedom: ν=(4 categories−1)×(3 categories−1)=3×2=6\nu = (4 \text{ categories} - 1) \times (3 \text{ categories} - 1) = 3 \times 2 = 6.
  • Conclusion: The calculated statistic is 13.513.5. With α=0.05\alpha=0.05, the critical value χ6,0.952=12.59\chi^2_{6, 0.95} = 12.59. Since 13.5>12.5913.5 > 12.59, H0H_0 (independence) is rejected. There is an association between socio-professional category and the number of children. 76-77

🔑 Important: Chi-squared tests for independence are powerful tools for examining associations between categorical variables, but they require sufficient expected cell counts (generally >5) for the χ2\chi^2 approximation to be valid.

🔑 Important: Non-parametric tests, particularly chi-squared applications, are vital for situations where parametric assumptions are violated, offering robust methods for goodness-of-fit and independence assessments.

5. Simple linear regression model and parameter estimation

5.1 The simple linear regression model

  • Model definition: A simple linear regression model describes the relationship between a dependent variable (YiY_i) and an independent variable (XiX_i) as: Yi=β0+β1Xi+εiY_i = \beta_0 + \beta_1X_i + \varepsilon_i \quad 1.
    • YiY_i: Dependent variable (endogenous).
    • XiX_i: Independent variable (exogenous).
    • β0\beta_0: Intercept (constant at the origin).
    • β1\beta_1: Slope of the regression line.
    • εi\varepsilon_i: Error term (noise).
  • Matrix representation: The model can be expressed in matrix form: Y=Xβ+εY = X\beta + \varepsilon where YY is the vector of dependent variables, XX is the design matrix, β\beta is the vector of parameters, and ε\varepsilon is the vector of errors.
  • Assumptions on error terms (ε\varepsilon): These are crucial for estimator properties and statistical inference.
    • H1: E(εi)=0E(\varepsilon_i) = 0 for all ii.
    • H2: Var(εi)=σ2Var(\varepsilon_i) = \sigma^2 (homoscedasticity).
    • H3: cov(εi,εj)=0cov(\varepsilon_i, \varepsilon_j) = 0 for i≠ji \neq j (uncorrelated errors).
    • H4: εi∼N(0,σ2)\varepsilon_i \sim N(0, \sigma^2) (normality).

5.2 Parameter estimation using Ordinary Least Squares (OLS)

  • Objective: To find parameter estimates (β^0,β^1\hat{\beta}_0, \hat{\beta}_1) that best fit the data by minimizing the sum of squared errors.
  • Minimization criterion: The OLS method minimizes the sum of squared residuals (S(β0,β1)S(\beta_0, \beta_1)): S(β0,β1)=∑i=1n(yi−β0−β1xi)2=∑i=1nεi2S(\beta_0, \beta_1) = \sum_{i=1}^{n} (y_i - \beta_0 - \beta_1x_i)^2 = \sum_{i=1}^{n} \varepsilon_i^2
  • OLS Estimators:
    • Slope (β^1\hat{\beta}_1): β^1=∑i=1n(xi−xˉ)(yi−yˉ)∑i=1n(xi−xˉ)2=cov(X,Y)V(X)\hat{\beta}_1 = \frac{\sum_{i=1}^{n}(x_i - \bar{x})(y_i - \bar{y})}{\sum_{i=1}^{n}(x_i - \bar{x})^2} = \frac{cov(X, Y)}{V(X)} \quad 3.
    • Intercept (β^0\hat{\beta}_0): β^0=yˉ−β^1xˉ\hat{\beta}_0 = \bar{y} - \hat{\beta}_1\bar{x} \quad 2.
  • Properties of OLS estimators:
    • The OLS line passes through the centroid of the data (xˉ,yˉ)(\bar{x}, \bar{y}).
    • β^0\hat{\beta}_0 and β^1\hat{\beta}_1 are linear functions of the dependent variable YY.
    • Under the model's assumptions, β^0\hat{\beta}_0, β^1\hat{\beta}_1, and σ^2\hat{\sigma}^2 are unbiased, consistent, and minimum variance estimators (BLUE - Best Linear Unbiased Estimators).

Key relationship: The OLS estimators are derived by minimizing the sum of squared differences between observed and predicted values.

5.3 Properties of estimated parameters and variance

  • Relationship for β^1\hat{\beta}_1: β^1=β1+∑i=1n(xi−xˉ)εi∑i=1n(xi−xˉ)2\hat{\beta}_1 = \beta_1 + \frac{\sum_{i=1}^{n}(x_i - \bar{x})\varepsilon_i}{\sum_{i=1}^{n}(x_i - \bar{x})^2} \quad 4.
  • Estimator for error variance (σ^2\hat{\sigma}^2):
    • Calculated from the sum of squared residuals: σ^2=∑i=1nε^i2n−2\hat{\sigma}^2 = \frac{\sum_{i=1}^{n} \hat{\varepsilon}_i^2}{n-2}.

Key relationship: The variance of the estimated parameters depends on the variance of the errors and the spread of the independent variable.

5.4 Distributions of estimated parameters

  • Distribution of σ^2/σ2\hat{\sigma}^2 / \sigma^2: σ^2σ2∼χ2(n−2)\frac{\hat{\sigma}^2}{\sigma^2} \sim \chi^2(n-2) where χ2\chi^2 is the chi-squared distribution with n−2n-2 degrees of freedom.
  • Distribution of β^1\hat{\beta}_1: β^1−β1σ^β^1∼t(n−2)\frac{\hat{\beta}_1 - \beta_1}{\hat{\sigma}_{\hat{\beta}_1}} \sim t(n-2) where σ^β^1=σ^/∑i=1n(xi−xˉ)2\hat{\sigma}_{\hat{\beta}_1} = \hat{\sigma} / \sqrt{\sum_{i=1}^{n}(x_i - \bar{x})^2} is the estimated standard error of β^1\hat{\beta}_1. This follows a Student's t-distribution with n−2n-2 degrees of freedom.
  • Distribution of β^0\hat{\beta}_0: β^0−β0σ^β^0∼t(n−2)\frac{\hat{\beta}_0 - \beta_0}{\hat{\sigma}_{\hat{\beta}_0}} \sim t(n-2) where σ^β^0=σ^1n+xˉ2∑i=1n(xi−xˉ)2\hat{\sigma}_{\hat{\beta}_0} = \hat{\sigma}\sqrt{\frac{1}{n} + \frac{\bar{x}^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}} is the estimated standard error of β^0\hat{\beta}_0. This also follows a Student's t-distribution with n−2n-2 degrees of freedom.

Key relationship: Under normality assumptions, estimated parameters follow t-distributions, enabling inference.

5.5 Confidence intervals for parameters

  • Confidence interval for β0\beta_0: IC(β0)=[β^0−t(n−2),(1−α/2)σ^β^0,β^0+t(n−2),(1−α/2)σ^β^0]IC(\beta_0) = [\hat{\beta}_0 - t_{(n-2), (1-\alpha/2)}\hat{\sigma}_{\hat{\beta}_0}, \hat{\beta}_0 + t_{(n-2), (1-\alpha/2)}\hat{\sigma}_{\hat{\beta}_0}]
  • Confidence interval for β1\beta_1: IC(β1)=[β^1−t(n−2),(1−α/2)σ^β^1,β^1+t(n−2),(1−α/2)σ^β^1]IC(\beta_1) = [\hat{\beta}_1 - t_{(n-2), (1-\alpha/2)}\hat{\sigma}_{\hat{\beta}_1}, \hat{\beta}_1 + t_{(n-2), (1-\alpha/2)}\hat{\sigma}_{\hat{\beta}_1}] where t(n−2),(1−α/2)t_{(n-2), (1-\alpha/2)} is the (1−α/2)(1-\alpha/2) quantile of the Student's t-distribution with n−2n-2 degrees of freedom.

Key relationship: Confidence intervals quantify the uncertainty around the estimated regression coefficients.

5.6 Prediction using the model

  • Point prediction: For a new value xn+1x_{n+1}, the predicted value is: y^n+1=β^0+β^1xn+1\hat{y}_{n+1} = \hat{\beta}_0 + \hat{\beta}_1x_{n+1}
  • Prediction error variance: The variance of the prediction error (ε^n+1=yn+1−y^n+1\hat{\varepsilon}_{n+1} = y_{n+1} - \hat{y}_{n+1}) is: V(ε^n+1)=σ2(1+1n+(xn+1−xˉ)2∑i=1n(xi−xˉ)2)V(\hat{\varepsilon}_{n+1}) = \sigma^2 \left(1 + \frac{1}{n} + \frac{(x_{n+1}-\bar{x})^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}\right) \quad 5. When σ2\sigma^2 is unknown, its estimate σ^2\hat{\sigma}^2 is used: V(ε^n+1)=σ^2(1+1n+(xn+1−xˉ)2∑i=1n(xi−xˉ)2)V(\hat{\varepsilon}_{n+1}) = \hat{\sigma}^2 \left(1 + \frac{1}{n} + \frac{(x_{n+1}-\bar{x})^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}\right) \quad 6.
  • Prediction interval: A (1−α)(1-\alpha) prediction interval for yn+1y_{n+1} is: y^n+1±t(1−α/2),(n−2)σ^1+1n+(xn+1−xˉ)2∑i=1n(xi−xˉ)2\hat{y}_{n+1} \pm t_{(1-\alpha/2), (n-2)} \hat{\sigma} \sqrt{1 + \frac{1}{n} + \frac{(x_{n+1}-\bar{x})^2}{\sum_{i=1}^{n}(x_i - \bar{x})^2}}

Key relationship: Prediction intervals are wider than confidence intervals due to the additional uncertainty in predicting a new observation.

5.7 Model validity tests

  • Normality of residuals: Assessed visually using histograms and Q-Q plots.
  • Homoscedasticity of residuals: Evaluated by plotting residuals against predicted values or the independent variable; a constant variance (no pattern) indicates homoscedasticity.
  • Uncorrelation of residuals:
    • Tested using the Durbin-Watson test, which checks for autocorrelation.
    • The statistic D=∑i=2n(εi−εi−1)2∑i=1nεi2D = \frac{\sum_{i=2}^{n}(\varepsilon_i - \varepsilon_{i-1})^2}{\sum_{i=1}^{n} \varepsilon_i^2} should be close to 2 for non-correlated residuals.
  • Significance of the slope:
    • Hypotheses: H0:β1=0H_0: \beta_1 = 0 vs. H1:β1≠0H_1: \beta_1 \neq 0.
    • Test statistic: T=β^1σ^β^1∼t(n−2)T = \frac{\hat{\beta}_1}{\hat{\sigma}_{\hat{\beta}_1}} \sim t(n-2). Reject H0H_0 if pp-value ≤α\le \alpha.

5.8 Analysis of variance (ANOVA)

  • Variance decomposition: The total variation in YY (SCTSCT) is decomposed into variation explained by the regression (SCESCE) and residual variation (SCRSCR): SCT=SCR+SCESCT = SCR + SCE where SCT=∑i=1n(yi−yˉ)2SCT = \sum_{i=1}^{n}(y_i - \bar{y})^2, SCR=∑i=1n(yi−y^i)2SCR = \sum_{i=1}^{n}(y_i - \hat{y}_i)^2, and SCE=∑i=1n(y^i−yˉ)2SCE = \sum_{i=1}^{n}(\hat{y}_i - \bar{y})^2.
  • Coefficient of Determination (R2R^2): R2=SCESCT=1−SCRSCTR^2 = \frac{SCE}{SCT} = 1 - \frac{SCR}{SCT}
    • R2R^2 ranges from 0 to 1. A value closer to 1 indicates a better model fit.
    • R2R^2 is the square of the empirical correlation coefficient between xix_i and yiy_i: R2=ρ2(X,Y)R^2 = \rho^2(X, Y).
  • Global significance test:
    • Hypotheses: H0:R2=0H_0: R^2 = 0 vs. H1:R2≠0H_1: R^2 \neq 0.
    • Test statistic: F=SCE/1SCR/(n−2)∼F(1,n−2)F = \frac{SCE/1}{SCR/(n-2)} \sim F(1, n-2). Reject H0H_0 if pp-value ≤α\le \alpha.
    • This test is equivalent to the test of significance of the slope (β1\beta_1).

Key relationship: R2R^2 quantifies the proportion of variance in the dependent variable explained by the independent variable.

🔑 Important: The simple linear regression model provides a foundational framework for understanding linear relationships, with OLS offering statistically sound parameter estimates under specific assumptions, which are critical for valid inference and prediction.

6. Multiple linear regression and model validation

6.1 Model formulation

  • Objective: To explain a response variable YY using multiple predictor variables X1,…,XpX_1, \dots, X_p.
  • Equation form: For nn independent and identically distributed observations (xi1,…,xip,yi)(x_{i1}, \dots, x_{ip}, y_i), the model is: yi=β0+β1xi1+⋯+βpxip+εiy_i = \beta_0 + \beta_1 x_{i1} + \dots + \beta_p x_{ip} + \varepsilon_i where εi\varepsilon_i represents the unexplained error.
  • Matrix form: The model can be expressed as: Y=Xβ+εY = X\beta + \varepsilon where YY is the n×1n \times 1 vector of observations, XX is the n×(p+1)n \times (p+1) design matrix (with a column of ones for β0\beta_0), β\beta is the (p+1)×1(p+1) \times 1 vector of coefficients, and ε\varepsilon is the n×1n \times 1 vector of errors.

6.2 Assumptions on error terms

The core assumptions for valid inference in multiple linear regression concern the error term ε\varepsilon:

  • H1: Zero mean: E(ε)=0E(\varepsilon) = 0. The expected error is zero.
  • H2: Homoscedasticity: Var(ε)=σ2In\text{Var}(\varepsilon) = \sigma^2 I_n. The errors have constant variance σ2\sigma^2, and they are uncorrelated. InI_n is the identity matrix of order nn.
  • H3: Uncorrelated errors: cov(εi,εj)=0\text{cov}(\varepsilon_i, \varepsilon_j) = 0 for i≠ji \neq j.
  • H4: Normality: ε∼N(0,σ2In)\varepsilon \sim N(0, \sigma^2 I_n). Errors are normally distributed. This assumption is crucial for statistical inference.

🔑 Important: The design matrix XX must have full column rank, meaning XTXX^T X is invertible. This prevents perfect multicollinearity, where a predictor is a linear combination of others, rendering it redundant.

6.3 Ordinary Least Squares (OLS) estimation

  • Definition: The OLS estimator β^\hat{\beta} is the vector of coefficients that minimizes the sum of squared residuals: β^=arg⁡min⁡∣∣Y−Xβ∣∣2\hat{\beta} = \arg \min ||Y - X\beta||^2
  • Proposition: Under the full column rank assumption for XX, the unique OLS estimator is: β^=(XTX)−1XTY\hat{\beta} = (X^T X)^{-1} X^T Y
  • Properties of β^\hat{\beta}:
    • Unbiasedness: E(β^)=βE(\hat{\beta}) = \beta. OLS provides an unbiased estimate of the true coefficients.
    • Minimum Variance (Gauss-Markov Theorem): Among all linear unbiased estimators (BLUE), OLS has the smallest variance.
    • Variance: V(β^)=σ2(XTX)−1V(\hat{\beta}) = \sigma^2 (X^T X)^{-1}.
  • Error variance estimation: The unbiased estimator for σ2\sigma^2 is: σ^2=∣∣ε^∣∣2n−p−1\hat{\sigma}^2 = \frac{||\hat{\varepsilon}||^2}{n - p - 1} where ε^=Y−Xβ^\hat{\varepsilon} = Y - X\hat{\beta} is the vector of estimated residuals.

6.4 Distributions of estimators

Under assumption H4 (normality of errors) and full column rank of XX:

  • Distribution of β^\hat{\beta}: β^∼N(β,σ2(XTX)−1)\hat{\beta} \sim N(\beta, \sigma^2 (X^T X)^{-1})
  • Distribution of σ^2\hat{\sigma}^2: (n−p−1)σ^2σ2∼χn−p−12\frac{(n - p - 1) \hat{\sigma}^2}{\sigma^2} \sim \chi^2_{n-p-1}
  • Independence: β^\hat{\beta} and σ^2\hat{\sigma}^2 are independent.

6.5 Confidence intervals for βi\beta_i

  • T-statistic: For individual coefficients βi\beta_i (i=0,…,pi=0, \dots, p), the statistic is: Ti=β^i−βiσ^[(XTX)−1]ii∼tn−p−1T_i = \frac{\hat{\beta}_i - \beta_i}{\hat{\sigma} \sqrt{[(X^T X)^{-1}]_{ii}}} \sim t_{n-p-1} where [(XTX)−1]ii[(X^T X)^{-1}]_{ii} is the ii-th diagonal element of (XTX)−1(X^T X)^{-1}.
  • Bilateral Confidence Interval: A (1−α)(1-\alpha) level confidence interval for βi\beta_i is: [β^i−tn−p−1,(1−α/2)σ^[(XTX)−1]ii,β^i+tn−p−1,(1−α/2)σ^[(XTX)−1]ii][\hat{\beta}_i - t_{n-p-1, (1-\alpha/2)} \frac{\hat{\sigma}}{\sqrt{[(X^T X)^{-1}]_{ii}}}, \hat{\beta}_i + t_{n-p-1, (1-\alpha/2)} \frac{\hat{\sigma}}{\sqrt{[(X^T X)^{-1}]_{ii}}}]

6.6 Model validation

Model validation assesses the goodness-of-fit and predictive capability of the regression model.

MetricFormulaInterpretation
Coefficient of Determination (R2R^2)R2=1−SCRSCTR^2 = 1 - \frac{SCR}{SCT}Proportion of variance in YY explained by X1,…,XpX_1, \dots, X_p. Ranges from 0 to 1.
Adjusted R2R^2 (Ra2R^2_a)Ra2=1−n−1n−p−1(1−R2)R^2_a = 1 - \frac{n-1}{n-p-1} (1 - R^2)Penalizes the addition of irrelevant predictors. Useful for comparing models with different numbers of predictors. Can be negative.
Prediction Intervaly^n+1±tn−p−1,(1−α/2)σ^xn+1T(XTX)−1xn+1+1\hat{y}_{n+1} \pm t_{n-p-1, (1-\alpha/2)} \hat{\sigma} \sqrt{x_{n+1}^T (X^T X)^{-1} x_{n+1} + 1}Interval for a new individual observation yn+1y_{n+1}, accounting for both estimation error and inherent variability of yn+1y_{n+1}.

🔑 Important: While R2R^2 always increases or stays the same when adding variables, Ra2R^2_a can decrease if the added variable does not improve the fit sufficiently. Ra2R^2_a is primarily useful for comparing nested models.

6.7 Significance tests

Tests are employed to determine the statistical significance of the overall model and individual predictors.

TestNull Hypothesis (H0H_0)Alternative Hypothesis (H1H_1)Test Statistic
Global Model Significanceβ1=β2=⋯=βp=0\beta_1 = \beta_2 = \dots = \beta_p = 0∃j s.t. βj≠0\exists j \text{ s.t. } \beta_j \neq 0F=SCE/pSCR/(n−p−1)=R2/p(1−R2)/(n−p−1)F = \frac{SCE/p}{SCR/(n-p-1)} = \frac{R^2/p}{(1-R^2)/(n-p-1)}
Individual Coefficient (βj\beta_j)βj=0\beta_j = 0βj≠0\beta_j \neq 0Tj=β^jσ^β^j∼tn−p−1T_j = \frac{\hat{\beta}_j}{\hat{\sigma}_{\hat{\beta}_j}} \sim t_{n-p-1}
Block of Coefficientsβ1=⋯=βq=0\beta_1 = \dots = \beta_q = 0∃j∈{1,…,q} s.t. βj≠0\exists j \in \{1, \dots, q\} \text{ s.t. } \beta_j \neq 0F=(Rfull2−Rreduced2)/q(1−Rfull2)/(n−p−1)F = \frac{(R^2_{full} - R^2_{reduced})/q}{(1 - R^2_{full})/(n-p-1)} (using R2R^2 from nested models)

📝 Example: The global model test (FF-test) is equivalent to testing the significance of R2R^2. If H0H_0 is rejected, the model as a whole is statistically significant. For individual coefficients, rejecting H0H_0 suggests that the predictor XjX_j is significantly associated with YY, controlling for other variables in the model.

6.8 Model selection criteria

When faced with multiple potential predictor variables, various criteria aid in selecting the most parsimonious and effective model:

CriterionObjectiveFormulaNotes
R2R^2Maximize explained variance.R2=1−SCRSCTR^2 = 1 - \frac{SCR}{SCT}Favors models with more variables; not suitable for comparing models with differing numbers of predictors.
Adjusted R2R^2Maximize explained variance, penalizing complexity.Ra2=1−n−1n−p−1(1−R2)R^2_a = 1 - \frac{n-1}{n-p-1} (1 - R^2)Better for comparing models with different numbers of predictors.
AICMinimize information loss.AIC=nln⁡(SCRn)+2(p+1)\text{AIC} = n \ln(\frac{SCR}{n}) + 2(p+1)Balances model fit with the number of parameters.
BICMinimize information loss, stronger penalty for complexity.BIC=nln⁡(SCRn)+ln⁡(n)(p+1)\text{BIC} = n \ln(\frac{SCR}{n}) + \ln(n)(p+1)Tends to select more parsimonious models than AIC.

6.9 Model selection techniques

Systematic procedures are used to select predictor variables:

TechniqueDescription
Forward SelectionStarts with no predictors. Iteratively adds the predictor that most improves the model fit (e.g., lowest p-value) until no further significant improvement is found.
Backward EliminationStarts with all predictors. Iteratively removes the predictor that least contributes to the model (e.g., highest p-value) until all remaining predictors are significant.
Stepwise SelectionA hybrid approach. At each step, it considers adding or removing a predictor to optimize a chosen criterion (e.g., lowest p-value for entry, highest p-value for removal). It can both add and remove variables in a single step.
Partial F-testUsed within forward and backward selection to assess the marginal contribution of a variable. It tests the null hypothesis that a block of coefficients is zero.

🔑 Important: Model selection methods like forward, backward, and stepwise selection help navigate the trade-off between model complexity and explanatory power, aiming for models that are both statistically sound and interpretable.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also