Learn R Programming

drape

Doubly Robust Average Partial Effect estimation.

Details of the method can be found in Klyne and Shah (2023).

Installation

You can install the development version of drape from GitHub with:

# install.packages("devtools")
devtools::install_github("harveyklyne/drape")

Copy Link

Version

Install

install.packages('drape')

Monthly Downloads

181

Version

0.0.2

License

MIT + file LICENSE

Maintainer

Harvey Klyne

Last Published

November 28th, 2024

Functions in drape (0.0.2)

rmixture

Symmetric mixture two Gaussian random variables.
fit_lasso_poly

Fit a lasso regression using quadratic polynomial basis, with interactions.
partially_linear

Fit a doubly-robust partially linear regression using the DoubleML package and pre-tuned XGBoost regressions, for use in simulations.
fit_xgboost

Fit pre-tuned XGBoost regression for use in simulations.
sort_bin

Sort and bin x within a specified tolerance, using hist().
simulate_data

Generate simulation data.
rothenhausler_yu

Estimate the average partial effect of using the debiased lasso method of Rothenhausler and Yu, using pre-tuned lasso penalties, for use in simulations.
cv_resmooth

K-fold cross-validation for resmoothing bandwidth.
z_correlated_normal

Generate n copies of \(Z ~ N_{p}(0,\Sigma)\), where \(\Sigma_{jj} = 1\), \(\Sigma_{jk} = \text{corr}\) for all j not equal to k.
spline_score

Univariate score estimation via the smoothing spline method of Cox 1985 and Ng 1994.
basis_poly

Estimate the score function of the d'th covariate using a polynomial basis.
drape

Estimate the doubly-robust average partial effect estimate of X on Y, in the presence of Z.
compare_evaluate

Evaluate estimators by training nuisance functions on training set and evaluating them on test set.
compare

Generate simulation data and evaluate estimators, with sample splitting.
compare_rothenhausler

Generate simulation data and evaluate Rothenhausler estimator.
cv_spline_score

K-fold cross-validation for spline_score.
compare_lm

Generate simulation data and evaluate OLS estimator.
MC_sums

Compute sums of a Monte Carlo vector for use in resmoothing.
compare_partially_linear

Generate simulation data and evaluate partially linear estimator.
resmooth

Resmooth the predictions of a fitted model
new_X

Generate a matrix of covariates for use in resmoothing, in which the d'th column of X is translated successively by the Kronecker product of bw and MC_variates.
rothenhausler_basis

Generate the modified quadratic basis of Rothenhausler and Yu.
ng_pseudo_response

Generate pseudo responses as in Ng 1994 to enable univariate score estimation by standard smoothing spline regression.
mixture_score

Population score function for the symmetric mixture two Gaussian random variables.