adjustx                package:adlift                R Documentation

_a_d_j_u_s_t_x

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

     This function produces new grid values to cope with data with
     repeated grid values according to the method chosen to deal with
     it.

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

     adjustx(x, f, type = "mean")

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

       x: a vector of the original (repeated) gridpoints.

       f: the vector of function values associated to the grid vector
          'X'.

    type: The method used to cope with the multiple points. '"mean"'
          averages all function values with the same grid value. The
          '"jitter"' option adds a small amount to all but one of each
          repeated grid value, and associates the function values to
          these new gridpoints. In this way, the each gridpoint value
          corresponds uniquely to the function values.

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

     The function compares 'x' to 'unique(x)' to find the occurences of
     repeated grid values, and stores the information in groups. In the
     '"jitter"' case, this is then used to modify the original
     gridpoints by adding an epsilon to the repeated values. In the
     case of 'type="mean"', the new gridpoints are, in fact
     'unique(x)', and the information is used to average the groups of
     original function values to construct 'sepf'.

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

    sepx: the vector of new gridpoints.

    sepf: the function values associated to 'sepx'. 

  groups: a list of indices into 'x' showing where the original
          repeated grid values occured.

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

     Matt Nunes (matt.nunes@bristol.ac.uk), Marina Popa
     (Marina.Popa@bristol.ac.uk)

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

     'fwtnp',

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

     #read in the motorcycle crash data 
     #
     mcdata()

     #
     dim(mcdata)

     #check data.
     #
     a<-adjustx(times,accel,"mean")
     #
     #note the repeated values in the original grid data
     #
     #display new data vectors
     a$sepx
     #
     a$sepf
     # 
     #and now the new adjusted data has length 94.
     #

