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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.