Skip to content

Commit

Permalink
turn off ppp for 2-level models with within-only ovs
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmerkle committed Jan 5, 2024
1 parent 604e8ef commit af9fa41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: blavaan
Title: Bayesian Latent Variable Analysis
Version: 0.5-2.1211
Version: 0.5-2.1217
Authors@R: c(person(given = "Edgar", family = "Merkle",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
11 changes: 10 additions & 1 deletion R/blavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,15 @@ blavaan <- function(..., # default lavaan arguments
}

# for initial values/some parameter setup:
if(lavInspect(LAV, 'nlevels') > 1){
# ppp for within-only ovs turned off because saturated lik doesn't work
if(length(LAV@Data@Lp[[1]]$within.idx[[1]]) > 0){
origtest <- "none"
dotdotdot$test <- "none"
cat('blavaan NOTE: ppp is currently unavailable for models with within-only ovs')
}
}

if(jag.do.fit){
LAV2 <- try(do.call("lavaan", dotdotdot), silent = TRUE)
if(!inherits(LAV2, 'try-error')) LAV <- LAV2
Expand Down Expand Up @@ -476,7 +485,7 @@ blavaan <- function(..., # default lavaan arguments
lavoptions$estimator <- "Bayes"
lavoptions$se <- "standard"
lavoptions$test <- "standard"
if("test" %in% dotNames) {
if("test" %in% names(dotdotdot)) {
if(dotdotdot$test == "none") lavoptions$test <- "none"
} else {
# if missing data, posterior predictives are way slow
Expand Down

0 comments on commit af9fa41

Please sign in to comment.