This function calculated basic descriptive statistics for a categorical/ nominal variable. Inputs can be summary data, vectors, or a data frame.
overview_nominal(
data = NULL,
outcome_variable = NULL,
grouping_variable = NULL,
cases = NULL,
outcome_variable_levels = NULL,
outcome_variable_name = "My Outcome Variable",
grouping_variable_name = "My Grouping Variable",
conf_level = 0.95,
count_NA = FALSE
)
Returns a table of descriptive statistics
overview_nominal
outcome_variable_name -
outcome_variable_level -
cases -
n -
P -
P_LL -
P_UL -
P_SE -
P_adjusted -
ta_LL -
ta_UL -
for raw data, a data frame or tibble
for raw data, either a vector containing factor data or the name of a data-frame column containing a factor
for raw data, either NULL (default), or the vector of a factor or a data-frame column containing a factor
For summary data - A vector of 1 or more counts, integers>0
For summary data - An optional vector of group labels, same length as cases. If not passed, auto-generated.
Optional friendly name for the outcome variable. Defaults to 'My Outcome Variable'. Ignored if a data-frame is passed, this argument is ignored.
Optional friendly name for the grouping variable. Defaults to 'My Grouping Variable'. Ignored for summary data and for data frames -- only used if vectors of data are passed.
The confidence level for the confidence interval. Given in decimal form. Defaults to 0.95.
Logical to count NAs (TRUE) in total N or not (FALSE)
# example code
esci::overview_nominal(esci::data_latimier_3groups, "Group")
Run the code above in your browser using DataLab