So just to complain about open source R a bit. Somebody decided the "marginaleffects" package should not work with PPML models because of FE uncertainty that definitely apply in some model prediction (but NOT my application). So they just broke the whole thing instead. Why can't users just make their own mistakes? github.com/vincentarelbundoc…
"car" package will still do what I want anyway, but not I have rewrite my teaching code, my slides, and my solutions for students.
The problem of fixed effects being concentrated out of PPML and conditional logit models is well know. STATA will give you a warning on this and anyone that can be bothered to pick up a textbook can know this. Weird unilateral decisions by package managers probably breaking tons of code for past 7 months.
Para ver si el término interactivo "vale la pena", puedes comparar modelos (lm(full) vs lm(sin_interacción)) con ANOVA.
Y puedes visualizar los coeficientes marginales (interacciones) con ggeffects, interactions, o marginaleffects en R.
cran.r-project.org/web/packa…
I just updated my post on equivalence testing with {marginaleffects} so that it's consistent with the latest version. (Some of the notes and code were outdated.)
carlislerainey.com/blog/2023…
Thx, Vincent. Agreed! I didn’t know about this fn in marginaleffects -- super useful!
Our point on the critique’s *implementation* of GAM stands. Moreover, accommodating additional Z and regularization bias remain challenging.
Doubly-robust estimators generally perform better.
Interesting paper! Thanks for posting. IIUC, your main concern with the GAM approach is that it targets the wrong estimand. If so, I feel that your criticism of the approach is kind of unfair, given that it's easy to target CME w/ GAM. See this notebook: arelbundock.com/hmx_simonsoh…
Confounding in observational data? Meet the parametric g-computation.
Steps:
1. Fit a regression for outcomes
2. Create counterfactual datasets (treated vs. untreated, Fig1)
3. Predict outcomes, compare means = treatment effect (Fig2)
Implementation in R using {marginaleffects}
Results and findings:
openread.academy/en/paper/re…
The "marginaleffects" package can compute a wide range of quantities of interest, including predictions, comparisons (contrasts, risk ratios, etc.), and slopes, and conduct hypothesis tests for over 100 different classes of models. The package has a simple, unified, and well-documented interface, and it is easy to extend and produces "tidy" results.
How to Interpret Statistical Models Using marginaleffects for R and Python. Vincent Arel-Bundock, Noah Greifer, Andrew Heiss. Journal of Statistical Software. jstatsoft.org/article/view/v…
"[marginaleffects] supports over 100 classes of models, including linear, generalized linear, generalized additive, mixed effects, Bayesian, and . . ."
Arel-Bundock et al. (2024). How to Interpret Statistical Models Using marginaleffects for R and Python
doi.org/10.18637/jss.v111.i0…