knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This package includes the data objects with descriptive statistics: descriptive_stats_cat (for categorical variables) and descriptive_stats_num (for numerical variables. These objects are data frames that can be used for further analyzes such as mean differences and chi-square tables.

For readers that only want to see the descriptive statistics we print out the tables below.

We can use the information in variable_table to replace the variable names with longer variable labels

library(recidivismsl)

# Create a replacement vector
variable_labels <- variable_table$Label
names(variable_labels) <- variable_table$Variable

Categorical variables

Frequencies and percentages by reoffence group.Key: NoRe = No reoffence, NViolRe = Non-violent reoffence, VioRe = Violent Reoffence, n = frequencies, % = percentages.

printed_cat  <- descriptive_stats_cat
names(printed_cat) <- c("Variable", "Level", 
                         "NoRe n", "NViolRe n", "VioRe n",
                         "NoRe %", "NViolRe %", "VioRe %")



printed_cat$Variable <- variable_labels[printed_cat$Variable]


knitr::kable(printed_cat, digits = 1)


bennysalo/predict-recidivism documentation built on May 29, 2019, 10:34 a.m.