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.
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.