This release substantially speeds up the 2x2 estimators and tightens the handling of ill-conditioned designs. Point estimates, standard errors, and influence functions are unchanged up to floating-point precision (~1e-14).
The propensity-score and outcome regressions now use fastglm's low-level
entry point (fastglmPure) in place of the fastglm() wrapper, skipping the
per-call input-coercion and family/deviance bookkeeping that was paid on every
fit. This is applied throughout: the point estimators, every weighted-bootstrap
helper (which refits on each of nboot iterations), and the IPT/calibration
propensity initializer.
The influence-function computations use crossprod() and BLAS dot products in
place of colMeans(. * int.cov) and t(int.cov) %*% (W * int.cov).
Together these make the 2x2 estimators roughly 1.5x faster, with the weighted bootstrap benefiting proportionally.
The propensity-score Hessian is now checked for singularity with rcond()
before inversion, matching the long-standing check on the outcome-regression
design. A near-singular propensity-score design previously yielded a silently
incorrect standard error; it now stops with an informative message.
std_ipw_did_rc now warns when the propensity-score estimation does not
converge and stops when the estimated coefficients are NA, matching the other
propensity-score estimators (these guards were previously missing, so a
rank-deficient design returned a corrupted standard error silently).
The repeated cross-section pre-processing now warns when collinear covariates are dropped, matching the panel pre-processing (previously the repeated cross-section path dropped them without notice).
Improve code to avoid redundant data checks
Restore solve as default to invert matrix, as it is faster than qr.solve for small matrices.
Improve error handling for non-invertible matrices.
Changing estimation methods for fastglm and parglm (in place of lm and glm).
Do not let the estimated propensity score be above 1 - 1e-6 (instead of 1 - e-16).
Speed up data processing using Rcpp
Use qr.solve as default (instead of solve)
Drop collinear variables in pre_process_drdid.R (useful in drdid command but not other commands)
Add compatibility with R 3.5
Improve invertibility of outcome regression design matrix
Add new flags for non-unique unit identifier
Allows for treating covariates as factor and alike when computing DiD
First official version of package, functions for computing a variety of difference-in-differences (DiD) estimators for the ATT.
Documentation is improved compared to the devel version, including examples for every function now.
Created wrapper function drdid, ordid and ipwdid to implement doubly-robust, outcome regression and inverse probability weighted DID estimators.
Add dataset used in the empirical application of Sant'Anna and Zhao (2020).