pscore_compare <- function(e) {
d <- get("myData", globalenv())
}
ct_ratio <- function(e) {
d <- get("myData", globalenv())
treat_var <- get(e$treat, d)
trt <- sum(treat_var == 1)
con <- sum(treat_var == 0)
rat <- con/trt
if(rat > 3) {
out <- "This seems high, so I recommend using matching or a type of subclassification."
} else {
out <- "This seems low, so I recommend using subclassification."
}
pretty_out(paste0("Your C:T ratio is ", round(rat, 1), ":", 1, "."), out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.