binomial logistic regression
Posted: Wed Jul 16, 2025 9:18 pm
Hi everyone,
The "binomial logistic regression" that I have been using for a long time started giving errors today.
"Debug
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]): contrasts can be applied only to factors with 2 or more levels
private$.run()
private$.populateModelFitTable()
(function ()
{
if (is.null(private$.pseudoR2))
private$.pseudoR2 <- private$.computePseudoR2()
return(private$.pseudoR2)
})()
private$.computePseudoR2()
(function ()
{
if (is.null(private$.models))
private$.models <- private$.computeModels()
return(private$.models)
})()
private$.computeModels()
stats::glm(formulas[], data = data, family = "binomial", weights = self$weights)
model.matrix(mt, mf, contrasts)
model.matrix.default(mt, mf, contrasts)
`contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]])
stop("contrasts can be applied only to factors with 2 or more levels")
Is there a solution?
Thank you
The "binomial logistic regression" that I have been using for a long time started giving errors today.
"Debug
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]): contrasts can be applied only to factors with 2 or more levels
private$.run()
private$.populateModelFitTable()
(function ()
{
if (is.null(private$.pseudoR2))
private$.pseudoR2 <- private$.computePseudoR2()
return(private$.pseudoR2)
})()
private$.computePseudoR2()
(function ()
{
if (is.null(private$.models))
private$.models <- private$.computeModels()
return(private$.models)
})()
private$.computeModels()
stats::glm(formulas[], data = data, family = "binomial", weights = self$weights)
model.matrix(mt, mf, contrasts)
model.matrix.default(mt, mf, contrasts)
`contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]])
stop("contrasts can be applied only to factors with 2 or more levels")
Is there a solution?
Thank you