context("Print")
test_that("HTML tables", {
data("darfur")
# runs regression model
model <- fixest::feols(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar +
pastvoted + hhsize_darfur + female + village, data = darfur)
expect_error(ovb_minimal_reporting(model))
darfur_out <- sensemakr(model, treatment = "directlyharmed",
benchmark_covariates = "female", kd = 1:3)
out <- ovb_minimal_reporting(darfur_out, format = "html", verbose = F)
check <- "
\n\n\n\t | \n\t Outcome: peacefactor | \n
\n\n\t Treatment | \n\t Est. | \n\t S.E. | \n\t t-value | \n\t $R^2_{Y \\sim D |{\\bf X}}$ | \n\t $RV_{q = 1}$ | \n\t $RV_{q = 1, \\alpha = 0.05}$ | \n
\n\n\n \n\tdirectlyharmed | \n\t0.097 | \n\t0.023 | \n\t4.184 | \n\t2.2\\% | \n\t13.9\\% | \n\t7.6\\% | \n
\n\n\nNote: df = 783; Bound ( 1x female ): $R^2_{Y\\sim Z| {\\bf X}, D}$ = 12.5\\%, $R^2_{D\\sim Z| {\\bf X} }$ = 0.9\\% | \n
\n
"
expect_equal(out, check)
out <- ovb_minimal_reporting(darfur_out, format = "pure_html", verbose = F)
check <- "\n\n\n\t | \n\t Outcome: peacefactor | \n
\n\n\t Treatment | \n\t Est. | \n\t S.E. | \n\t t-value | \n\t R2Y~D|X | \n\t RVq = 1 | \n\t RVq = 1, α = 0.05 | \n
\n\n\n \n\tdirectlyharmed | \n\t0.097 | \n\t0.023 | \n\t4.184 | \n\t2.2\\% | \n\t13.9\\% | \n\t7.6\\% | \n
\n\n\nNote: df = 783; Bound ( 1x female ): R2Y~Z|X,D = 12.5\\%, R2D~Z|X = 0.9\\% | \n
\n
"
expect_equal(out, check)
}
)