Travis build status Codecov test coverage

Installation

Install the development version from GitHub with:

devtools::install_github("MethodsConsultants/tibbletest")

Usage

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()


MethodsConsultants/tibbletest documentation built on June 28, 2021, 5:22 p.m.