Skip to content

Commit

Permalink
fix robust fit measures (rmsea/cfi/tli) + rotation (lav_object_catml)
Browse files Browse the repository at this point in the history
  • Loading branch information
yrosseel committed Aug 22, 2024
1 parent 56b8a11 commit 6e88668
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: lavaan
Title: Latent Variable Analysis
Version: 0.6-19.2180
Version: 0.6-19.2184
Authors@R: c(person(given = "Yves", family = "Rosseel",
role = c("aut", "cre"),
email = "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions R/lav_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ lavData <- function(data = NULL, # data.frame

# allow empty categories of ordinal variable
allow.empty.cell <- lavoptions$allow.empty.cell

# block.labels
block.label <- character(0L)
if (length(group.label) > 0L && length(level.label) == 0L) {
Expand Down Expand Up @@ -559,7 +559,7 @@ lav_data_full <- function(data = NULL, # data.frame

# ensure allow.empty.cell is logical
if (is.null(allow.empty.cell)) allow.empty.cell <- FALSE

# sampling weights
if (!is.null(sampling.weights)) {
if (is.character(sampling.weights)) {
Expand Down
4 changes: 3 additions & 1 deletion R/lav_lavaan_step17_lavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ lav_lavaan_step17_lavaan <- function(lavmc = NULL,
cat(" done.\n")
}
lavaan@ParTable$est.std <- std$est.std
lavaan@ParTable$se.std <- std$se
if (!is.null(std$se)) {
lavaan@ParTable$se.std <- std$se
}
}

# post-fitting check of parameters
Expand Down
13 changes: 12 additions & 1 deletion R/lav_object_generate.R
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ lav_object_catml <- function(lavobject = NULL) {
partable.catml <- parTable(lavobject)
rm.idx <- which(partable.catml$op %in% c("|", "~1"))
partable.catml <- partable.catml[-rm.idx, ]
# never rotate (new in 0.6-19), as we only need fit measures
if (!is.null(partable.catml$efa)) {
partable.catml$efa <- NULL
partable.catml$free <- partable.catml$free.unrotated
}
partable.catml <- lav_partable_complete(partable.catml)
} else {
refit <- TRUE
Expand All @@ -402,6 +407,11 @@ lav_object_catml <- function(lavobject = NULL) {
partable.catml$se <- NULL
rm.idx <- which(partable.catml$op %in% c("|", "~1"))
partable.catml <- partable.catml[-rm.idx, ]
# never rotate (new in 0.6-19), as we only need fit measures
if (!is.null(partable.catml$efa)) {
partable.catml$efa <- NULL
partable.catml$free <- partable.catml$free.unrotated
}
partable.catml$ustart <- partable.catml$est
for (b in seq_len(lavpta$nblocks)) {
ov.names.num <- lavpta$vnames$ov.num[[b]]
Expand Down Expand Up @@ -464,7 +474,8 @@ lav_object_catml <- function(lavobject = NULL) {
lavoptions$h1.information <- c("structured", "structured") # unlike DWLS
lavoptions$se <- "none"
lavoptions$test <- "standard" # always for now
lavoptions$baseline <- TRUE
lavoptions$rotation <- "none" # new in 0.6-19
lavoptions$baseline <- TRUE # also for RMSEA?
if (!refit) {
lavoptions$optim.method <- "none"
lavoptions$optim.force.converged <- TRUE
Expand Down

0 comments on commit 6e88668

Please sign in to comment.