gen_mixed {MCCM}R Documentation

Continuous and Ordinal Simulated Data

Description

Generate multi-normal sample and segment it into ordinal.

Usage

gen_mixed(n, R, indc, thresholds)

Arguments

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

Value

latent

the original normal data.

observed

the observed ordinal data.

Examples

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)

[Package MCCM version 0.1.0 Index]