RII                   package:RII                   R Documentation

_R_e_l_a_t_i_v_e _I_n_d_e_x _o_f _I_n_e_q_u_a_l_i_t_y _E_s_t_i_m_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     RII(count, pop, loglambda = NULL, grid = NULL, se = FALSE, B = NULL, alpha = 0.025, returnboot = FALSE)

_A_r_g_u_m_e_n_t_s:

   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?}

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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

_N_o_t_e:

     Methods available for objects of class 'RII' are 

        *  'plot.RII'

        *  'print.RII'

        *  'summary.RII'

        *  'print.summary.RII'  .in -3 

_A_u_t_h_o_r(_s):

     Jamie Sergeant, jamie.sergeant@nuffield.oxford.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     Sergeant, J. C. and Firth D. (2004)  Relative index of inequality:
     definition, estimation and inference.  In preparation.

_S_e_e _A_l_s_o:

     'plot.RII', 'RII.CVplot'.

_E_x_a_m_p_l_e_s:

     ## 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)

