I have a problem with a linear function. I am using categorical variables but when performing a linear function and making a summary I get the error Error in quantile.default (resid): (unordered) factors are not allowed.
I am using the following function:
Reg_Total<- lm(This_6 ~ This_3+ This_12,data = In_GCambio2)
and the following data:
This_1 : Factor w/ 2 levels "No","Sí": 2 2 2 1 2 2 2 2 1 2 ...
$ This_2 : Factor w/ 5 levels "De acuerdo","En desacuerdo",..: 4 1 4 3 1 3 4 4 1 1 ...
$ This_3 : Factor w/ 2 levels "No","Sí": 2 2 2 1 2 2 2 2 2 2 ...
$ This_4 : Factor w/ 2 levels "No","Sí": 1 2 1 1 2 2 2 2 2 2 ...
$ This_5 : Factor w/ 2 levels "No","Sí": 2 2 2 1 2 2 1 2 2 2 ...
$ This_6 : Factor w/ 3 levels "3.200.000 a 3.500.000"
Do I have to use another type of model or may my data be wrong?