When conducting a GLM, why do I have to square my independent value in order to model an unimodal distribution?
for example (Matlab code)
%GLM
[logit_rain,dev,stats] = glmfit([(rain) (rain).^2
],[dependend_variable],'binomial','logit');
When conducting a GLM, why do I have to square my independent value in order to model an unimodal distribution?
for example (Matlab code)
%GLM
[logit_rain,dev,stats] = glmfit([(rain) (rain).^2
],[dependend_variable],'binomial','logit');
This is a logistic regression model. You speak of a unimodal distribution, but I don't know what you mean by that in this context.
A linear model would have the probability of plant growth increase as rainfall increases or decreases, but not both. If you want the probability to reach a maximum at a certain rainfall level and decrease as you move away from that level, you would need some ability to specify a function with that type of behavior. One way to do that would be to include a squared term.