Description Usage Arguments Details Value Author(s) References See Also Examples
nb1_syn is a generic function for developing synthetic NB1 data and a model given user defined specifications.
1 |
nobs |
number of observations in model, Default is 50000 |
delta |
NB1 heterogeneity or ancillary parameter |
xv |
predictor coefficient values. First argument is intercept. Use as xv = c(intercept , x1_coef, x2_coef, ...) |
Create a synthetic linear negative binomial (NB1) regression model using the appropriate arguments. Model data with predictors indicated as a group with a period (.). See examples.
Data can be modeled using the ml.nb1.r function in the COUNT package, or by using the gamlss function in the gamlss package, using the "family=NBII" option.
nb1y |
Negative binomial (NB1) response; number of counts |
sim.data |
synthetic data set |
Joseph M. Hilbe, Arizona State University, and Jet Propulsion Laboratory, California Institute of Technology Andrew Robinson, Universty of Melbourne, Australia.
Hilbe, J.M. (2011), Negative Binomial Regression, second edition, Cambridge University Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | sim.data <- nb1_syn(nobs = 5000, delta = .5, xv = c(.5, 1.25, -1.5))
mynb1 <- ml.nb1(nb1y ~ . , data = sim.data)
mynb1
## Not run:
# use gamlss to model NB1 data
library(gamlss)
sim.data <- nb1_syn(nobs = 5000, delta = .5, xv = c(.5, 1.25, -1.5))
mynb1 <- gamlss( nb1y ~ . , family=NBII, data = sim.data)
mynb1
## End(Not run)
## Not run:
# default
sim.data <- nb1_syn()
dnb1 <- ml.nb1(nb1y ~ . , data = sim.data)
dnb1
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.