decomposition {rineq}R Documentation

Decomposition analysis

Description

Used by the wrapper contribution() but can be used manually. Calculates the decomposition for a given regression model.

Usage

decomposition(outcome, betas, mm, ranker, wt, correction, citype = "CI")

Arguments

outcome

Outcome variable

betas

Beta coefficients from regression.

mm

Model matrix from regression

ranker

Ranking variable

wt

Weights

correction

Apply sign correction?

citype

Character, CI type to be calculated, defaults to CI. Use CIw for binary outcomes.

Details

NOTE: Only models with data with ordinary indexes are supported (starting from 1, sequentially increasing by increments of 1). For the case were rows with NA are automatically omitted by the model function, the used indices are guessed based on the row names of the model matrix and then used for accessing the ranker variable. However, this may lead to issues if the row names do not correspond to ordinary integer indexes.

Value

S3 object of class decomposition

Examples

fit.lm = lm(mtcars$mpg ~ mtcars$cyl)
decomp = decomposition(mtcars$mpg, coefficients(fit.lm), fit.lm$model, 
                       mtcars$hp, wt = rep(1, nrow(mtcars)), correction = FALSE) 
summary(decomp)


[Package rineq version 0.3.0 Index]