indicator variable help on R!!!!

can someone pls help me, I am having a crisis!

i have a model that i want to fit, that is,

yield=alpha_variety + gammaclay_i +delta(rainfall-mean(rainfall)) + error
where there are 4 varieties of wheat labelled A,B,C,D.

I need help on how to input an indicator variable which is clay_i that takes value 1 if any of those 4 varieties of wheat are grown in clay soil and 0, otherwise.

Thank you

What in your data tells you that clay_i should be 1 or 0? It would be very helpful if you posted a bit of your data. If your data are in a data frame named MyData, the command

dput(head(MyData))

will return code that allows others to duplicate part of your data.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.