rNBME_R: Simulate a dataset from the negative binomial mixed-effect...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function simulates a dataset based on the negative binomial mixed-effect independent/AR(1) model with two treatment groups described in Zhao et al (2013). The group mean can be different at each time point, but no other covariates are allowed. See fitParaIND, fitParaAR1 for details of the model explanations.

Usage

1
2
3
4
5
rNBME.R(
	gdist = "G", n = 200, sn = 5, th = exp(1.3), 
	u1 = rep(1.5, 5), u2 = rep(1.5, 5), 
	a = exp(-0.5),d=NULL,  othrp = list(u.n = 3, s.n = 0.5, p.mx = 0.05, sh.mx = NA)
	)

Arguments

gdist

The distribution of the random effect term G[i].

If gdist="G", G[i] is from the gamma distribution.

If gdist="N", G[i] is from the log normal distribution.

If gdist="U", G[i] (on the log scale) is from the uniform distribution.

If gdist="GN", G[i] is from the mixture of the gamma distribution and the normal distribution.

If the generated values are negative, they are truncated to zero.

If gdist="NoN", G[i] is sampled from the pre-specified vector othrp with replacement.

n

The number of patients. It must be an even number.

sn

The number of repeated measures per patient. Generated datasets are balanced design.

th

If gdist="G", th is a scale parameter of the gamma distribution.

If gdist="N" or gdist=="U", th is Var(G[i]).

If gdist="GN", see details.

If gdist="NoN", this parameter is not used.

u1

A vector of length sn, specifying the mean of the treatment group 1 E(Y[ij]) = u1[j].

u2

A vector of length sn, specifying the mean of the treatment group 2 E(Y[ij]) = u2[j].

a

The dispersion parameter α of the negative binomial mixed-effect independent model. See description in lmeNB.

d

If d=NULL, generate data from the independent model. If d is a scalar between 0 and 1, then d is delta in the AR(1) model, and generate datasets from the AR(1) model.

othrp

If gdist="GN", parameters for the GN option. See details. If gdist="NoN", othrp is a vector, containing a sample of G[i], which is treated as a population and G[i] is resampled.

Details

The generated datasets have equal number of scans per person. The number of patients in the two groups are the same. If gdist=="GN", datasets are generated from:

othrp$p.mx*N(mean=othrp$u.n,s.d=othrp$s.n) + (1-othrp$p.mx)*gamma(scale=th,shape), where shape of the gamma distribution is chosen to ensure E(G[i])=1.

Value

id

The vector of length n*sn containing patient IDs: rep(1:n,each=sn)

vn

The vector of length n*sn containing the indicies of time points: rep(1:sn, n)

gp

The vector of length n*sn containing the indicies of the treatment groups

y

The vector of length n*sn containing generated response counts

g

The vector of length n*sn containing generated random effect terms

Gpara

The record of the distribution and parameter specifications used to generate the dataset

Author(s)

Zhao, Y. and Kondo, Y.

References

Detection of unusual increases in MRI lesion counts in individual multiple sclerosis patients. (2013) Zhao, Y., Li, D.K.B., Petkau, A.J., Riddehough, A., Traboulsee, A., Journal of the American Statistical Association.

See Also

The main function to fit the Negative Binomial mixed-effect model: lmeNB,

The functions to fit related models: fitParaIND, fitParaAR1, fitSemiIND, fitSemiAR1,

The subroutines of index.batch to compute the conditional probability index: jCP.ar1, CP1.ar1, MCCP.ar1, CP.ar1.se, CP.se, jCP,

Examples

1
2
3
4
5
## Not run: 
## See the examples in help files of fitParaIND, fitParaAR1, fitSemiIND, fitSemiAR1 and lmeNB


## End(Not run)

lmeNB documentation built on May 2, 2019, 3:34 p.m.

Related to rNBME_R in lmeNB...