gen_mixed | R Documentation |
Generate multi-normal sample and segment it into ordinal.
gen_mixed(n, R, indc, thresholds)
n |
the sample size. |
R |
the correlation coefficient matrix. |
indc |
vector to indicate whether variables are continuous or categorical. |
thresholds |
list contains thresholds for ordinal variables |
latent |
the original normal data. |
observed |
the observed ordinal data. |
library(mvtnorm)
set.seed(1997)
R1 = gen_CCM(6)
n = 1000
indc = 4:6
thresholds = list(
c(),
c(),
c(),
c(0),
c(-0.5,0),
c(0,0.5)
)
data1 = gen_mixed(n,R1,indc,thresholds)$observed
data1 = data.frame(data1)
table(data1$X4,data1$X5)
table(data1$X5,data1$X6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.