predict.glmmPQL             package:MASS             R Documentation

_P_r_e_d_i_c_t _M_e_t_h_o_d _f_o_r _g_l_m_m_P_Q_L _F_i_t_s

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

     Obtains predictions from a fitted generalized linear model with
     random effects.

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

     ## S3 method for class 'glmmPQL':
     predict(object, newdata = NULL, type = c("link", "response"),
            level, na.action = na.pass, ...)

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

  object: a fitted object of class inheriting from '"glmmPQL"'.

 newdata: optionally, a data frame in which to look for variables with
          which to predict.

    type: the type of prediction required.  The default is on the scale
          of the linear predictors; the alternative '"response"' is on
          the scale of the response variable.  Thus for a default
          binomial model the default predictions are of log-odds
          (probabilities on logit scale) and 'type = "response"' gives
          the predicted probabilities.

   level: an optional integer vector giving the level(s) of grouping to
          be used in obtaining the predictions. Level values increase
          from outermost to innermost grouping, with level zero
          corresponding to the population predictions. Defaults to the
          highest or innermost level of grouping.

na.action: function determining what should be done with missing values
          in 'newdata'.  The default is to predict 'NA'.

     ...: further arguments passed to or from other methods.

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

     If 'level' is a single integer, a vector otherwise a data frame.

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

     'glmmPQL', 'predict.lme'.

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

     fit <- glmmPQL(y ~ trt + I(week > 2), random = ~1 |  ID,
                    family = binomial, data = bacteria)
     predict(fit, bacteria, level = 0, type="response")
     predict(fit, bacteria, level = 1, type="response")

