mfit                  package:Rlab                  R Documentation

_C_o_m_p_u_t_e_s _m_a_i_n _a_n_d _i_n_t_e_r_a_c_t_i_o_n _f_i_t_t_e_d _e_f_f_e_c_t_s

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

     Calculates main fitted effects for individual factors and two-way
     interaction fitted effects for all pairs of factors. Any number of
     factors may be input. Three-way, four-way, etc. fitted effects are
     not shown, even when more than two factors are given.

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

     mfit(y, ..., dec = 3)

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

       y: Vector of responses whose fitted effects are shown. 

     ...: Vectors of different factors. 

     dec: Number of decimal places to print. 

_S_e_e _A_l_s_o:

     lm, fitted

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

     # Create a data set with two factors (age and gender)
     race<-data.frame(c(1.02,.99,1.11,1.30,1.09,1.26,1.21,1.19,1.30,1.45,1.34,1.49),
                      c('M','M','M','M','M','M','F','F','F','F','F','F'),
                      c('under 50','under 50','under 50','over 50','over 50','over 50',
                        'under 50','under 50','under 50','over 50','over 50','over 50'))
     names(race)<-c("time","gender","age")

     # Show fitted effects for age, gender and age & gender
     means(race$time, race$age, race$gender)

