Description Usage Arguments Examples
Data Shape
1 2 3 4 5 6 7 8 9 10 11 12 13 |
basemod |
baseline formula. |
covmod |
one-sided formula with covariates on rhs. |
data |
data.frame |
subset |
subset condition. |
weights |
weight variable. |
cluster |
cluster variable. |
order |
order of polynomial. |
cutoff |
numeric of cutoff point.
If missing, search |
assign |
assignment rule of treatment.
If "greater",
treated whose running variable is greater than or equal to cutoff.
If "smaller",
treated whose running variable is less than or equal to cutoff.
If missing, search |
bw |
numeric vector of bandwidth. If specified, use data whose running variables are within this range will be used. If missing, use data from treatment and control groups where the running variable is closest to the cutoff |
global |
logical (default is FALSE). Whether to use all observations. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
running <- sample(1:100, size = 1000, replace = TRUE)
cov1 <- rnorm(1000, sd = 2); cov2 <- rnorm(1000, mean = -1)
y0 <- running + cov1 + cov2 + rnorm(1000, sd = 10)
y1 <- 2 + 1.5 * running + cov1 + cov2 + rnorm(1000, sd = 10)
y <- ifelse(running <= 50, y1, y0)
bin <- ifelse(y > mean(y), 1, 0)
w <- sample(c(1, 0.5), size = 1000, replace = TRUE)
raw <- data.frame(y, bin, running, cov1, cov2, w)
set_optDiscRD(discRD.cutoff = 50, discRD.assign = "smaller")
a <- clean_rd_data(y ~ running + cov1, data = raw, weights = w, order = 2)
str(a)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.