| ex4.ita91 {bivpois} | R Documentation |
Italian Serie A football scores for season 1991-92.
data(ex4.ita91)
A data frame with 306 observations on the following 4 variables.
Ascoli Atalanta Bari Cagliari Cremonese Fiorentina Foggia Genoa Inter Juventus Lazio Milan Napoli Parma Roma Sampdoria Torino Verona Ascoli Atalanta Bari Cagliari Cremonese Fiorentina Foggia Genoa Inter Juventus Lazio Milan Napoli Parma Roma Sampdoria Torino Verona Data were originally used in Karlis and Ntzoufras (2003). The data consist of pairs of counts indicating the number of goals scored by each of the two competing teams. As covariates we have used dummy variables to model the team strength. In modelling outcomes of football games, it has been observed an excess of draws and small over-dispersion. Introducing diagonal inflated models we correct for both the over-dispersion and the excess of draws.
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.
Karlis, D. and Ntzoufras, I. (2004). Bivariate Poisson and Diagonal Inflated Bivariate Poisson Regression Models in S. (submitted). Technical Report, Department of Statistics, Athens University of Economics and Business, Athens, Greece.
library(bivpois) # loading of bivpois library
data(ex4.ita91) # loading ex4.ita91 data from bivpois library
#
# formula for modeling of lambda1 and lambda2
form1 <- y1y2~noncommon+c(team1,team2)+c(team2,team1)
#
# Model 1: Double Poisson
ex4.m1<-lm.bp( 'g1', 'g2', form1, zeroL3=TRUE, data=ex4.ita91)
#
# Models 2-5: bivariate Poisson models
ex4.m2<-lm.bp('g1','g2', form1, data=ex4.ita91)
ex4.m3<-lm.bp('g1','g2', form1, y3~team1, data=ex4.ita91)
ex4.m4<-lm.bp('g1','g2', form1, y3~team2, data=ex4.ita91)
ex4.m5<-lm.bp('g1','g2', form1, y3~team1+team2, data=ex4.ita91)
#
# Model 6: Zero Inflated Model
ex4.m6 <-lm.dibp('g1','g2', form1, data=ex4.ita91, jmax=0)
#
# Models 7-11: Diagonal Inflated Bivariate Poisson Models
ex4.m7 <-lm.dibp('g1','g2',form1, data=ex4.ita91, distribution='geometric' )
ex4.m8 <-lm.dibp('g1','g2', form1, data=ex4.ita91, jmax=1)
ex4.m9 <-lm.dibp('g1','g2', form1, data=ex4.ita91, jmax=2)
ex4.m10<-lm.dibp('g1','g2', form1, data=ex4.ita91, jmax=3)
ex4.m11<-lm.dibp('g1','g2', form1, data=ex4.ita91, distribution='poisson' )
#
# Models 12: Diagonal Inflated Double Poisson Model
ex4.m12 <- lm.dibp( 'g1', 'g2', form1, data=ex4.ita91, distribution='poisson', zeroL3=TRUE )
# --------------------------------------------------------------------------
# monitoring parameters for model 8: Biv Poisson with Dis(1) diagonal distribution
#
#
ex4.m8$diagonal.distribution # printing details for the diagonal distribution
round(ex4.m8$beta1,2) # model parameters for lambda1
round(ex4.m8$beta2[1],2) # Intercept for lambda2.
round(ex4.m8$beta2[1]-ex4.m8$beta2[2],2)# estimated home effect
#
# estimating the effect for 18th level of attack (team1.team2) [Verona]
round(-sum(ex4.m8$beta[ 2:18]),2)
# estimating the effect for 18th level of defence(team2.team1) [Verona]
round(-sum(ex4.m8$beta[19:35]),2)
#
ex4.m8$beta3 # parameters for lambda3 (here the intercept)
exp(ex4.m8$beta3) # lambda3 (here constant)
ex4.m8$p # mixing proportion
ex4.m8$theta # printing theta parameters