From ce61b8ac79852e5c244a25537d2cd311ab90fcdb Mon Sep 17 00:00:00 2001 From: ecmerkle Date: Mon, 21 Aug 2023 11:34:59 -0500 Subject: [PATCH] fix lv extraction for unequal numbers of level 1 & level 2 variables --- DESCRIPTION | 2 +- R/lvgqs.R | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index b6e1576b..44b3c4ed 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blavaan Title: Bayesian Latent Variable Analysis -Version: 0.4-9.1147 +Version: 0.4-9.1148 Authors@R: c(person(given = "Edgar", family = "Merkle", role = c("aut", "cre"), email = "merklee@missouri.edu", diff --git a/R/lvgqs.R b/R/lvgqs.R index 3fc5627e..3210aee9 100644 --- a/R/lvgqs.R +++ b/R/lvgqs.R @@ -300,6 +300,8 @@ samp_lvs_2lev <- function(mcobj, lavmodel, lavsamplestats, lavdata, lavpartable, standata$startrow <- c(1, standata$endrow[-length(standata$endrow)] + 1) standata$YX <- cbind(clusmns, matrix(0, nrow(clusmns), 2)) standata$Ntot <- sum(standata$nclus[,2]) + standata$Nobs <- with(standata, N_between + N_both) + standata$Obsvar <- with(standata, matrix(1:standata$Nobs, Np, N_between + N_both, byrow = TRUE)) tmpmat2[j,,] <- lvgqs(modmat2, standata) ## now level 1