attrassign             package:survival5             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:

     attrassign(mmat, tt)
     attrassign(lm)

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

    mmat: Model matrix

      tt: terms object

      lm: linear model

_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:

     data(pbc)
     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)

