gm.generate {gmvalid} | R Documentation |
Generates a random data frame of independent binary variables with given marginals.
gm.generate(N, p = c(0.5, 0.5, 0.5))
N |
Number of observations, sample size. |
p |
Probability vector. Each element assigns the probability to draw a "2". The user-defined number of elements determines the number of variables in the resulting data frame. |
A data frame with number of rows equal to N
and number of columns equal to the length of p
.
Ronja Foraita, Fabian Sobotka
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de
gm.modelsim
, gm.sim.ixj
, r2dtable
gm.generate(10,c(.5,.2,.2)) gm.generate(15,c(.5,.5,.5,.5,.5,.5))