Generating Multivariate Negative Binomial Data
It simulates a multivariate response variable, Y_ij, that is jth measurement taken on the ith subject or cluster, i = 1,...,n and j= 1,...,mi.
rMNB(n, mi, formula, p.fix)
n
: Length of the sample.mi
: replicates on the ith subject or cluster.formula
: The structure matrix of covariates of dimension n x p (in models that include an intercept x should contain a column of ones)p.fix
: Vector of theoretical regression parameters of length p.Generated response (Y_ij)
n <- 100 mi <- 3 x1 <- rep(rnorm(n,0,1),each=mi) x2 <- rep(c(0,1),each=150) p.fix <- c(10,2.0,0.5,1) #generating a sample sample.ex <- rMNB(n=n,mi=mi,formula=~x1+x2, p.fix=p.fix) head(sample.ex)
Jalmar M F Carrasco carrascojalmar@gmail.com, Cristian M Villegas Lobos master.villegas@gmail.com and Lizandra C Fabio lizandrafabio@gmail.com
Useful links