Skip to contents

All functions

DMLReg()
Simple Double-ML implementation with cross-fitting
KS2007_dgp()
Kang Schaefer (2007) DGP for 'mild' confounding
OLSw()
Compute OLS with arbitrary vector of weights (possibly negative)
ate_diffmeans()
Simple Difference in Means estimator for binary treatment (for HW etc)
balance_table()
Balance Check for observational studies
bboot()
Bayesian bootstrap for linear regression
binscatter()
R implementation of binned scatterplot and CEF plotter, with added options for cluster variance
calibPlot()
plot calibration
chr()
coerce to string
classifEval()
Classification Evaluation
clip()
clip vector to specified range (clone of np.clip)
convert_all_to_csv()
Writes all dataframes to csv
createFolds()
create folds for cross-fitting
csv_to_sqlite()
Fork of inborutils::csv_to_sqlite to save a delimited text table into a single table sqlite database that can then be munged w dplyr/ dbplyr / sqldf
dataPkg()
list datasets in package
dta_vlabs()
Small summary table with stata variable labels from DTA file
expit()
inverse logit fn
fitGet()
return cross-fit predictions from glmnet object
fmla_kth()
construct formula with outcome and polynomial terms
formula_fixest()
Stitches together formula for use in fixest::feols
formula_lfe()
Stitches together formula for use in felm
formula_stitcher()
Stitches together formula for use in lm/glm
freq_table()
Summary table with percentages for categorical variables
fromLimportF()
Loads specific function or list of functions f from library l
fuzzy_match()
fuzzy matches 2 character vectors, and returns most similar pairs
getNthElement()
Get n'th element in list of lists
get_and_unzip()
downloads and unzips file if it is not found in current wdir
`%!in%`
not.in function
interSparseM()
prepare sparse X matrix with interactions
label_extractor()
extracts variable labels and returns a dataframe with varname-varlabel for DTA files
lal_map_theme()
Theme for maps
lal_plot_theme()
theme for nice looking plots with sensible defaults (no legend title, legend at the bottom)
lal_plot_theme_d()
Wrapper for hrbrthemes::theme_ft_rc() with bigger font, altered legend options and dots
lalonde.exp
Experimental data from the job training program first studied by LaLonde (1986)
lalonde.psid
Non-experimental data from Lalonde (1986)
libreq()
Loads a list of libraries, installs when necessary - Take 2
listOmitIf()
Omit element if it contains "contains"
load_or_install()
Loads a list of libraries, installs when necessary
lv()
last value
mMscale()
min-max scale (maps continuous variable to [0, 1])
matr()
matrix constructor
mcReplicate()
Multi-core replicate. Use multiple cores for repeated evaluation of an expression.
mls()
list methods for object
multiplot()
Stitches together multiple ggplot objects for export-ready graphs
naOmitList()
Omit NA entries in list
newtonRoot()
solve for roots using the NR update rule x1 = x0 − f(x0)/f'(x0)
norm_diff()
Normalised Difference (Imbens, Rubin 2015) for observational studies
nunique()
number of unique values in vector
overlap_histogram()
Histogram of pscore distributions in treatment and control groups
panelMatrices()
Convert a long panel to wide matrix (cleaner data.table version)
panel_treat_plot()
plot binary treatment status for time series for panel dataset
polySieveM()
prepare X matrix with flexible interactions and polynomials
portal_hexcodes()
Hex codes for portal game colours (blue and orange)
prplot()
Partial Residual Plot
rdr_export()
Summary table for Rdrobust estimates to export using kableExtra
read_all_files()
Reads in all datasets in given location
reg_adjust()
Regression Adjustment estimation of ATE or ATT
regplot_dens()
Scatterplot with regression line and densites by grouping variable. Use this to evaluate overlap.
residualise()
Partial out controls and fixed effects and return residualised outcome and treatment
robustify()
Replaces the standard errors (t and p vals)in FELM model object with robust SE
sourceDir()
Source all R scripts in directory
stat_transfer_data()
Populates a stat-transfer script to convert files to CSV
subclassify()
Compute subclassification ATT and ATE
summar()
Summary table
summary(<bboot>)
summary method for bayesian bootstrap
timeStamp()
Timestamp with no spaces for filenames
tsplotter()
Canned subroutine to plot time series for several variables
ttsplit()
test-train split
vnorm()
t-norm of a vector
withFrame()
ggplot with frame