interpprev               package:lgtdl               R Documentation

_I_n_t_e_r_p_o_l_a_t_i_o_n _U_s_i_n_g _t_h_e _P_r_e_v_i_o_u_s _V_a_l_u_e

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

     These functions provide an interpolation mechanism for objects of
     class `lgtdl'. The `AsIs' method is the vectorized version.

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

     interpprev(x, ...)
     interpprev.lgtdl(x, times, cov)
     interpprev.AsIs(x, ...)

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

       x: `x' is either an object of class `lgtdl' or of class `AsIs'.
          It is the object on which interpolation is to be performed.  

   times: A vector of times at which interpolation is requested.

     cov: The name of the covariate on which interpolation is
          requested. It is only required if `x' has more than one
          covariate.

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

     If objects of class `lgtdl' are inserted into a data frame they
     become a vector with class `AsIs'. In order to operate on these we
     provide a method for that class. The method is simply a vectorized
     version.

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

     `interpprev.lgtdl' returns a numeric vector of the interpolated
     values of the covariate at the time(s) specified by `times'.
     `interpprev.AsIs' returns a vector of interpolated values of the
     covariate. In this case the vector contains one value for each
     element `x'. `times' must be either the same length as `x' or of
     length one. In the latter case all interpolations are done at that
     time.

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

     Robert Gentleman

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

     `interplinear'

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

       x1<-data.frame(time=c(1,3,5), cov=c(4,6,8))
       x2<-data.frame(time=c(11,13,15), interest=c(66,45,88))
       x1<-as.lgtdl(x1)
       x2<-as.lgtdl(x2)
       interpprev(x1, c(2,4))
       interpprev(x2, c(12, 14))

