mle.fun
,
mle.ar1.fun
, mle.a3.fun
and mle.ar1.non3
.lmNB
allows
three scenarios:
(1) The log-normal distribution with E(G_i)=1 and Var(G_i)=theta
(2) The gamma distribution with E(G_i)=1 and Var(G_i)=theta.
(3) No distributional assumption and the random effect distribution is approximated by the estimated values of the quantity:
gamma_i = w_i (y_i+/ mu_i+) + (1-w_i) , i=1,...,N,
where
y_i+ = sum_j=1^n_i y_ij,
mu_i+ = sum_j=1^n_i mu_ij and,
w_i = sqrt( Var(G_i)/Var(Y_i+/mu_i+) ).
See Zhao et al. for more details.lmeNB(formula,data,ID,p.ini=NULL,IPRT=FALSE,AR=FALSE,RE=c("G","N","semipara"),
deps=0.001,Vcode,i.tol=1e-75,o.tol=1.e-3,maxit=100)
as.data.frame
to a data frame) containing the variables in the model.
Each row must contain the data corresponding to the repeated measure j of a subject and the rows (i,j)c(rep(ID_1,n_1),rep(ID_2,n_2),...,rep(ID_N,n_N))
.
The length must be the same as the number of rows of data
. Missing values are NOT accepted.AR=0
and (RE="G"
or RE="N"
),p.ini
=(log(a), log(var(G)), beta0, beta1, ...).
If AR=0
and RE="semipara"
, optim
.
If TRUE
then print iterations.TRUE
, then the AR(1) structure is assumed among the responses.model="G"
then the random effects are assumed to be from the gamma distribution.
If model="N" then they are assumed to be form the log-normal distribution.integrate
.
Necessary only for semiparametric random effect model.optim
.
Necessary only for semiparametric random effect model.optim
.opt$par
V
=solve(opt$hessian)
sqrt(diag(V))
model="G"
then mod="G"
.
If model="N"
then mod="N"
."ind"
, indicating that the model assumes independent structure of the count responses given the random effects.mle.fun
calls optim
to minimize the negative log-likelihood of the negative binomial model with respect to the model parameters: c(log(a), log(theta), beta0, beta1, ...).The Nelder-Mead algorithm is employed.The log-likelihood is obtained by marginalizing out the random effects.The numerical integration is carried out using adaptive quadrature.The missing count responses, if assumed to be missing at random, can be ignored.Other types of missing data are currently not accepted.
When the estimated over-dispersion parameter (a) is close to zero, the negative binomial model reduces to the poisson model, suggesting that the negative binomial mixed-effect model might not be appropriate.When AR
=1 and the estimated auto-correlation parameter (d) is close to zero, the model is suggesting that there is no AR(1) structure among the sequentially collected responses. Hence user might use AR
=0 setting which assume no AR(1) structure.We note that the results could be sensitive to initial values.
mle.fun
,
mle.ar1.fun
,
mle.a3.fun
,
mle.ar1.non3
,The subroutines of index.batch
to compute the conditional probability index:
jCP.ar1
,
CP1.ar1
,
MCCP.ar1
,
CP.ar1.se
,
CP.se
,
jCP
,
The functions to generate simulated datasets:
rNBME.R
.
## See the examples in help files of rNBME.R.
Run the code above in your browser using DataLab