You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an error when using resids (and other functions) with clm objects.
Error in X[, -1L, drop = FALSE] %*% object$beta :
non-conformable arguments
The error originates from the getMeanResponse.clm function.
I think I fixed it with:
getMeanResponse.clm <- function(object) {
# Have to do this the long way, for now! :(
mf <- model.frame(object)
if (!is.null(cl <- attr(object$terms, "dataClasses"))) {
.checkMFClasses(cl, mf)
}
X <- model.matrix(object$terms, data = mf, contrasts = object$contrasts)
if(sum(object$aliased$beta) > 0) {
X <- X[, !c(object$aliased$beta), drop = FALSE]
# X <- X[, !c(FALSE, object$aliased$beta), drop = FALSE] # ERROR WAS HERE
}
drop(X[, -1L, drop = FALSE] %*% object$beta[!object$aliased$beta] - object$alpha[1L])
### drop(X[, -1L, drop = FALSE] %*% object$beta - object$alpha[1L]) # ERROR ALSO HERE
}
The text was updated successfully, but these errors were encountered:
There is an error when using
resids
(and other functions) with clm objects.The error originates from the getMeanResponse.clm function.
I think I fixed it with:
The text was updated successfully, but these errors were encountered: