Econometric Hypothesis Testing, F-Tests, and R Implementation Notes

Scale of Measurement and Hypothesis Testing Framework

  • Housing Data Framework and Measurement Scale:

    • The scaling of measurement units directly impacts the numerical value of estimated coefficients without altering underlying statistical relationships.
    • When housing values are measured in different monetary increments (e.g., 1 dollar1\,\text{dollar}, 1,000 dollars1,000\,\text{dollars}, or 1,000,000 dollars1,000,000\,\text{dollars}), the point estimates change proportionally to match the scale.
    • Evaluation of coefficient magnitude requires distinguishing between practical significance (the real-world size of the effect given the measurement scale) and statistical significance.
    • A coefficient may appear numerically tiny due to a large scale of measurement, yet remain statistically meaningful.
  • Non-Zero Null Hypothesis Testing:

    • Standard null hypotheses test whether a parameter equals zero (H0:β=0H_0: \beta = 0), but specific theoretical hypotheses require testing non-zero specific values, such as H0:β4=0.2H_0: \beta_4 = 0.2.
    • The general formula for calculating the t-statistict\text{-statistic} when testing a specific hypothesized parameter value bb is:

t=β^−bSE(β^)t = \frac{\hat{\beta} - b}{\text{SE}(\hat{\beta})}

  • When testing H0:β4=0.2H_0: \beta_4 = 0.2, the test statistic is constructed by substituting b=0.2b = 0.2 into the formula:

t=β^4−0.2SE(β^4)t = \frac{\hat{\beta}_4 - 0.2}{\text{SE}(\hat{\beta}_4)}

  • Execution in R Code (Line 30):
    • At line 30 of the script, the parameter estimate vector fit_hat (extracting row elements 1 through 5) is utilized.
    • The specified value 0.20.2 is subtracted directly from the point estimate in the numerator before dividing by the saved standard error to derive the correct t-statistict\text{-statistic} and corresponding p-valuep\text{-value}.

Probability Values, Model Estimation, and Stargazer Table Output

  • p-Valuep\text{-Value} Computation Mechanics:

    • The p-valuep\text{-value} is calculated using the probability density function and the appropriate degrees of freedom associated with the model's test statistic.
    • For a standard two-tailed hypothesis test, R computes the lower-tail probability for the calculated test statistic and multiplies this area by 22 to account for both tails of the distribution.
    • Example output interpretation: A computed p-valuep\text{-value} of 0.7850.785 exceeds standard significance thresholds (α=0.05\alpha = 0.05 and α=0.01\alpha = 0.01), leading to a failure to reject the null hypothesis.
  • Major League Baseball (MLB) Player Salary Empirical Example:

    • Outcome/Dependent Variable: MLB player salary (lowest salary or log salary).
    • Primary explanatory variables evaluated for determining player compensation:
    • Years of professional playing experience (years).
    • Games played per year (games).
    • Batting average (attrition / bavg).
  • Exporting Regression Tables using stargazer:

    • Regression objects are estimated and saved across script lines (e.g., line 6, line 2, line 95, line 9).
    • The stargazer package aggregates multiple saved regression models into a unified publication-ready table format.
    • Command option out is specified to output the structured table directly to an external text or document file (e.g., out = "regression_results.txt").
    • Layout structure of generated tables: Displays the dependent variable at the top header, followed by rows for each independent variable with corresponding coefficient estimates listed above their standard errors placed in parentheses.

Sum of Squared Residuals and F-Test Mechanics

  • Foundation of the F-TestF\text{-Test}:

    • The F-testF\text{-test} evaluates structural restrictions by comparing the Sum of Squared Residuals (SSRSSR) between an unrestricted model (SSRurSSR_{ur}) and a restricted model (SSRrSSR_r).
    • Null Hypothesis Example: Testing whether a parameter is zero (H0:β2=0H_0: \beta_2 = 0).
    • Automatic Variable Removal: If H0H_0 is true, omitting the variable does not worsen model fit, meaning the error terms and sum of squared residuals of both models are virtually identical (SSRr≈SSRurSSR_r \approx SSR_{ur}).
    • The test statistic measures the relative difference between SSRrSSR_r and SSRurSSR_{ur}.
  • Properties of the F-DistributionF\text{-Distribution}:

    • Under the null hypothesis, the ratio of residual variances follows an F-distributionF\text{-distribution} anchored at or near 00.
    • When the null hypothesis is true, the observed F-statisticF\text{-statistic} falls very close to 00.
    • As the computed F-statisticF\text{-statistic} becomes larger, the discrepancy between the restricted and unrestricted models grows, providing evidence against the null hypothesis.
  • Overall Significance Test (F-TestF\text{-Test} for Joint Significance):

    • Formally tests whether all slope coefficients simultaneously equal zero against the alternative that at least one coefficient is non-zero:

