plot.RII {RII} | R Documentation |
A plot method for objects of class RII
.
## S3 method for class 'RII': plot(x, group = 1, ylim = NULL, ...)
x |
An object of class RII |
group |
Which standardizing group to plot |
ylim |
Graphical parameter with a useful default |
... |
Graphical parameters |
RII.plot
gives a graphical interpretation of the output from RII
. For the specified standardizing group, the empirical incidence rate for each class is obtained by dividing the count in that class by the amount of eposure and then plotted. The natural cubic spline incidence rate fitted by RII
(multiplied by the exponential of the appropriate group effect) is then added to the plot. For the first standardizing group (and for data with only one group) the group effect is defined to be 0.
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) ## Plot the data and fitted death rate for each age group par(mfrow=c(2,2)) plot(LSRII, group = "25-34", main = "(a) age group 25-34") plot(LSRII, group = "35-44", main = "(b) age group 35-44") plot(LSRII, group = "45-54", main = "(c) age group 45-54") plot(LSRII, group = "55-64", main = "(d) age group 55-64")