lm.bp {bivpois} | R Documentation |
Produces a "list" object which gives details regarding the fit of a bivariate Poisson regression model of the form
hspace{1cm} $X_i,Y_i sim BP( λ_{1i}, λ_{2i}, λ_{3i} )$ for $i =1, 2, ... , n$, with
hspace{1cm} $log{underline λ}_1 = {bf w}_1 {underline β}_1$, $log{underline λ}_2 = {bf w}_2 {underline β}_2$ and $log{underline λ}_3 = {bf w}_3 {underline β}_3$ ;
where
lm.bp( l1, l2, l1l2=NULL, l3=~1, data, common.intercept=FALSE, zeroL3=FALSE, maxit=300, pres=1e-8, verbose=getOption("verbose") )
l1 |
Formula of the form ``$xsim X_1+...+X_p$" for parameters of $logλ_1$. |
l2 |
Formula of the form ``$ysim X_1+...+X_p$" for parameters of $logλ_2$. |
l1l2 |
Formula of the form ``$sim X_1+...+X_p$" for the common parameters of $logλ_1$ and $logλ_2$.
If the explanatory variable is also found on l1 and/or l2 then a model using interaction type parameters is fitted
(one parameter common for both predictors [main effect] and differences from this for the other predictor [interaction type effect] ).
Special terms of the form ``c(X1,X2) " can be also used here.
These terms imply common parameters of $λ_1$ and $λ_2$ on different variables.
For example if c(x1,x2) is used then use the same beta for the effect of $x_1$ on $logλ_1$ and the effect of $x_2$ on
$logλ_2$. For details see example 4 - dataset ex4.ita91 .
|
l3 |
Formula of the form ``$sim X_1+...+X_p$" for the parameters of $logλ_3$. |
data |
Data frame containing the variables in the model. |
common.intercept |
Logical function specifying whether a common intercept on $logλ_1$ and $logλ_2$ should be used.
The default value is FALSE . |
zeroL3 |
Logical argument controlling whether $λ_3$ should be set equal to zero (therefore fits a double Poisson model). |
maxit |
Maximum number of EM steps. Default value is 300 iterations. |
pres |
Precision used in stopping the EM algorithm. The algorithm stops when the relative log-likelihood difference is lower than the value of pres. |
verbose |
Logical argument controlling whether beta parameters will we printed while EM runs. Default value is taken equal to the
value of linebreak options()\$verbose .
If verbose=FALSE then only the iteration number, the loglikelihood and its relative difference from the previous iteration
are printed.
If verbose=TRUE then the model parameters $β_1$, $β_2$ and $β_3$ are additionally printed |
A list object returned with the following variables.
coefficients |
Estimates of the model parameters for $β_1$, $β_2$ and $β_3$. When a factor is used then its default set of constraints is used. |
fitted.values |
Data frame with $n$ lines and 2 columns containing the fitted values for $x$ and $y$. For the bivariate Poisson model the fitted values are given by $λ_1+λ_3$ and $λ_2+λ_3$ respectively. |
residuals |
Data frame with $n$ lines and 2 columns containing the residuals of the model for $x$ and $y$. For the bivariate Poisson model the residual values are given by $x-E(x)$ and $y-E(y)$ respectively; where $E(x)=λ_1+λ_3$ and $E(y)=λ_2+λ_3$. |
beta1,beta2, beta3 |
Vectors $β_1, β_2$ and $β_3$ containing the coefficients involved in the linear predictors of
$λ_1 , λ_2$ and $λ_3$ respectively. When zeroL3=TRUE then beta3 is not calculated. |
lambda1, lambda2 |
Vectors of length $n$ containing the estimated $λ_1$ and $λ_2$ for each observation |
lambda3 |
vector containing the values of $λ_3$. If zeroL3=TRUE then lambda3 is equal to zero and is not provided. |
loglikelihood |
Maximized log-likelihood of the fitted model. This is given in a vector form (one value per iteration). Using this vector we can monitor the log-likelihood evolution in each EM step. |
AIC, BIC |
AIC and BIC of the model. Values are also provided for the double Poisson model and the saturated model. |
parameters |
Number of parameters. |
iterations |
Number of iterations. |
call |
Argument providing the exact calling details of the lm.bp function. |
1. Dimitris Karlis, Department of Statistics, Athens University of Economics and Business, Athens, Greece, karlis@aueb.gr .
2. Ioannis Ntzoufras, Department of Statistics, Athens University of Economics and Business, Athens, Greece, ntzoufras@aueb.gr .
1. Karlis, D. and Ntzoufras, I. (2005). Bivariate Poisson and Diagonal Inflated Bivariate Poisson Regression Models in R. Journal of Statistical Software (to appear).
2. Karlis, D. and Ntzoufras, I. (2003). Analysis of Sports Data Using Bivariate Poisson Models. Journal of the Royal Statistical Society, D, (Statistician), 52, 381 - 393.
data(ex1.sim) # Fit Double and Bivariate Poisson models () # # Model 2: DblPoisson(l1, l2) ex1.m2<-lm.bp(x~1 , y~1 , data=ex1.sim, zeroL3=TRUE) # # Model 3: BivPoisson(l1, l2, l3); same as simple.bp(ex1.sim$x, ex1.sim$y) ex1.m3<-lm.bp(x~1 , y~1 , data=ex1.sim) # Model 4: DblPoisson (l1=Full, l2=Full) ex1.m4<-lm.bp(x~. , y~. , data=ex1.sim, zeroL3=TRUE) # # for models 4-11 maximum number of iterations is set to 2 # # Model 5: BivPoisson(l1=full, l2=full, l3=constant) ex1.m5<-lm.bp(x~. , y~. , data=ex1.sim, maxit=2) # Model 6: DblPois(l1,l2) ex1.m6<-lm.bp(x~z1 , y~z1+z5 , l1l2=~z3, data=ex1.sim, zeroL3=TRUE) # Model 7: BivPois(l1,l2,l3=constant) ex1.m7<-lm.bp(x~z1 , y~z1+z5 , l1l2=~z3, data=ex1.sim, maxit=2) # Model 8: BivPoisson(l1=full, l2=full, l3=full) ex1.m8<-lm.bp(x~. , y~. , l3=~., data=ex1.sim, maxit=2) # Model 9: BivPoisson(l1=full, l2=full, l3=z1+z2+z3+z4) ex1.m9<-lm.bp(x~. , y~. , l3=~.-z5, data=ex1.sim, maxit=2) # Model 10: BivPoisson(l1, l2, l3=full) ex1.m10<-lm.bp(x~z1 , y~z1+z5 , l1l2=~z3, l3=~., data=ex1.sim, maxit=2) # Model 11: BivPoisson(l1, l2, l3= z1+z2+z3+z4) ex1.m11<-lm.bp(x~z1 , y~z1+z5 , l1l2=~z3, l3=~.-z5, data=ex1.sim, maxit=2)