Skip to contents

The sumvar package explores continuous and categorical variables. sumvar brings the ease and simplicity of the "sum" and "tab" functions from Stata to R.

  • To explore a continuous variable, use dist_sum(). You can stratify by a grouping variable: df %>% dist_sum(var, group)

  • To explore dates, use dist_date(); usage is the same as dist_sum().

  • To summarise a single categorical variable use tab1(), e.g. df %>% tab1(var). For a two-way table, use tab(), e.g. df %>% tab(var1, var2). Both include options for frequentist hypothesis tests.

  • Explore duplicates and missing values with with dup().

All functions are tidyverse/dplyr-friendly and accept the %>% pipe, outputting results as a tibble. You can save outputs for further manipulation, e.g. summary <- df %>% dist_sum(var).

Author

Maintainer: Alexander Stockdale a.stockdale@liverpool.ac.uk