## Simulate data
n <- 100
set.seed(123)
x <- sample(0:2, n, TRUE)
y <- sample(0:3, n, TRUE)
z <- sample(0:1, n, TRUE)
dat <- cbind(x,y,z)
## Analyze data
gSquareDis(1,3,2,dat,nlev = c(3,4,2))
gSquareDis(1,3,2,dat,nlev = c(3,4,2), verbose=TRUE, adaptDF=TRUE)
suffStat <- list(dm = dat, nlev = c(3,4,2), adaptDF = FALSE)
disCItest(1,3,2,suffStat)
Run the code above in your browser using DataLab