Skip to content
Prev 154970 / 398506 Next

test if all predictors in a glm object are factors

On Wed, 3 Sep 2008, Marc Schwartz wrote:

            
Is an ordered factor a 'discrete factor'?  I suspect it is, so this needs 
to be

is.discrete.glm <- function(model)
   all(attr(terms(model), "dataClasses")[-1] %in% c("factor", "ordered"))

(removing redundant braces).