freq_var_by: Compute frequency by group of a qualitative variable of a...

View source: R/strata.R

freq_var_byR Documentation

Compute frequency by group of a qualitative variable of a data.frame()

Description

Compute frequency of each level (or value) of the variable, by another grouping variable(s)

Usage

freq_var_by(data, variable, by = "yw", complete = TRUE)

Arguments

data

data.frame()

variable

variable to compute frequency on (for each level)

by

grouping variables (final output)

complete

if TRUE missing levels in groups will be completed with zero frequency

Value

data.frame() Returned columns:

level

level of the variable

n

frequency of the level in the group

n_total

Total of non missing value in for the variable in the group

prop_raw

Proportion of the level

group...

One column of each group, with the value of the current group


cturbelin/ifnBase documentation built on Nov. 5, 2023, 12:54 p.m.