lf                  package:locfit                  R Documentation

_L_o_c_f_i_t _t_e_r_m _i_n _A_d_d_i_t_i_v_e _M_o_d_e_l _f_o_r_m_u_l_a

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

     This function is used to specify a smooth term in a 'gam()' model
     formula.

     This function is designed to be used with the S-Plus 'gam()'
     function. For R users, there are at least two different 'gam()'
     functions available. Most current distributions of R will include
     the 'mgcv' library by Simon Wood; 'lf()' is not compatable with
     this function.

     On CRAN, there is a 'gam' package by Trevor Hastie, similar to the
     S-Plus version. 'lf()' should be compatable with this, although
     it's untested.

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

     lf(..., alpha=0.7, deg=2, scale=1, kern="tcub", ev=rbox(), maxk=100)

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

     ...: numeric predictor variable(s)

alpha, deg, scale, kern, ev, maxk: these are as in 'locfit.raw'.

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

     'locfit', 'locfit.raw', 'gam.lf', 'gam'

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

     # fit an additive semiparametric model to the ethanol data.
     stopifnot(require(gam))
     # The `gam' package must be attached _before_ `locfit', otherwise
     # the following will not work.
     fit <- gam(NOx ~ lf(E) + C, data=ethanol)
     op <- par(mfrow=c(2, 1))
     plot(fit)
     par(op)

