Description Usage Arguments Examples
Output Table of Regression Discontinuity Design
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 38 39 40 41 42 43 44 45 46 47 48 | rdtab(object, ...)
## S3 method for class 'list_local_random'
rdtab(
object,
ylab,
col_lab = list(y = "Outcomes", mean = "Mean", se = "S.E.", n = "N", mean.diff =
"Mean difference", p = "P-value", treat = "Treated", control = "Control"),
title = NULL,
footnote = NULL,
output = getOption("discRD.table_output"),
size = getOption("discRD.table_fontsize"),
digits = 3,
...
)
## S3 method for class 'list_global_lm'
rdtab(
object,
ylab,
dlab = "treated",
olab = "Order of polynomial",
covariate_labs,
stars = c(`***` = 0.01, `**` = 0.05, `*` = 0.1),
gof_omit = "se",
title = NULL,
footnote = NULL,
output = getOption("discRD.table_output"),
size = getOption("discRD.table_fontsize"),
digits = 3,
...
)
## S3 method for class 'list_local_lm'
rdtab(
object,
ylab,
dlab = "treated",
olab = "Order of polynomial",
stars = c(`***` = 0.01, `**` = 0.05, `*` = 0.1),
gof_omit = "se",
title = NULL,
footnote = NULL,
output = getOption("discRD.table_output"),
size = getOption("discRD.table_fontsize"),
digits = 3,
...
)
|
object |
output object |
... |
Other arguments to pass to |
ylab |
named string vector with label of outcome variables specified by c("original label" = "new label", ...). |
col_lab |
named list of column labels (only "list_local_random" class)
|
title |
string of table title |
footnote |
string of footnote |
output |
string of output format (default is getOption("discRD.table_output")) |
size |
numeric of font size (default is getOption("discRD.table_fontsize")) |
digits |
numeric of number of decimal places to display (Default is 3). |
dlab |
a string of label of treatment variable |
olab |
a string of label of "Order of polynomial" |
covariate_labs |
list.
You can specify how to display information about
whether you are controlling a variable that is not displayed by a factor.
For example,
|
stars |
a named numeric vector to indicate statistical significance.
|
gof_omit |
string regular expression. Omits all matching gof statistics from the table. |
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 38 39 40 41 42 43 44 45 46 47 48 | running <- sample(1:100, size = 1000, replace = TRUE)
cov1 <- rnorm(1000, sd = 2); cov2 <- rnorm(1000, mean = -1)
y0 <- running + cov1 + cov2 + rnorm(1000)
y1 <- 2 + 1.5 * running + cov1 + cov2 + rnorm(1000)
y <- ifelse(running <= 50, y1, y0)
bin <- ifelse(y > mean(y), 1, 0)
raw <- data.frame(y, bin, running, cov1, cov2)
set_optDiscRD(
y + bin ~ running,
discRD.cutoff = 50,
discRD.assign = "smaller"
)
library(modelsummary)
library(magrittr)
ylab <- c("y" = "Simulated Outcome", "bin" = "Binary")
footnote <- paste0(
"Observations with running variables of -45 to 55 were used.",
"The treatment variable is determined to take 1",
"if the running variable is 50 or less."
)
loc <- local_random_test(data = raw, bw = c(-5, 5))
rdtab(loc, ylab, digits = 2, footnote = footnote)
set_optDiscRD(xmod = ~ cov1 + cov2)
est <- global_lm(data = raw)
rdtab(
est,
title = "Estimate Local ATE by Global Polynomial Fitting",
ylab = c("y" = "Simulated Outcome", "bin" = "Simulated Outcome > 0"),
dlab = "Treatment",
covariate_labs = list("Covariates" = c("cov1", "cov2")),
footnote = "***: p < 0.01, **: p < 0.05, *: p < 0.1"
)
locest <- local_lm(data = raw, kernel = "uniform", bw = 3)
rdtab(
locest,
title = "Estimate Local ATE by Local Polynomial Fitting",
ylab = c("y" = "Simulated Outcome", "bin" = "Simulated Outcome > 0"),
dlab = "Treatment",
footnote = "***: p < 0.01, **: p < 0.05, *: p < 0.1"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.