Programmers learn & share
0 votes
176 views

Problem :

I face folowing error when I run an ANOVA on R
in model.response(mf, "numeric") : using type = "numeric" with a factor response will be ignored
by (6.9k points)   | 176 views

1 Answer

0 votes

Solution :

One can not use a linear regression model with a factor as response variable which is same you are attempting to do here . Regression models do require numeric response variables. So you should instead look at classification models.

You may wish to start by restating your "type" variable as a logical binomial variable. Instead of a factor called "type" with two levels "A" and "B", you may create a new variable called "is.type.a", which should contain TRUE or FALSE.

So you should try a logistic regression based on a binomial distribution as follows :

model <- glm(is.type.a ~ age + gender,data=data,family="binomial")
by (36.1k points)  
2,204 questions
2,603 answers
59 comments
241 users