ex4.ita91{bivpois}

R Documentation

Bivpois Example 4 Dataset: Italian Series A Football Scores for Season 1991-92

Description

Italian Serie A football scores for season 1991-92.

Usage

data(ex4.ita91)

Format

Dataframe with four variables of length 306.

No

Name

Description

1

g1

Goals scored by the home team

2

g1

Goals scored by the away team

3

team1

Categorical variable indicating the home team.  (1): Ascoli, (2):Atalanta,   (3):Bari, (4):Cagliari, (5):Cremonese, (6):Fiorentina, (7):Foggia, (8):Genoa, (9):Inter, (10):Juventus, (11):Lazio, (12):Milan, (13):Napoli, (14):Parma, (15): Roma, (16):Sampdoria, (17):Torino, (18):Verona

4

team2

Categorical variable indicating the away team. Level codes are defined as in team1.

Details

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.

References

1.      Karlis, D. and Ntzoufras, I. (2004). Bivariate Poisson and Diagonal Inflated Bivariate Poisson Regression Models in S. (submitted). Technical Report, Athens University of Economics and Business, Athens, Greece.

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.

See Also

pbivpois,  simple.bp , lm.bp, lm.dibp , ex1.sim ,  ex2.sim , ex3health .

Examples

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=T, 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=T )
# --------------------------------------------------------------------------
# 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
 
 

[Package Contents]