| multinom.gen {CorrBin} | R Documentation |
Functions for generating multinomial outcomes
Description
These are built-in functions to be used by ran.CMData for generating
random multinomial data.
Usage
mg.Resample(n, clustersizes, param)
mg.DirMult(n, clustersizes, param)
mg.LogitNorm(n, clustersizes, param)
mg.MixMult(n, clustersizes, param)
Arguments
n |
number of independent clusters to generate |
clustersizes |
an integer vector specifying the sizes of the clusters |
param |
a list of parameters for each specific generator |
Details
For mg.Resample: the param list should be list(param=...), in which
the CMData object to be resampled is passed.
For mg.DirMult: the param list should be list(shape=...), in which
the parameter vector of the Dirichlet distribution is passed
(see rdirichlet).
For mg.LogitNorm: the param list should be list(mu=...,sigma=...),
in which the mean vector and covariance matrix of the underlying Normal distribution
are passed. If sigma is NULL (or missing), then an identity matrix is assumed.
They should have K-1 dimensions for a K-variate multinomial.
For mg.MixMult: the param list should be list(q=...,m=...),
in which the vector of mixture probabilities q and the matrix m
of logit-transformed means of each component are passed.
For a K-variate multinomial, the matrixm should have K-1 columns
and length(q) rows.