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")

