dataIndex              package:candisc              R Documentation

_I_n_d_i_c_e_s _o_f _o_b_s_e_r_v_a_t_i_o_n_s _i_n _a _m_o_d_e_l _d_a_t_a _f_r_a_m_e

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

     Find sequential indices for observations in a data frame
     corresponding to the unique combinations of the levels of a given
     model term from a model object or a data frame

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

     dataIndex(x, term)

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

       x: Either a data frame or a model object

    term: The name of one term in the model, consisting only of factors

_V_a_l_u_e:

     A vector of indices.

_A_u_t_h_o_r(_s):

     Michael Friendly

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

     factors <- expand.grid(A=factor(1:3),B=factor(1:2),C=factor(1:2))
     n <- nrow(factors)
     responses <-data.frame(Y1=10+round(10*rnorm(n)),Y2=10+round(10*rnorm(n)))

     test <- data.frame(factors, responses)
     mod <- lm(cbind(Y1,Y2) ~ A*B, data=test)

     dataIndex(mod, "A")
     dataIndex(mod, "A:B")

