model.matrix.gam            package:mgcv            R Documentation

_E_x_t_r_a_c_t _m_o_d_e_l _m_a_t_r_i_x _f_r_o_m _G_A_M _f_i_t

_D_e_s_c_r_i_p_t_i_o_n:

     Obtains the model matrix from a fitted 'gam' object.

_U_s_a_g_e:

     ## S3 method for class 'gam':
     model.matrix(object, ...)

_A_r_g_u_m_e_n_t_s:

  object: fitted model object of class 'gam' as produced by 'gam()'.

     ...: other arguments, passed to 'predict.gam'.

_D_e_t_a_i_l_s:

     Calls 'predict.gam' with no 'newdata' argument and
     'type="lpmatrix"' in order to obtain the model matrix of 'object'.

_V_a_l_u_e:

     A model matrix.

_A_u_t_h_o_r(_s):

     Simon N. Wood simon.wood@r-project.org

_R_e_f_e_r_e_n_c_e_s:

     Wood S.N. (2006b) Generalized Additive Models: An Introduction
     with R. Chapman and Hall/CRC Press.

_S_e_e _A_l_s_o:

     'gam'

_E_x_a_m_p_l_e_s:

      
     n <- 15
     x <- runif(n)
     y <- sin(x*2*pi) + rnorm(n)*.2
     mod <- gam(y~s(x,bs="cc",k=6),knots=list(x=seq(0,1,length=6)))
     model.matrix(mod)

