contribution | R Documentation |
These functions decompose the Relative Concentration Index into its components using a (generalized) linear model, optionally using a survey design, or a Cox Proportional Hazards model. Print, summary and plot methods have been defined for the results.
contribution(object, ranker, correction = TRUE)
## S3 method for class 'coxph'
contribution(object, ranker, correction = TRUE)
## S3 method for class 'glm'
contribution(object, ranker, correction = TRUE)
## S3 method for class 'lm'
contribution(object, ranker, correction = TRUE)
## S3 method for class 'svyglm'
contribution(object, ranker, correction = TRUE)
## methods for 'decomposition' object
## S3 method for class 'decomposition'
plot(x, decreasing = TRUE, ...)
## S3 method for class 'decomposition'
print(x, ...)
## S3 method for class 'decomposition'
summary(object, ...)
object |
for |
ranker |
a numeric vector containing the wealth variable, from the same dataframe as the outcome. |
correction |
a logical indicating whether the global and partial RCIs should be corrected for negative values using imputation. |
x |
an object of class |
decreasing |
should contributions be sorted in decreasing order? Defaults to |
... |
other arguments to be passed on to the concerned methods. |
If correction
is TRUE
negative values of components or outcome are corrected using correct_sign
with option shift = FALSE
.
An object of class decomposition
containing the following components
betas |
a numeric vector containing regression coefficients |
partial_cis |
a numeric vector containing partial RCIs |
confints |
a numeric vector contaning 95% confience intervals for the partial concentration indices |
ranker
should be chosen with care. Ideally, it is a variable from the same dataframe as the other variables. If not, redefine the row names in the model.
Peter Konings
Konings et al., 2009 Speybroeck et al., 2009
data(nigeria)
## fit multivariable model
fit <-
glm(zscore1 ~
quintile + ed + rural + region + male + bord + agechild + agemother,
data = nigeria,
weights = nigeria$weight)
summary(fit)
## decompose relative concentration index
contrib <- contribution(fit, nigeria$wealth)
summary(contrib)
par(mar = c(4, 8, 1, 1))
plot(contrib, decreasing = FALSE,
horiz = TRUE, las = 1, xlab = "Contribution (%)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.