From dad2e8d19f4b63da46ffd10948af312b4f0d8edb Mon Sep 17 00:00:00 2001 From: ecmerkle Date: Sun, 4 Aug 2024 12:48:17 -0500 Subject: [PATCH] change how we compute the number of levels of each ordinal variable --- DESCRIPTION | 2 +- R/lav_export_stanmarg.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b03b8cf5..308c43e4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blavaan Title: Bayesian Latent Variable Analysis -Version: 0.5-5.1291 +Version: 0.5-5.1292 Authors@R: c(person(given = "Edgar", family = "Merkle", role = c("aut", "cre"), email = "merklee@missouri.edu", diff --git a/R/lav_export_stanmarg.R b/R/lav_export_stanmarg.R index 27af9471..e1bb4edd 100644 --- a/R/lav_export_stanmarg.R +++ b/R/lav_export_stanmarg.R @@ -1391,7 +1391,7 @@ lav2standata <- function(lavobject, dosam = FALSE) { for(i in 1:length(ordidx)){ ordvar <- unlist(lapply(lavobject@Data@X, function(x) x[,ordidx[i]])) ordvar <- ordvar[!is.na(ordvar)] - nlevs[i] <- length(unique(ordvar)) + nlevs[i] <- max(ordvar) #length(unique(ordvar)) } maxcat <- max(nlevs)