SumStats_df | R Documentation |
Tabulates descriptive statistics for all indicated variables in a data frame. Continuous covariates are summarized as "Mean (SD, range)". Binary covariates are summarized as the percentage of 1s.
SumStats_df(data, vars = names(data), binary = c())
data |
Data frame containing covariates of interest for compiling descriptive statistics. |
vars |
Character vector listing names of covariates in 'data' for which descriptive statistics are desired. Default is all columns in 'data'. |
binary |
Integer vector indexing elements in 'vars' that are binary covariates. Default is an empty vector. |
Matrix with nrow = length(vars) and 2 columns. The first column labeled "Mean (SD, range)" contains summary statistics. The second column contains the sample size for calculating summary statistics (number of non-missing values). Summary statistics for variables indicated in 'binary' will be a percent of 1s.
Quresh S. Latif
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.