• Register
0 votes

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
6 5 3
6,930 points

Please log in or register to answer this question.

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")
9 7 4
38,600 points

Related questions

0 votes
1 answer 2 views
Problem: I have a data.frame whose class column is Factor. I'd like to convert it to numeric so that I can use a correlation matrix. How can I convert a Factor column to a numeric column?
asked Mar 30 ummesalma 24.5k points
1 vote
1 answer 1.5K views
Problem : I have my data as this the ticks feed on three of the groups of treated mouse's and compare whether my treatment has the effect on ticks the bacteria load. When I tried to make the mixed model like below: lmer.model01 = lmer(log10.load ~ treat + ... below : Error: number of levels of each grouping factor must be < number of observations What must have happened and how can fix this error?
asked Dec 28, 2019 alecxe 7.5k points
0 votes
1 answer 2.5K views
Problem : I have been facing below error message and traceback: Error in FUN(X[[i]], ...) : only defined on the data frame with all numeric variables 5 stop("only defined on the data frame with all numeric variables") 4 FUN(X[[i]], ...) 3 lapply(args, ... .numeric(data[good,]) But now I get the different error message back as below : "Error: (list) object cannot be coerced to type 'double'"
asked Dec 16, 2019 alecxe 7.5k points
0 votes
1 answer 3 views
Problem: Error in family$linkinv(eta) : Argument eta must be a nonempty numeric vector.The reason the title of the question is the error I am getting is because I simply do not know how to interpret it.Can Anyone solve this problem?
asked 23 hours ago sumaiya simi 9.9k points
0 votes
1 answer 32 views
Problem: error in as.date.numeric(value) : 'origin' must be supplied.
asked Feb 16 charles mathews 5.5k points
0 votes
1 answer 302 views
0 votes
1 answer 453 views
Problem: I have very good knowledge of r, ggplot and unix. I am now a days trying to analyze the dataset of the GSR values. I had first transformed my all the required unix values into the readable data and after that I created the plot of my GSR values in the ... . But I had already supplied the origin when I tried to transform my unix into the readable data and also again in the ggplot code.
asked Jul 27, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 61 views
Problem : I am trying to understand R and I am very new to Programming as wel. If I try to create the box chart with the use of standard error bars I often face below error message: “Error: ggplot2 doesn't know how to deal with data of class numeric”. Looking for help in quick fixing the above error.
asked May 5, 2020 stewart 4k points
0 votes
1 answer 755 views
0 votes
1 answer 411 views