mutual_total_nested | R Documentation |
Returns the between-within decomposition defined by
the sequence of variables in unit
.
mutual_total_nested(data, group, unit, weight = NULL, base = exp(1))
data |
A data frame. |
group |
A categorical variable or a vector of variables
contained in |
unit |
A vector of variables
contained in |
weight |
Numeric. (Default |
base |
Base of the logarithm that is used in the calculation. Defaults to the natural logarithm. |
Returns a data.table similar to mutual_total
,
but with column between
and within
that define
the levels of nesting.
mutual_total_nested(schools00, "race", c("state", "district", "school"),
weight = "n"
)
# This is a simpler way to run the following manually:
# mutual_total(schools00, "race", "state", weight = "n")
# mutual_total(schools00, "race", "district", within = "state", weight = "n")
# mutual_total(schools00, "race", "school", within = c("state", "district"), weight = "n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.