I'm trying to find a model for my data but I get the message "Coefficients: (3 not defined because of singularities)" These occur for winter, large and high_flow
I found this: https://stats.stackexchange.com/questions/13465/how-to-deal-with-an-error-such-as-coefficients-14-not-defined-because-of-singu
which said it may be incorrect dummy variables, but I've checked that none of my columns are duplicates.
when I use the function alias() I get:
Model :
S ~ A + B + C + D + E + F + G + spring + summer + autumn + winter + small + medium + large + low_flow + med_flow + high_flow
Complete :
(Intercept) A B C D E F G spring summer autumn small medium
winter 1 0 0 0 0 0 0 0 -1 -1 -1 0 0
large 1 0 0 0 0 0 0 0 0 0 0 -1 -1
high_flow 1 0 0 0 0 0 0 0 0 0 0 0 0
low_flow med_flow
winter 0 0
large 0 0
high_flow -1 -1
columns A-H of my data contain numeric values the remaining columns take 0 or 1, and I have checked there are no conflicting values (i.e. if spring = 1 for a case, autumn=summer=winter=0)
model_1 <- lm(S ~ A+B+C+D+E+F+G+spring+summer+autumn+winter+small+medium+large+low_flow+med_flow+high_flow, data = trainOne)
summary(model_1)
Can someone explain the error please?
EDIT: example of my data before I changed it to binary
season size flow A B C D E F G S
spring small medium 52 72 134 48 114 114 142 11
autumn small medium 43 21 98 165 108 23 60 31
spring medium medium 41 45 161 86 177 145 32 12
autumn large medium 40 86 132 80 82 138 186 16
winter medium high 49 32 147 189 125 43 144 67
summer large high 43 9 158 64 14 146 15 71