X is the matrix that includes your input data. R is the matrix of the results. n is just element index---in this case n goes from 1 to 83.
I am afraid that this method will not work, now seeing what your data are.
There are two non-linear elements in the data: soil type and plant presence/absence. The plant presence/absence can be generated as 1 for presence and 0 for absence, however that will give poor results. If the plant presence/absence data were replaced with a plant growth scale, like the height of the plant, then this would be more manageable. The soil type itself is no way a linear scale... my method would only work so far as to give you 8 linear models, one for each soil type. If you had numerical properties of the soil type then that could be modeled.
Then, the model itself is not a linear one. Both temperature and precipitation have an optimum range. Plant presence falls the further away you get from that region---not linear behavior. A second order polynomial would be better... This is not a big deal with matrices, but the data are not polynomial of any order---they are bell curves. I do not know how to begin to model this. Sorry.
|