category: Create a weighting category.

View source: R/category.R

categoryR Documentation

Create a weighting category.

Description

This function creates a new weighting category.

Usage

category(name, groups, targets)

Arguments

name

The name of the weighting category matching the name of the corresponding variable in the data to be weighted.

groups

A vector of the groups in the weighting category.

targets

A vector of the desired proportions of the groups. These target will be automatically re-proportioned to sum to 1 if necessary.

Value

A list with the class of "category".

Examples

category(
    name = "vs",
    groups = c(0, 1),
    targets = c(1/3, 2/3)
)


ttrodrigz/iterake documentation built on March 27, 2024, 12:48 a.m.