Description Usage Arguments Value Examples
View source: R/inherit_category.R
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()
.
1 | inherit_category(name, from, weight)
|
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. |
A nested tibble
with special class category
.
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
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.