H0:β1=β2=⋯=βk=0H_0: \beta_1 = \beta_2 = \dots = \beta_k = 0

  • Restricted Model: Contains only the constant intercept term (β0\beta_0).
  • Unrestricted Model: Contains the intercept plus all kk explanatory variables (e.g., a 10-variable specification).
  • Rejection of H0H_0 indicates that the set of explanatory variables jointly explains a statistically significant portion of the variance in the dependent variable.

Single Hypothesis Testing, Significance Rules, and the car Package

  • Equivalence of t-Testt\text{-Test} and F-TestF\text{-Test} for Single Restrictions:
    • When testing a single linear restriction (q=1q = 1 restriction), the t-testt\text{-test} and F-testF\text{-test} yield identical statistical decisions and p-valuesp\text{-values}.
    • Mathematically, for a single hypothesis restriction, the relationship between statistics is:

F=t2F = t^2

  • Programming Advantage: Executing single restrictions via an F-testF\text{-test} framework in R is often syntax-wise simpler due to standardized software package functions.

    • Implementation with the car Package:
  • Package installation and library loading:

    • install.packages("car")
    • library(car)
  • The linearHypothesis() function provided by the car package allows direct testing of parameter restrictions using saved model objects.

    • Empirical Rule of Thumb for Statistical Significance:
  • Standard ratio check from regression outputs:

Ratio=EstimateStandard Error\text{Ratio} = \frac{\text{Estimate}}{\text{Standard Error}}

  • Rule of Thumb: If the absolute value of the point estimate is more than twice as large as its standard error (referencing the critical threshold 1.96≈21.96 \approx 2 at the 5%5\% significance level), the variable is deemed statistically significant.

Joint Hypothesis Testing and Linear Combinations of Parameters

  • Testing Joint Hypotheses in R:

    • Multiple parameter constraints can be tested simultaneously within linearHypothesis() by combining hypothesis strings using R's concatenate function c().
    • Example for two linear restrictions (q=2q = 2 parameters tested jointly):
    • linearHypothesis(model_fit, c("var1 = 0", "var2 = 0"))
  • Testing Linear Combinations of Parameters:

    • Used when testing hypothesis constraints involving combinations of multiple parameters, such as:

H0:β2+12β3=0H_0: \beta_2 + 12\beta_3 = 0

  • Practical context: Evaluating partial or marginal effects containing interaction terms or non-linear functions at specific variable values.

  • Marginal effect evaluation example: Testing experience effects at specific thresholds, such as evaluated at 10 years of experience (e.g., testing experience+20×experience2\text{experience} + 20 \times \text{experience}^2) or evaluating combined experience and education interaction effects (e.g., experience+12×education×experience\text{experience} + 12 \times \text{education} \times \text{experience}).

  • Syntax Constraint: Explicit multiplication symbols inside string arguments in linearHypothesis() can cause execution errors if not formatted correctly.

  • Interaction specification in R regression formulas: Specified using the colon operator (:) or multiplication operator (*).

    • Alternative Reparameterization Approach (Line 48):
  • If linearHypothesis() is not utilized, testing linear combinations manually requires defining a transformed parameter θ\theta (e.g., θ=β2+12β3\theta = \beta_2 + 12\beta_3).

  • Substitute β2=θ−12β3\beta_2 = \theta - 12\beta_3 back into the structural model equation and re-estimate the modified regression model to evaluate the standard error and t-statistict\text{-statistic} of θ\theta directly (as shown in script line 48).

Course Evaluation Guidelines and R Software Workflows

  • Examination Policies and Guidelines:

    • Examinations are administered in an open-notes format.
    • Students are advised to practice completing problem sets without relying heavily on notes to build procedural mastery.
    • Exam questions and exercises are directly derived from practice homework problems.
  • Software Requirements:

    • Course assignments, including specific homework questions (e.g., Question 7), require executing statistical commands, extracting significance metrics, and conducting linear combination tests using R code rather than legacy software such as EViews.