Skip to content

Commit 81879ef

Browse files
committed
adjust MG-CFA compRelSEM() output
1 parent 32fd547 commit 81879ef

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

semTools/R/reliability.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,10 +1683,10 @@ compRelSEM <- function(object, W = NULL,
16831683
class(REL) <- c("lavaan.vector","numeric")
16841684

16851685
} else {
1686-
## Multiple indices per composite, so a multiple-group model.
1686+
## Multiple indices per composite, so a multiple-group model
16871687

16881688
## Check the indices have the same (group) names.
1689-
## NOTE: The same composite name NEVER yields level-specific coefficients.
1689+
## NOTE: The same composite name NEVER yields level-specific coefficients
16901690
nameList <- lapply(rel, names)
16911691
sameNames <- all(sapply(2:length(nameList), function(i) {
16921692
isTRUE(all.equal(nameList[[1]], nameList[[i]]))
@@ -1701,9 +1701,8 @@ compRelSEM <- function(object, W = NULL,
17011701
attr(REL[[i]], "header") <- NULL
17021702
} else simplify <- FALSE
17031703
}
1704-
1705-
#TODO: verify this preserves row/colnames
1706-
REL <- as.data.frame(do.call(rbind, rel)) # drops header (can replace below)
1704+
## bind composites into rows (groups in columns)
1705+
REL <- as.data.frame(do.call(cbind, rel)) # drops header (can replace below)
17071706
class(REL) <- c("lavaan.data.frame","data.frame")
17081707
}
17091708

semTools/man/compRelSEM.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)