I want to run a binary logistic regression to understanding (modeling) factors affecting nest-site selection in a bird species.. I think it is better if I transform continuous variables to categorical variables, because for example Nest Height from the ground can have different effects in different ranges (different intervals); for example 0-200cm will have a negative effect in Nest-site selection while 200-250cm have a positive effect and it will be change in next ranges too + - - + + - + .. After running Binary logistic regression we will have a coefficient for each category instead of having a coefficient for a variable.

I am looking for a method where the cut points are not exactly in the data. I think it will be about distribution and density.. I think Equal probability histogram with Kernel density estimation is a good method for this purpose particularly when I can run a Pairwise comparison of means to know each category built properly or not, but only when I do Visual interpretation.. I am looking for a more scientific method which I will refer to in my article. Thanks. enter image description here enter image description here

  • $\begingroup$ Is "+ - - + + - +" the pattern of the effect of height on selection? Why do you think this happens? Is it several different effects interacting? $\endgroup$
    – Henry
    Feb 11 at 22:41
  • $\begingroup$ It's not exactly like that "+ - - + + - +" I just gave an example... but I felt something like this in the environmental data $\endgroup$ Feb 11 at 22:47
  • 2
    $\begingroup$ @MostafaAhmadi Why not? The accepted answer gives strong rationale about why this kind of binning is a poor strategy and how you can get the desired nonlinear behavior (the $++-+-+$ you desire) using alternative strategies. $\endgroup$
    – Dave
    Feb 12 at 1:16
  • 2
    $\begingroup$ Did you try to spline it? See stats.stackexchange.com/questions/122212/… $\endgroup$ Feb 12 at 4:04
  • 1
    $\begingroup$ I think it is pretty much the consensus here and elsewhere among statisticians that binning is bad practice (especially "optimal" binning, which can very quickly devolve into p-hacking), and that splines are much better to capture nonlinearities. I would very much recommend you do look into splines, and if you then still believe you need binning, then please do edit this question and explain why splines are not the answer. Of course, if you have any questions about splines, you can post them here, or search in the splines tag. $\endgroup$ Feb 12 at 6:13


Browse other questions tagged or ask your own question.