example/real-data.R

library(exactICLforLCA)
library(BayesLCA)

# Read data
data(Alzheimer)

## set CONSTANTS
alpha_var <- 1
beta_var <- 1
delta_var <- 1
G <- as.integer(readline(prompt="Enter the number of groups: "))


# LCA fit
fit <- blca.em(Alzheimer, G)
Z <- unMAP(MAP(Zscore(Alzheimer, fit)))

Y <- as.matrix(Alzheimer)

res <- ICLFit(Z, Y, G, alpha_var, beta_var, delta_var)
ICLsummary()
Manasimohan/exactICLforLCA documentation built on Sept. 7, 2020, 12:13 p.m.