relimp                package:relimp                R Documentation

_R_e_l_a_t_i_v_e _I_m_p_o_r_t_a_n_c_e _o_f _P_r_e_d_i_c_t_o_r_s _i_n _a _R_e_g_r_e_s_s_i_o_n _M_o_d_e_l

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

     Produces a summary of the relative importance of two predictors or
     two sets of predictors in a fitted model object.

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

     relimp(object, set1=NULL,  set2=NULL, label1="set1", label2="set2", 
               subset=TRUE, 
               response.cat=NULL, ...)
     print.relimp(x, digits=3, ...)

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

  object: A model object of class 'lm', 'glm', 'coxph', 'survreg', 
          'multinom',  'polr', 'gls' or 'lme'

    set1: An index or vector of indices for the effects to be included
          in the numerator of the comparison

    set2: An index or vector of indices for the effects to be included
          in the denominator of the comparison

  label1: A character string; mnemonic name for the  variables in
          'set1'

  label2: A character string; mnemonic name for the variables in 'set2'

  subset: Either a vector of numeric indices for the cases to be
          included in the standardization of effects, or a vector of
          logicals ('TRUE' for inclusion) whose length is the same as
          the number of rows in the model frame, 'object$model'. The
          default choice is to include all cases in the model frame.

response.cat: If 'object' is of class 'multinom',  this is a character
          string used to specify which regression is of interest (i.e.,
          the regression which predicts the log odds on 'response cat'
          versus the model's  reference category).  The 'response.cat'
          argument should be an element of 'object$lab'; or 'NULL' if
          'object' is not of class 'multinom'.

     ...: For models of class 'glm', one may additionally set the
          dispersion parameter for the family (for example,
          'dispersion=1.69'). By default it is obtained from 'object'. 
          Supplying it here permits explicit allowance for
          over-dispersion, for example.

       x: an object of class 'relimp'

  digits: The number of decimal places to be used in the printed 
          summary.  Default is 3.

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

     If 'set1' and 'set2' both have length 1, relative importance is
     measured by the ratio of the two standardized coefficients.
     Equivalently this is the ratio of the standard deviations of the
     two contributions to the linear predictor, and this provides the
     generalization to comparing two sets rather than just a pair of
     predictors.

     The computed ratio is the square root of the variance-ratio
     quantity denoted as `omega' in Silber, J H, Rosenbaum, P R and
     Ross, R N (1995).  Estimated standard errors are calculated by the
     delta method, as described in that paper for example. 

     If 'set1' and 'set2' are unspecified, and if the 'tcltk' package
     has been  loaded, a dialog box is provided (by a call to
     'pickFrom') for the choice of 'set1' and 'set2' from the available
     model coefficients.

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

     An object of class 'relimp', with at least the following
     components: 

   model: The call used to construct the model object summarized

    sets: The two sets of indices specified as arguments

log.ratio: The natural logarithm of the ratio of effect standard
          deviations corresponding to the two sets specified

se.log.ratio: An estimated standard error for log.ratio


     If 'dispersion' was supplied as an argument, its value is stored
     as the 'dispersion' component of the resultant object.

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

     David Firth d.firth@warwick.ac.uk

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

     Silber, J. H., Rosenbaum, P. R. and Ross, R N (1995) Comparing the
     Contributions of Groups of Predictors: Which Outcomes Vary with
     Hospital Rather than Patient Characteristics?  _JASA_ *90*, 7-18.

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

     'relrelimp'

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

     x <- rnorm(100)
     z <- rnorm(100)
     w <- rnorm(100)
     y <- 3+ 2*x + z + w + rnorm(100)
     test <- lm(y ~ x +z +w)
     print(test)
     relimp(test, 2, 3)    #  compares effects of x and z
     relimp(test, 2, 3:4)  #  compares effect of x with that of (z,w) combined
     ##
     ##  Data on housing and satisfaction, from Venables and Ripley
     ##  -- multinomial logit model
     library(MASS)
     library(nnet)
     data(housing)
     house.mult <- multinom(Sat ~ Infl + Type + Cont, weights = Freq,
       data = housing)
     relimp(house.mult, set1 = 2:3, set2 = 7, response.cat = "High")

