diff --git a/DESCRIPTION b/DESCRIPTION index 15410bff..e59fcac2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blavaan Title: Bayesian Latent Variable Analysis -Version: 0.5-3.1256 +Version: 0.5-3.1261 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 58e54a65..67b38603 100644 --- a/R/lvgqs.R +++ b/R/lvgqs.R @@ -320,7 +320,9 @@ samp_lvs_2lev <- function(mcobj, lavmodel, lavsamplestats, lavdata, lavpartable, standata$Ntot <- sum(standata$nclus[,2]) standata$Nobs <- with(standata, rep(N_between + N_both, Np)) standata$Obsvar <- with(standata, matrix(1:standata$Nobs[1], Np, N_between + N_both, byrow = TRUE)) - tmpmat2[j,,] <- lvgqs(modmat2, standata, eeta[2*(1:standata$Ng)]) + if (standata$m > 0) { + tmpmat2[j,,] <- lvgqs(modmat2, standata, eeta[2*(1:standata$Ng)]) + } ## now level 1 standata <- stanorig @@ -331,7 +333,9 @@ samp_lvs_2lev <- function(mcobj, lavmodel, lavsamplestats, lavdata, lavpartable, if(!("beta" %in% names(modmat1[[g]]))) modmat1[[g]]$beta <- matrix(0, standata$m, standata$m) } - tmpmat[j,,] <- lvgqs(modmat1, standata, eeta[2 * (1:standata$Ng) - 1]) + if (standata$m > 0) { + tmpmat[j,,] <- lvgqs(modmat1, standata, eeta[2 * (1:standata$Ng) - 1]) + } } list(tmpmat, tmpmat2)}) if(!debug) {