attrassign             package:survival             R Documentation

_C_r_e_a_t_e _n_e_w-_s_t_y_l_e "_a_s_s_i_g_n" _a_t_t_r_i_b_u_t_e

_D_e_s_c_r_i_p_t_i_o_n:

     The '"assign"' attribute on model matrices describes which columns
     come from which terms in the model formula. It has two version. R
     uses the original version, but the newer version is sometimes
     useful.

_U_s_a_g_e:

     ## Default S3 method:
     attrassign(object, tt,...)
     ## S3 method for class 'lm':
     attrassign(object,...)

_A_r_g_u_m_e_n_t_s:

  object: model matrix or linear model object

      tt: terms object

     ...: ignored

_V_a_l_u_e:

     A list with names corresponding to the term names and elements
     that are vectors indicating which columns come from which terms

_S_e_e _A_l_s_o:

     'terms','model.matrix'

_E_x_a_m_p_l_e_s:

     formula<-Surv(time,status)~factor(edtrt)
     tt<-terms(formula)
     mf<-model.frame(tt,data=pbc)
     mm<-model.matrix(tt,mf)
     ## a few rows of data
     mm[1:3,]
     ## old-style assign attribute
     attr(mm,"assign")
     ## new-style assign attribute
     attrassign(mm,tt)

