logpoisson              package:glmmAK              R Documentation

_P_o_i_s_s_o_n _l_o_g-_l_i_n_e_a_r _r_e_g_r_e_s_s_i_o_n _m_o_d_e_l

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

     Fits the poisson log-linear regression model using the
     maximum-likelihood. The log-likelihood is maximized using the
     Newton-Raphson algorithm (the same as Fisher scoring in this
     case). The function returns the inverse of the observed and
     expected information matrix.

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

     logpoisson(y, x, offset=0, epsilon=1e-08, maxit=25, trace=FALSE)

     ## S3 method for class 'logpoisson':
     print(x, ...)

     ## S3 method for class 'logpoisson':
     summary(object, ...)

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

       y: response vector taking integer values or zero.

       x: matrix or data.frame with covarites.

          Intercept is included by default in the model and should not
          be included in 'x'. 

  offset: possible offset term. It is assumed to be equal to zero if
          not specified.

 epsilon: positive convergence tolerance epsilon. The iterations
          converge when

              abs((l[new] - l[old])/l[new]) <= epsilon,

          where l denotes the value of the log-likelihood. 

   maxit: integer giving the maximal number of iterations.

   trace: logical indicating if output should be produced for each
          iteration.

  object: an object of class "logpoisson".

     ...: other arguments passed to 'print' or 'summary'.

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

     An object of class "logpoisson". This has components 

coefficients: the coefficients of the linear predictor.

  loglik: the value of the log-likelihood.

   score: the score vector.

    vcov: the inverse of the information matrix.

linear.predictors: the values of the linear predictor for each
          observation.

fitted.values: the values of fitted counts for each observation.

converged: logical indicating whether the optimization routine
          converged.

    iter: number of iterations performed

       y: 

       x: 

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

     Arno&#353t Kom&#225rek arnost.komarek[AT]mff.cuni.cz

_R_e_f_e_r_e_n_c_e_s:

     Agresti, A. (2002). _Categorical Data Analysis. Second edition_.
     Hoboken: John Wiley & Sons. Section 7.2.

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

     'glm'.

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

     set.seed(1977)
     n <- 100
     x1 <- rbinom(n, 1, 0.4)
     x2 <- runif(n, 0, 1)
     eta <- 5 + 0.1*x1 -0.2*x2
     mu <-  exp(eta)
     y <- rpois(n, mu)

     ### Fit the model using poisson
     Xmat <- data.frame(x1=x1, x2=x2)
     fit <- logpoisson(y=y, x=Xmat)
     summary(fit)

     ### Fit the model using standard glm
     fit0 <- glm(y~x1+x2, family=poisson(link="log"))
     summary(fit0)

