Skip to content

Commit

Permalink
Fix for NAs in matrix outcomes built with cbind() in formula
Browse files Browse the repository at this point in the history
  • Loading branch information
chjackson committed Feb 9, 2024
1 parent 5ae7f62 commit b4f3c6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/msm.R
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@
#' weights to apply to each subject in the data
#' when calculating the log-likelihood as a weighted sum over
#' subjects. These are taken from the first observation for each
#' person, and any weights supplied for subsequent observations are
#' subject, and any weights supplied for subsequent observations are
#' not used.
#'
#' Weights at the observation level are not supported.
Expand Down Expand Up @@ -951,6 +951,7 @@ msm <- function(formula, subject=NULL, data=list(), qmatrix, gen.inits=FALSE,
indx <- match(c("formula", "data"), names(call), nomatch = 0)
temp <- call[c(1, indx)]
temp[[1]] <- as.name("model.frame")
temp$na.action <- na.pass
mfst <- eval(temp, parent.frame())
if (is.matrix(mfst[[1]]) && !is.matrix(mf$"(state)"))
mf$"(state)" <- mfst[[1]]
Expand Down

0 comments on commit b4f3c6a

Please sign in to comment.