# Comparing the NBP model with the NB2 and NB1 models
data("washington_roads")
washington_roads$AADTover10k <- ifelse(washington_roads$AADT>10000,1,0)
nb.1 <- countreg(Total_crashes ~ lnaadt + lnlength + speed50 +
ShouldWidth04 + AADTover10k,
data=washington_roads, family = 'NB1', method = 'NM')
nb.2 <- countreg(Total_crashes ~ lnaadt + lnlength + speed50 +
ShouldWidth04 + AADTover10k,
data=washington_roads, family = 'NB2', method = 'NM')
nb.p <- countreg(Total_crashes ~ lnaadt + lnlength + speed50 +
ShouldWidth04 + AADTover10k,
data=washington_roads, family = 'NBP', method = 'NM')
comptable <-
regCompTable(list("NB-1"=nb.1, "NB-2"=nb.2, "NB-P"=nb.p), tableType="latex")
print(comptable)
Run the code above in your browser using DataLab