lrtest                package:epicalc                R Documentation

_L_i_k_e_l_i_h_o_o_d _r_a_t_i_o _t_e_s_t

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

     Likelihood ratio test for 'glm'

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

     lrtest (model1, model2, print=TRUE)

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

model1, model2: Two models having the set of same records and the same
          type ('family' and 'link') of modelling. 

   print: whether the results will be printed

_D_e_t_a_i_l_s:

     Likelihood ratio test checks the difference between
     -2*logLikelihood of the two models against the change in degrees
     of freedom using a chi-squared test. It is best applied to a model
     from 'glm' to test the effect of a factor with more than two
     levels. The records used in the dataset for both models MUST be
     the same.

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

     Virasakdi Chongsuvivatwong <cvirasak@medicine.psu.ac.th>

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

     'glm', 'logLik', 'deviance'

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

     model0 <- glm(case ~ induced + spontaneous, family=binomial, data=infert)
     model1 <- glm(case ~ induced, family=binomial, data=infert)
     lrtest (model0, model1)
     lrtest (model1, model0) # same answer
     lrtest (model1, model0) -> a
     a

