linear.approx              package:boot              R Documentation

_L_i_n_e_a_r _A_p_p_r_o_x_i_m_a_t_i_o_n _o_f _B_o_o_t_s_t_r_a_p _R_e_p_l_i_c_a_t_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function takes a bootstrap object and for each bootstrap
     replicate it calculates the linear approximation to the statistic
     of interest for  that bootstrap sample.

_U_s_a_g_e:

     linear.approx(boot.out, L=NULL, index=1, type=NULL, t0=NULL, 
                   t=NULL, ...)

_A_r_g_u_m_e_n_t_s:

boot.out: An object of class '"boot"' representing a nonparametric
          bootstrap.  It will usually be created by the function
          'boot'. 

       L: A vector containing the empirical influence values for the
          statistic of interest.  If it is not supplied then 'L' is
          calculated through a call  to 'empinf'. 

   index: The index of the variable of interest within the output of 
          'boot.out$statistic'.  

    type: This gives the type of empirical influence values to be
          calculated.  It is not used if 'L' is supplied.  The possible
          types of empirical influence values are described in the help
          for 'empinf'. 

      t0: The observed value of the statistic of interest.  The input
          value is used only  if one of 't' or 'L' is also supplied. 
          The default value is  'boot.out$t0[index]'.  If 't0' is
          supplied but neither 't' nor 'L' are supplied then 't0' is
          set to 'boot.out$t0[index]' and a warning is generated. 

       t: A vector of bootstrap replicates of the statistic of
          interest.  If 't0' is  missing then 't' is not used,
          otherwise it is used to calculate the empirical  influence
          values (if they are not supplied in 'L').   

     ...: Any extra arguments required by 'boot.out$statistic'.  These
          are needed if 'L' is not supplied as they are used by
          'empinf' to calculate empirical  influence values. 

_D_e_t_a_i_l_s:

     The linear approximation to a bootstrap replicate with frequency
     vector 'f' is given by 't0 + sum(L * f)/n' in the one sample with
     an easy extension to the stratified case.  The frequencies are
     found by calling 'boot.array'.

_V_a_l_u_e:

     A vector of length 'boot.out$R' with the linear approximations to
     the statistic of interest for each of the bootstrap samples.

_R_e_f_e_r_e_n_c_e_s:

     Davison, A.C. and Hinkley, D.V. (1997)  _Bootstrap Methods and
     Their Application_. Cambridge University Press.

_S_e_e _A_l_s_o:

     'boot', 'empinf', 'control'

_E_x_a_m_p_l_e_s:

     # Using the city data let us look at the linear approximation to the 
     # ratio statistic and its logarithm. We compare these with the 
     # corresponding plots for the bigcity data 

     ratio <- function(d, w)
          sum(d$x * w)/sum(d$u * w)
     city.boot <- boot(city, ratio, R=499, stype="w")
     bigcity.boot <- boot(bigcity, ratio, R=499, stype="w")
     par(pty="s")
     par(mfrow=c(2,2))

     # The first plot is for the city data ratio statistic.
     city.lin1 <- linear.approx(city.boot)
     lim <- range(c(city.boot$t,city.lin1))
     plot(city.boot$t, city.lin1, xlim=lim,ylim=lim, 
          main="Ratio; n=10", xlab="t*", ylab="tL*")
     abline(0,1)

     # Now for the log of the ratio statistic for the city data.
     city.lin2 <- linear.approx(city.boot,t0=log(city.boot$t0), 
                                t=log(city.boot$t))
     lim <- range(c(log(city.boot$t),city.lin2))
     plot(log(city.boot$t), city.lin2, xlim=lim, ylim=lim, 
          main="Log(Ratio); n=10", xlab="t*", ylab="tL*")
     abline(0,1)

     # The ratio statistic for the bigcity data.
     bigcity.lin1 <- linear.approx(bigcity.boot)
     lim <- range(c(bigcity.boot$t,bigcity.lin1))
     plot(bigcity.lin1,bigcity.boot$t, xlim=lim,ylim=lim,
          main="Ratio; n=49", xlab="t*", ylab="tL*")
     abline(0,1)

     # Finally the log of the ratio statistic for the bigcity data.
     bigcity.lin2 <- linear.approx(bigcity.boot,t0=log(bigcity.boot$t0), 
                                   t=log(bigcity.boot$t))
     lim <- range(c(log(bigcity.boot$t),bigcity.lin2))
     plot(bigcity.lin2,log(bigcity.boot$t), xlim=lim,ylim=lim,
          main="Log(Ratio); n=49", xlab="t*", ylab="tL*")
     abline(0,1)

     par(mfrow=c(1,1))

