summary.univar_category | R Documentation |
print and summary method for "univar_category" class.
## S3 method for class 'univar_category'
summary(object, na.rm = TRUE, ...)
## S3 method for class 'univar_category'
print(x, ...)
object |
an object of class "univar_category", usually, a result of a call to univar_category(). |
na.rm |
logical. Specifies whether to include NA when performing a chi-square test. The default is TRUE, where NA is removed and aggregated. |
... |
further arguments passed to or from other methods. |
x |
an object of class "univar_category", usually, a result of a call to univar_category(). |
print.univar_category() displays only the information of variables included in univar_category. The "variables" attribute is not displayed.
An object of the class as individual variables based list. The information to examine the relationship between categorical variables is as follows each components.
variable : factor. The level of the variable. 'variable' is the name of the variable.
statistic : numeric. the value the chi-squared test statistic.
p.value : numeric. the p-value for the test.
df : integer. the degrees of freedom of the chi-squared test.
plot.univar_category
.
library(dplyr)
# Calculates the all categorical variables
all_var <- univar_category(heartfailure)
# Print univar_category class object
all_var
# Calculates the only smoking variable
all_var %>%
"["(names(all_var) %in% "smoking")
smoking <- univar_category(heartfailure, smoking)
# Print univar_category class object
smoking
# Filtering the case of smoking included NA
smoking %>%
"[["(1) %>%
filter(!is.na(smoking))
# Summary the all case : Return a invisible copy of an object.
stat <- summary(all_var)
# Summary by returned object
stat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.