gm.sim.ixj {gmvalid} | R Documentation |
Generates random (i x j)-way dependency tables with given marginals.
gm.sim.ixj(N, pa, pb)
N |
Number of observations; sample size. |
pa |
Weight vector of length i to assign the distribution of the row totals. |
pb |
Weight vector of length j to assign the distribution of the column totals. |
A (i x j)-matrix.
Observed totals that were generated according to the shorter weight vector reflect the given weights only approximatively.
Ronja Foraita, Fabian Sobotka
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de
gm.generate
, gm.modelsim
, r2dtable
gm.sim.ixj(1000,c(1,1,1),c(1,1,1,1,1)) gm.sim.ixj(1000,c(.2,.3,.4,.1),c(.5,.2,.3)) round(gm.sim.ixj(30,c(1,1),c(1,1))) tab <- round(gm.sim.ixj(500,c(.5,.5),c(.5,.5))) chisq.test(tab)