universe: Create universe

View source: R/universe.R

universeR Documentation

Create universe

Description

Along with the data to be weighted, this combines one or more objects of class category to build the universe with known marginal proportions. It also checks and adjusts the proportions to account for missing values in the data.

Usage

universe(data, ...)

Arguments

data

Data frame containing data where weights are desired.

...

One or more output objects from category().

Value

A list with special class universe.

Examples

universe(
    data = mtcars,
    category(
        name = "cyl",
        groups = c(4, 6, 8),
        targets = c(0.3, 0.3, 0.4)
    ),
    category(
        name = "vs",
        groups = c(0, 1),
        targets = c(1/2, 1/2)
    )
)


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