Description Usage Arguments Value
View source: R/decomp_meanIncomeBySources.R
Static decomposition of the mean income by sources
1 2 3 4 5 6 | decomp_meanIncomeBySources(
data,
incomeSources_vars,
totalIncome_var,
weight = NULL
)
|
data |
A data.frame with income sources and the total income (and possibliy sample weights) as variables |
incomeSources_vars |
A character vector with names of the income sources (they must be columns of 'data') |
totalIncome_var |
A character value naming the variable wich represents the total income (it must be a column of 'data' and for each observation in the data, the income sources must add up to the total income). |
weight |
(optional) A character values naming the variable wich represents the sample weights |
Returns a tibble with the following coluns: - Income Source: name of the income source - Mean: Mean of the income source - Prop. Pop. Recipients: Proportion of the population receiving non-zero income for each source - Mean*Prop. Pop. Recipients: mean times the proportion of recipients. This column must sum up to the global mean of the total income variable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.