home *** CD-ROM | disk | FTP | other *** search
-
- _H_e_l_p _p_r_o_c_e_s_s _t_h_e '_s_p_e_c_i_a_l_s' _a_r_g_u_m_e_n_t _o_f _t_h_e _t_e_r_m_s _f_u_n_c_t_i_o_n.
- _G_i_v_e_n _a _t_e_r_m_s _s_t_r_u_c_t_u_r_e _a_n_d _a _d_e_s_i_r_e_d _s_p_e_c_i_a_l _n_a_m_e, _t_h_i_s
- _r_e_t_u_r_n _a_n _i_n_d_e_x _a_p_p_r_o_p_r_i_a_t_e _f_o_r _s_u_b_s_c_r_i_p_t_i_n_g _t_h_e _t_e_r_m_s
- _s_t_r_u_c_t_u_r_e _a_n_d _a_n_o_t_h_e_r _a_p_p_r_o_p_r_i_a_t_e _f_o_r _t_h_e _d_a_t_a _f_r_a_m_e.
-
- untangle.specials(tt, special, order=1)
-
- _A_r_g_u_m_e_n_t_s:
-
- tt:
- a terms object.
-
- special:
- the name of a special function, presumably used in the
- terms object.
-
- order:
- the order of the desired terms. If set to 2, interac-
- tions with the special function will be included.
-
- Value:
-
- a list with two components:
-
- _A_r_g_u_m_e_n_t_s:
-
- vars:
- a vector of variable names, as would be found in the
- data frame, of the specials.
-
- terms:
- a numeric vector, suitable for subscripting the terms
- structure, that indexes the terms in the expanded model
- formula which involve the special.
-
- _E_x_a_m_p_l_e_s:
-
- # This is code from within the coxph program, m is the data frame and TT
- # the terms structure for the formula. We wish to exclude first order
- # strata() terms from the final X matrix, and also to extract these terms
- # to a second data frame
- TT <- terms(formula, specials='strata')
- temp <- untangle.specials(TT, 'strata')
- if (length(tempars))
- X <- model.matrix( TT[-temperms], m)
- m.strat <- m[tempars]
-
- else X <- model.matrix(TT, m)
-
-