Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/atlas-aai/dcm.m2
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyCHoover committed Mar 20, 2023
2 parents 9e8230a + 0f2f368 commit 9bb4be9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/data-checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ check_pi_matrix <- function(pi_matrix, qmatrix) {

check_qmatrix <- function(qmatrix, pi_matrix) {
if (!is.data.frame(qmatrix)) {
stop("`pi_matrix` must be a data frame.",
stop("`qmatrix` must be a data frame.",
call. = FALSE)
}

Expand Down
3 changes: 2 additions & 1 deletion R/m2.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ calc_m2 <- function(data, struc_params, pi_matrix, qmatrix, ci = 0.9,
rep(2, nrow(qmatrix))
} else if (model_type %in% c("LCDM", "GDINA")) {
qmatrix %>%
modelr::model_matrix(stats::as.formula(paste0("~ .^", ncol(.)))) %>%
modelr::model_matrix(stats::as.formula(paste0("~ .^",
max(ncol(.), 2)))) %>%
dplyr::mutate(total_params = rowSums(.)) %>%
dplyr::pull("total_params")
} else if (model_type %in% c("ACDM", "LLM", "RRUM")) {
Expand Down

0 comments on commit 9bb4be9

Please sign in to comment.