Install the development version from GitHub with:
devtools::install_github("MethodsConsultants/tibbletest")
propensity_weighting
library(tibbletest) example_dat %>% add_propensity_weights( treatment = "treat", ivs = c("age", "sugar_factor", "gender") ) example_dat %>% tidyr::drop_na(treat, age) %>% add_propensity_weights( treatment = "treat", ivs = c("age", "sugar_factor", "gender") ) %>% dplyr::glimpse()
descriptives
example_dat %>% descriptives( treatment = "treat", variables = c("age", "sugar_factor", "gender", "happiness", "happy") ) example_dat %>% dplyr::select(treat, age, gender) %>% descriptives( treatment = "treat" ) example_dat %>% dplyr::select(treat, weight, age, gender) %>% descriptives( treatment = "treat", weights = "weight" ) example_dat %>% descriptives( treatment = "treat", variables = c("age", "sugar_factor", "gender", "happiness", "happy"), nonparametric = c("age") )
format_tbl
univariate <- example_dat %>% descriptives( variables = c("age", "sugar_factor", "gender", "happiness", "happy") ) univariate univariate %>% format_tbl() bivariate <- example_dat %>% descriptives( treatment = "treat", variables = c("age", "sugar_factor", "gender", "happiness", "happy") ) bivariate bivariate %>% format_tbl()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.