-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
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
}
faurehu
Metadata
Metadata
Assignees
Labels
No labels