Skip to content

Commit

Permalink
Better error message for random effects formula issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkellner committed Sep 26, 2024
1 parent 6048def commit 546f443
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/mixedModelTools.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ check_formula <- function(formula, data){
}
theta <- get_reTrms(formula, data)$theta
if(0 %in% theta){
stop("Correlated slopes and intercepts are not supported. Use || instead of |.",
stop("Failed to create random effects model matrix.\n
Possible reasons:\n
(1) Correlated slopes and intercepts are not supported. Replace | with || in your formula(s).\n
(2) You have specified random slopes for an R factor variable. Try converting the variable to a series of indicator variables instead.",
call.=FALSE)
}
}
Expand Down

0 comments on commit 546f443

Please sign in to comment.