# \donttest{
## Example using a Negative Binomial model
data("washington_roads")
washington_roads$AADTover10k <- ifelse(washington_roads$AADT>10000,1,0)
nb_model <- countreg(Total_crashes ~ lnaadt + lnlength + speed50 +
ShouldWidth04 + AADTover10k,
data = washington_roads, family = 'nb2',
method = 'NM', max.iters = 500)
# 1. Plot against fitted values (default) with confidence bands
cureplot(nb_model, n_resamples = 20)
# 2. Plot against a specific covariate (e.g., lnlength)
cureplot(nb_model, indvar = "lnlength", n_resamples = 20)
# }
Run the code above in your browser using DataLab