RII.CVplot {RII} | R Documentation |
Evaluates and plots a cross validation score over a specified range of values of the smoothing parameter.
RII.CVplot(count, pop, loglambda, ...)
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 |
A vector of values of the smoothing parameter (on log scale) |
... |
Graphical parameters |
RII.CVplot
is designed to be used for exploratory purposes before estimating a relative index of inequality using RII
. The cross validation score is computed taking each element of loglambda
in turn to be the value of the smoothing parameter and the results are plotted. Using RII.CVplot
(with perhaps several different values of loglambda
) should allow the user to choose a suitable argument grid
for use in RII
, or select a single value of the smoothing parameter that is close to being optimal.
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.
## Plot the cross validation score over a range ## of smoothing parameter values for the LSDeaths data data(LSDeaths) LSdead <- xtabs(Deaths ~ class + age, data = LSDeaths) LSatrisk <- xtabs(AtRisk ~ class + age, data = LSDeaths) RII.CVplot(LSdead, LSatrisk, loglambda = seq(-2,18,len=21))