inherit_category: Create weighting category from data

Description Usage Arguments Value Examples

View source: R/inherit_category.R

Description

This function creates an individual weighting category with known marginal probabilities (E.g., age group, eye color.), but unlike category() it creates them from existing data instead of being directly assigned. One or more of these are built and fed into universe().

Usage

1
inherit_category(name, from, weight)

Arguments

name

Name given to weighting category, character. Must have exact match in the column names of data you intend to weight as well as the existing data from where targets are being pulled.

from

Existing data frame from where targets will be pulled.

weight

Optionally provide an existing weight variable to calculate weighted target proportions. Omit if unweighted target proportions are desired.

Value

A nested tibble with special class category.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(demo_data)

inherit_category(
  name = "EyeColor",
  from = demo_data
)

inherit_category(
  name = "BirthYear",
  from = demo_data,
  weight = prev_weight
)

ttrodrigz/iterake documentation built on July 1, 2020, 7:46 a.m.