RII {RII} | R Documentation |
Estimates the relative index of inequality (Sergeant and Firth, 2004) for data consisting of the amount of exposure and observed numbers of outcomes in a set of ordered (socio-economic) classes, possibly cross-classified by some standardizing variable such as age. The (continuous) incidence rate is modelled by fitting smoothing splines by maximum penalized likelihood, with smoothing parameter selection by cross validation.
RII(count, pop, loglambda = NULL, grid = NULL, se = FALSE, B = NULL, alpha = 0.025, returnboot = FALSE)
count |
A matrix of outcome counts with number of rows equal to the number of classes and number of columns equal to the number of standardizing groups. The outcome might be death, or disease incidence, for example. |
pop |
A matrix of amounts of exposure, with dimension the same as that of count . The amount of exposure could be, for example, the number of person-years at risk, the mid-study period population or the number of individuals at risk at the start of the study period. |
loglambda |
Optional value of the smoothing parameter (on log scale) |
grid |
A vector of values (on log scale) on which to search for a starting value for use in the optimization of the smoothing parameter |
se |
Should a bootstrap standard error be computed? |
B |
The number of bootstrap samples to use if computing a standard error |
alpha |
|
returnboot |
{ If a standard error is computed, should the bootstrap datasets and their respective RII estimates and values of loglambda
be returned?}
If loglambda
is supplied then this value of the smoothing parameter is used in all calculations and grid
is redundant. For no smoothing, specify loglambda = -Inf
. Specifying loglambda = Inf
will induce a linear fit.
If loglambda
is not supplied then grid
is required. The element of grid
which yields the smallest value of the cross validation score is taken to be the starting value in a minimization of the score over the smoothing parameter. If this element is equal to min(grid)
, the optimum loglambda
is taken to be -Inf
. If this element is equal to max(grid)
, the optimum loglambda
is taken to be Inf
. If bootstrapping is performed, grid
is used for each bootstrap dataset.
For a given value of the smoothing parameter, the penalized Poisson log likelihood is maximized.
An object of class RII
, with some of the components
count |
count |
pop |
pop |
loglambda |
The value of the smoothing parameter (on log scale) used to estimate the RII |
par |
The optimum spline coefficients. When loglambda = Inf these are the intercept and gradient of the linear fit. |
group.effects |
Standardizing group effects |
maxval |
Maximum value of the penalized log likelihood |
expected |
The fitted outcome counts |
residuals |
Deviance residuals |
var |
Delta method approximation of var(RII ) |
var.log |
Delta method approximation of var(log(RII )) |
RII |
The estimated RII |
se |
Bootstrap standard error for log(RII ) |
alpha |
alpha |
ci |
Approximate 1-2*alpha empirical percentile interval for the RII |
boot.data |
The B bootstrap datasets |
boot.rep |
The estimated RIIs for the bootstrap datasets |
boot.lambda |
The values of loglambda used to estimate the RIIs for the bootstrap datasets |
Methods available for objects of class RII
are
plot.RII
print.RII
summary.RII
print.summary.RII
Jamie Sergeant, jamie.sergeant@nuffield.oxford.ac.uk
Sergeant, J. C. and Firth D. (2004) Relative index of inequality: definition, estimation and inference. In preparation.
## Estimate the RII for the LSDeaths data, ## using a smoothing parameter of 1 data(LSDeaths) LSdead <- xtabs(Deaths ~ class + age, data = LSDeaths) LSatrisk <- xtabs(AtRisk ~ class + age, data = LSDeaths) LSRII <- RII(LSdead, LSatrisk, loglambda = 0)