Materials to better understand Econometrics.jl absorb feature

This is only a little bit of a Julia question and mostly a question about where to find materials for learning econometrics, but: I’m wondering if anyone can suggest good materials for learning about modelling techniques that are commonly used with panel data. I’m currently working with some panel data with @Nosferican 's fantastic Econometrics.jl package and I’m struggling to understand how to interpret the model outputs when I do it different ways.

For example, I’ve tabulated some statistics for 13 different industries across 11 years from the Current Population Survey and I’m now exploring some simple models that produce very different results. For now, I’m just experimenting with different models that might explain differences in median wage rates based on the median age and the percent of the workforce that consists of racial minorities in an industry. Here’s one example:

using Econometrics

using CSV
using DataFrames

cps = DataFrame(CSV.File("data/cps_panel_10_20.csv"))

model = fit(
    EconometricModel,
    @formula(median_wage ~ median_age + prcnt_minority),
    cps
)

Continuous Response Model
Number of observations: 143
Null Loglikelihood: -366.63
Loglikelihood: -325.47
R-squared: 0.4378
LR Test: 82.32 ∼ χ²(2) ⟹  Pr > χ² = 0.0000
Formula: median_wage ~ 1 + median_age + prcnt_minority
Variance Covariance Estimator: OIM
───────────────────────────────────────────────────────────────────────────────
                     PE         SE      t-value  Pr > |t|      2.50%     97.50%
───────────────────────────────────────────────────────────────────────────────
(Intercept)       6.0373    2.52437     2.3916     0.0181    1.04648  11.0281
median_age        0.380779  0.0465285   8.18378    <1e-12    0.28879   0.472769
prcnt_minority  -13.9391    3.37746    -4.12709    <1e-04  -20.6165   -7.26168
───────────────────────────────────────────────────────────────────────────────

Then, if I use the absorb option, just for the industry:

model = fit(
    EconometricModel,
    @formula(median_wage ~ median_age + prcnt_minority + absorb(prmjind1)),
    cps
)

Continuous Response Model
Number of observations: 143
Null Loglikelihood: -366.63
Loglikelihood: -178.47
R-squared: 0.9285
Wald: 85.49 ∼ F(2, 128) ⟹ Pr > F = 0.0000
Formula: median_wage ~ 1 + median_age + prcnt_minority + absorb(prmjind1)
Variance Covariance Estimator: OIM
─────────────────────────────────────────────────────────────────────────────────
                    PE         SE      t-value  Pr > |t|         2.50%     97.50%
─────────────────────────────────────────────────────────────────────────────────
(Intercept)     -7.10788   3.64651    -1.94923    0.0535  -14.3231       0.107359
median_age       0.175965  0.0849071   2.07244    0.0402    0.00796144   0.343968
prcnt_minority  37.7827    2.8899     13.0741     <1e-24   32.0645      43.5008
─────────────────────────────────────────────────────────────────────────────────

The docs say that absorb is for when you “only care about the estimates of a subset of features and controls.” When I absorb the industry variable, does that mean that what I’m measuring is how much of the variability in median wage, within an industry, is explained by age and % minority? In other words, if I’m just interested in explaining within-industry variation (i.e. how median wage varies over time within a given industry), is that when I would use absorb(industry)?

You might find answers in the documentation for reghdfe, where the author got the term absorb from.

1 Like

Hi @mthelm85, delighted that you have found Econometrics.jl useful :slight_smile:

There are different levels of how in depth to answer that question but I will try to answer it to a level which which should help you understand how to use and interpret it. The absorb terms gives the same parameter estimates to the (non-intercept) features as if you had included those as “fixed-effects” (econ talk) which is the same as the dummy variable model where you have an indicator for each value.

So, what’s the difference between including the features as indicators or absorbing those? The first difference is that if you include them as a normal feature you would get a parameter estimate for each (technically you can add some extra code to recover those afterwards). It is an application of the Frisch Waugh-Lovell Theorem. However, in some instances you should not actually believe in those estimates due to the curse of dimensionality. In other words, those can’t be consistently estimated because by increasing your sample size, you would be increasing the number of parameters. For example. you include a household indicator, but in order to get more observations, you would need to include more households and thus more household parameters. Under that case, the estimator would not yield an estimator of the partial effect (i.e., does not converge in probability as the sample size increases). The other case would be when there are many parameters for that dimension making the estimation procedure unfeasible (e.g., would have to operate on a huge matrix). Absorbing those features is a very efficient way of estimating the model without having to create and operate with those huge matrices.

The explanation thus far has been about the point estimates. Those ideas about how the covariates are included depending on how the sample increase also affect issues such as the second moment (e.g., variance-covariance matrix / standard errors / confidence intervals). However, that analysis depends on the sampling design assume and is not something confined to the estimation per se. As @pdeffebach mentioned, Sergio’s work goes into many of those considerations including how to properly account for singletons for the degree of freedom corrections for inference and other issues. Additional considerations come into selecting cluster-robust covariance estimators of different kinds (see A Practitioner’s Guide to Cluster-Robust Inference)… Still there have been some other work by Athey, Imbens, Jeff, and others with a series of papers on other considerations.

Mathieu’s GitHub - FixedEffects/FixedEffectModels.jl: Fast Estimation of Linear Models with IV and High Dimensional Categorical Variables is another package that implements efficient estimation of high-dimensional categorical variables (e.g., the backend for that one uses a different approach than the more basic method of alternating projections but similar functionality in case of the panel data within estimator). The within-estimator is also a common name for that class and is also explained in detailed in 10.18637/jss.v027.i02 (I found the descriptions in the plm article very informative when I was first developing the package).

Hope that helps!

5 Likes

Thank you very much :pray:

I have another question that I posted in a separate thread regarding your package vs. R’s plm, if you’re interested :slightly_smiling_face: