Skip to content

Commit

Permalink
possibly addressing #74: for two-level models, loudly use listwise de…
Browse files Browse the repository at this point in the history
…letion when missing data are encountered
  • Loading branch information
ecmerkle committed Mar 29, 2024
1 parent dcb5abd commit 5ee7510
Show file tree
Hide file tree
Showing 2 changed files with 10 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-3.1251
Version: 0.5-3.1253
Authors@R: c(person(given = "Edgar", family = "Merkle",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
10 changes: 9 additions & 1 deletion R/blavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,15 @@ blavaan <- function(..., # default lavaan arguments
dotdotdot$do.fit <- TRUE; dotdotdot$warn <- FALSE
if(LAV@Data@data.type != "moment" && target == "stan"){
## if no missing, set missing = "listwise" to avoid meanstructure if possible
if(!any(is.na(unlist(lavInspect(LAV, 'data'))))) dotdotdot$missing <- "listwise"
if(!any(is.na(unlist(lavInspect(LAV, 'data'))))){
dotdotdot$missing <- "listwise"
} else {
if("cluster" %in% dotNames) {
## set missing = "listwise" for two-level models
dotdotdot$missing <- "listwise"
cat("blavaan NOTE: for two-level models, listwise deletion is currently the only missingness option.\n\n")
}
}
}

# for initial values/some parameter setup:
Expand Down

0 comments on commit 5ee7510

Please sign in to comment.