genPoisNor {PoisNor} | R Documentation |
Generates a data set with Poisson and normal variables
Description
The function simulates multivariate data with Poisson and normal components with a pre-specified correlation matrix and marginal distributions.
Usage
genPoisNor(n, no.norm, no.pois, cmat.star, lamvec, sd.vec, mean.vec)
Arguments
n |
Number of rows |
no.pois |
Number of Poisson variables. |
no.norm |
Number of normal variables. |
cmat.star |
The intermediate correlation matrix obtained from |
lamvec |
A vector of marginal rates for Poisson variables. |
mean.vec |
A vector of means for the normal variables. |
sd.vec |
A vector of standard deviations for the normal variables. |
Value
A matrix of size n \times (no.pois + no.norm)
, of which first no.pois
are Poisson variables.
Examples
## Not run:
lamvec= c(0.05,0.07,0.09)
M=c(0.352, 0.265, 0.342, 0.09, 0.141, 0.121, 0.297,
-0.022, 0.177, 0.294, -0.044, 0.129, 0.1, 0.354, 0.386)
N=diag(6)
N[lower.tri(N)]=M
TV=N+t(N)
diag(TV)<-1
cstar = cmat.star(no.pois=3, no.norm=3, TV, lamvec)
mydata=genPoisNor(n=200, no.norm=3, no.pois=3, cmat.star=cstar,
lamvec, sd.vec=c(1,1,1), mean.vec=c(0,0,0))
## End(Not run)
[Package PoisNor version 1.3.3 Index]