Description Usage Arguments Value Author(s) References Examples

`rdrandinf`

implements randomization inference and related methods for RD designs,
using observations in a specified or data-driven selected window around the cutoff where
local randomization is assumed to hold.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ```
rdrandinf(
Y,
R,
cutoff = 0,
wl = NULL,
wr = NULL,
statistic = "diffmeans",
p = 0,
evall = NULL,
evalr = NULL,
kernel = "uniform",
fuzzy = NULL,
nulltau = 0,
d = NULL,
dscale = NULL,
ci,
interfci = NULL,
bernoulli = NULL,
reps = 1000,
seed = 666,
quietly = FALSE,
covariates,
obsmin = NULL,
wmin = NULL,
wobs = NULL,
wstep = NULL,
wasymmetric = FALSE,
wmasspoints = FALSE,
nwindows = 10,
dropmissing = FALSE,
rdwstat = "diffmeans",
approx = FALSE,
rdwreps = 1000,
level = 0.15,
plot = FALSE,
obsstep = NULL
)
``` |

`Y` |
a vector containing the values of the outcome variable. |

`R` |
a vector containing the values of the running variable. |

`cutoff` |
the RD cutoff (default is 0). |

`wl` |
the left limit of the window. The default takes the minimum of the running variable. |

`wr` |
the right limit of the window. The default takes the maximum of the running variable. |

`statistic` |
the statistic to be used in the balance tests. Allowed options are |

`p` |
the order of the polynomial for outcome transformation model (default is 0). |

`evall` |
the point at the left of the cutoff at which to evaluate the transformed outcome is evaluated. Default is the cutoff value. |

`evalr` |
specifies the point at the right of the cutoff at which the transformed outcome is evaluated. Default is the cutoff value. |

`kernel` |
specifies the type of kernel to use as weighting scheme. Allowed kernel types are |

`fuzzy` |
indicates that the RD design is fuzzy. |

`nulltau` |
the value of the treatment effect under the null hypothesis (default is 0). |

`d` |
the effect size for asymptotic power calculation. Default is 0.5 * standard deviation of outcome variable for the control group. |

`dscale` |
the fraction of the standard deviation of the outcome variable for the control group used as alternative hypothesis for asymptotic power calculation. Default is 0.5. |

`ci` |
calculates a confidence interval for the treatment effect by test inversion. |

`interfci` |
the level for Rosenbaum's confidence interval under arbitrary interference between units. |

`bernoulli` |
the probabilities of treatment for each unit when assignment mechanism is a Bernoulli trial. This option should be specified as a vector of length equal to the length of the outcome and running variables. |

`reps` |
the number of replications (default is 1000). |

`seed` |
the seed to be used for the randomization test. |

`quietly` |
suppresses the output table. |

`covariates` |
the covariates used by |

`obsmin` |
the minimum number of observations above and below the cutoff in the smallest window employed by the companion command |

`wmin` |
the smallest window to be used (if |

`wobs` |
the number of observations to be added at each side of the cutoff at each step. |

`wstep` |
the increment in window length (if |

`wasymmetric` |
allows for asymmetric windows around the cutoff when ( |

`wmasspoints` |
specifies that the running variable is discrete and each masspoint should be used as a window. |

`nwindows` |
the number of windows to be used by the companion command |

`dropmissing` |
drop rows with missing values in covariates when calculating windows. |

`rdwstat` |
the statistic to be used by the companion command |

`approx` |
forces the companion command |

`rdwreps` |
the number of replications to be used by the companion command |

`level` |
the minimum accepted value of the p-value from the covariate balance tests to be used by the companion command |

`plot` |
draws a scatter plot of the minimum p-value from the covariate balance test against window length implemented by the companion command |

`obsstep` |
the minimum number of observations to be added on each side of the cutoff for the sequence of fixed-increment nested windows. Default is 2. This option is deprecated and only included for backward compatibility. |

`sumstats` |
summary statistics |

`obs.stat` |
observed statistic(s) |

`p.value` |
randomization p-value(s) |

`asy.pvalue` |
asymptotic p-value(s) |

`window` |
chosen window |

`ci` |
confidence interval (only if |

`interf.ci` |
confidence interval under interferecen (only if |

Matias Cattaneo, Princeton University. cattaneo@princeton.edu

Rocio Titiunik, Princeton University. titiunik@princeton.edu

Gonzalo Vazquez-Bare, UC Santa Barbara. gvazquez@econ.ucsb.edu

Cattaneo, M.D., R. Titiunik and G. Vazquez-Bare. (2016). Inference in Regression Discontinuity Designs under Local Randomization. *Stata Journal* 16(2): 331-367.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
# Toy dataset
X <- array(rnorm(200),dim=c(100,2))
R <- X[1,] + X[2,] + rnorm(100)
Y <- 1 + R -.5*R^2 + .3*R^3 + (R>=0) + rnorm(100)
# Randomization inference in window (-.75,.75)
tmp <- rdrandinf(Y,R,wl=-.75,wr=.75)
# Randomization inference in window (-.75,.75), all statistics
tmp <- rdrandinf(Y,R,wl=-.75,wr=.75,statistic='all')
# Randomization inference with window selection
# Note: low number of replications to speed up process.
# The user should increase the number of replications.
tmp <- rdrandinf(Y,R,statistic='all',covariates=X,wmin=.5,wstep=.125,rdwreps=500)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.