Skip to content

Commit

Permalink
Merge pull request #370 from TDJorgensen/add_h1
Browse files Browse the repository at this point in the history
avoid scaled-LRT error when object's df==0
  • Loading branch information
yrosseel authored Aug 1, 2024
2 parents bbfdc33 + 9949edf commit 842f52b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/lav_test_LRT.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ lavTestLRT <- function(object, ..., method = "default", test = "default",
scaled <- TRUE
# which test to choose by default?
# i.e., not determined by method=
scaledList <- sapply(object@test, function(x) !is.null(x$scaled.test.stat))
scaledList <- sapply(mods[[ which(ndf > 0)[1] ]]@test, # first mod with df>0
#FIXME? If no mods have df > 0, this still yields error
function(x) !is.null(x$scaled.test.stat))
scaled.idx <- which(scaledList)[[1]]
default.TEST <- object@test[[scaled.idx]]$test
if (test == "default") {
Expand Down

0 comments on commit 842f52b

Please sign in to comment.