# A good alternative to data binning?

I read many times that data binning of continuous variables is a very bad idea.

For instance, let's take something like heart rate and let's define the following 2 bins:

(125 - 135), (136 - 145)

Let's say that (136 - 145) corresponds to a hard effort.

If your exercise session causes your heart rate to stay at 135 consistently, data binning will reveal that you spent no time exercising hard, while you were 1 beat per minute away from that bin during the whole time.

Obviously, this is an exaggerated example to illustrate the point.

I was thinking to weigh each second spent at a given heart rate based on its distance from the centers of the bins it falls between.

For instance, in the example above, 140.5 would be 100% in the second bin, 135.5 would be 50% in the first bin and 50% in the second bin, 130 would be 100% in the first bin.

Does that sound like nonsense or a reasonable solution?

What would be a better way?

• Why not just leave it as continuous? – Peter Flom - Reinstate Monica May 15 '14 at 13:39
• Yes, OK, but the assumptions about the bins are designed to allow a person who is exercising to make a decision about how hard to exercise; they are coarser then the raw data. It seems unlikely that the physiology of a heart rate of 135 is the same as 125 but different from 136. So, you should account for the binning at a later stage in the analysis - when you are making recommendations. – Peter Flom - Reinstate Monica May 15 '14 at 14:17
• If the data are continuous, what happens to someone whose heart rate is 135.6? – Glen_b -Reinstate Monica May 15 '14 at 19:36
• My point was not binning is quantitative. Binning suffers from loss of power and the potential for quite serious aggregation bias, this is true both theoretically, and in my experience with actual data. – Alexis May 15 '14 at 19:42
• Possible duplicate of What is the justification for unsupervised discretization of continuous variables? – kjetil b halvorsen Dec 19 '18 at 12:10