模型及其估计与R
1. Estimation method
standard error estimation
sanwich, 可以通过AER::coeftest(), modelsummary::modelsummary()来调用vcov,也可以在一些模型中直接调用,比如fixest::feols().
Simulation-Based Inference
clarify, Simulation-Based Inference for Regression Models
bootstrap
In R, you can use the cluster
option in the vcovBS()
function in the sandwich package if what you want is bootstrap standard errors on a regression model (pass the vcovBS()
result to the vcov
argument in your modelsummary
table).
Wild bootstrap standard errors can be implemented in R using the type
argument of vcovBS()
in the sandwich package, or there are some faster options in the fwildclusterboot package.
boot: Bootstrap Functions (Originally by Angelo Canty for S)
momentfit: Methods of Moments
momentfit:Several classes for moment-based models are defined. The classes are defined for moment conditions derived from a single equation or a system of equations.
2. Models
- Weighting
WeightIt, 通过加权的方法调整变量之间的差异。
- Matching
MatchIt, 种匹配方法的集合。
causalweight: Estimation Methods for Causal Inference Based on Inverse Probability Weighting
- Fixed effect
fixest, Fast and user-friendly fixed-effects estimation
- event study
estudy2, An implementation of a most commonly used event study methodology, including both parametric and nonparametric tests.
- difference in difference
did, The did package contains tools for computing average treatment effect parameters in a Difference-in-Differences setup allowing for More than two time periods; Variation in treatment timing (i.e., units can become treated at different points in time); Treatment effect heterogeneity (i.e, the effect of participating in the treatment can vary across units and exhibit potentially complex dynamics, selection into treatment, or time effects); The parallel trends assumption holds only after conditioning on covariates.
The DRDID R package implements different estimators for the Average Treatment Effect on the Treated (ATT) in Difference-in-Differences (DID) setups where the parallel trends assumption holds after conditioning on a vector of pre-treatment covariates.
the
sunab
function in the fixest packageetwfe, an package implementing extended TWFE proposed by Wooldridge.
synthetic control
Synth: Synthetic Control Group Method for Comparative Case Studies
scpi, implementations of estimation and inference procedures for synthetic control methods.
- instrumental variable
AER::ivreg() function in the AER package
ivmodel: Statistical Inference and Sensitivity Analysis for Instrumental Variables Model
ivtools: Instrumental Variables:Contains tools for instrumental variables estimation.
- Regression discontinuity Designs
RD series package: Software packages for analysis and interpretation of regression discontinuity designs and related methods. Replication files and illustration codes employing these packages are also available.
RDHonest,This R package implements honest and efficient confidence intervals in fuzzy and sharp regression discontinuity designs using procedures from Armstrong and Kolesár (2020) (preprint), Armstrong and Kolesár (2018) (preprint), and Kolesár and Rothe (2018) (preprint).
3. Interpretation
marginaleffects, Compute and plot predictions, slopes, marginal means, and comparisons (contrasts, risk ratios, odds ratios, etc.) for over 70 classes of statistical models in R. Conduct linear and non-linear hypothesis tests, as well as equivalence tests using the delta method.
effectsize, The goal of this package is to provide utilities to work with indices of effect size and standardized parameters, allowing computation and conversion of indices such as Cohen’s d, r, odds-ratios, etc
ggeffects, ggeffects: Tidy Data Frames of Marginal Effects from Regression Models.
modelbased, a package helping with model-based estimations, to easily compute of marginal means, contrast analysis and model predictions.