frequencies: Calculate Frequency Tables with Statistics

View source: R/frequencies.r

frequenciesR Documentation

Calculate Frequency Tables with Statistics

Description

Generates frequency tables for all columns in a dataset, including valid percentages, cumulative percentages, and missing value statistics.

Usage

frequencies(data)

Arguments

data

A data frame or data structure containing the variables to analyze

Details

For each column in the input data, the function calculates and displays: * Frequency counts * Percentages of total observations * Valid percentages (excluding missing values) * Cumulative percentages * Summary of valid and missing observations

The output for each variable includes: * A frequency table with the above statistics * Count and percentage of valid observations * Count and percentage of missing observations * Total number of observations

Value

Prints formatted frequency tables for each column in the dataset. Each table includes:

Var1

The unique values in the column

Freq

Frequency counts

Percent

Percentage of total observations

ValidPercent

Percentage excluding missing values

CumulativePercent

Cumulative valid percentages

Examples

data <- data.frame(
  gender = c("M", "F", "M", NA, "F"),
  age = c(25, 30, NA, 40, 35)
)
frequencies(data)


ccamp83/mu documentation built on Nov. 7, 2024, 5:17 p.m.