Describe the bug
priors in bas.glm are objects, while in bas.lm character strings are used to refer to the prior, so the check to see if the prior is one of AIC or BIC in the coef function fails as it is comparing to object$prior which completes to object$priorprobs and the wrong length. No warning occurs if there is only a single model as when restricting the number of models.
To Reproduce
Steps to reproduce the behavior:
pima.bas = bas.glm(formula = type ~ bp + bmi, data = Pima.tr,
family = binomial(),
betaprior = bic.prior(),
modelprior = uniform(),
method = "BAS")
coef(pima.bas)
Expected behavior
no warnings or errors
Offending Code
Starting line 126
if (!(object$prior == "AIC" || object$prior == "BIC")) {
conditionalsd[, -1] <- sweep(conditionalsd[, -1, drop = F], 1,
sqrt(shrinkage),
FUN = "*"
)
}
and line 140
df <- df - object$rank
} else {
df <- df - 1
Desktop (please complete the following information):
OSX
R Version 4.2.2
Additional context
check if this impacts predictions too
Describe the bug priors in
bas.glm
are objects, while inbas.lm
character strings are used to refer to the prior, so the check to see if the prior is one of AIC or BIC in the coef function fails as it is comparing toobject$prior
which completes toobject$priorprobs
and the wrong length. No warning occurs if there is only a single model as when restricting the number of models.To Reproduce Steps to reproduce the behavior:
Expected behavior no warnings or errors
Offending Code
Starting line 126
and line 140
Desktop (please complete the following information):
Additional context check if this impacts predictions too