contribution: Functions to decompose the Relative Concentration Index into...

View source: R/contribution.R

contributionR Documentation

Functions to decompose the Relative Concentration Index into its components

Description

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.

Usage

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, ...)

Arguments

object

for contribution(): an object of class coxph, glm, lm or svyglm; the outcome should be the health variable and the predictors the components. For summary(): an object of class decomposition.

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 decomposition.

decreasing

should contributions be sorted in decreasing order? Defaults to TRUE.

...

other arguments to be passed on to the concerned methods.

Details

If correction is TRUE negative values of components or outcome are corrected using correct_sign with option shift = FALSE.

Value

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

Warning

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.

Author(s)

Peter Konings

References

Konings et al., 2009 Speybroeck et al., 2009

Examples

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 (%)")

brechtdv/rineq documentation built on Feb. 21, 2024, 2:18 p.m.