• Register
0 votes
525 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
6 5 3
6,930 points

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 1.3K views
1.3K 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 91 views
91 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 Raphael Pacheco 4.9k points
1 vote
1 answer 704 views
704 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
1 vote
1 answer 27 views
27 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 stewart 4k points