# Questions tagged [binning]

Binning means grouping a continuous variable into discrete categories. It is particularly used in reference to histograms

29 questions
Filter by
Sorted by
Tagged with
28k views

### What is the benefit of breaking up a continuous predictor variable?

I'm wondering what the value is in taking a continuous predictor variable and breaking it up (e.g., into quintiles), before using it in a model. It seems to me that by binning the variable we lose ...
30k views

### Assessing approximate distribution of data based on a histogram

Suppose I want to see whether my data is exponential based on a histogram (i.e. skewed to the right). Depending on how I group or bin the data, I can get wildly different histograms. One set of ...
2k views

### Interpretation of Bayes Theorem applied to positive mammography results

I'm trying to wrap my head around the result of Bayes Theorem applied to the classic mammogram example, with the twist of the mammogram being perfect. That is, Incidence of cancer: $.01$ ...
3k views

### What is the justification for unsupervised discretization of continuous variables?

A number of sources suggest that there are many negative consequences of the discretization (categorization) of continuous variables prior to statistical analysis (sample of references [1]-[4] below). ...
2k views

### Benefits of using QQ-plots over histograms

In this comment, Nick Cox wrote: Binning into classes is an ancient method. While histograms can be useful, modern statistical software makes it easy as well as advisable to fit distributions to ...
29k views

### How to find average and median age from an aggregated frequency table

I am using excel and I am trying to find both the average age and median age. I have two columns. 1 for the category and the other for the number of people in each category. ...
3k views

### Impact of data-based bin boundaries on a chi-square goodness of fit test?

Leaving aside the obvious issue of the low power of the chi-square in this sort of circumstance, imagine doing a chi-square goodness of test for some density with unspecified parameters, by binning ...
5k views

### Doane's formula for histogram binning

I'm implementing various algorithms to estimated the best number of bins to use for histograms. Most of the ones I am implementing are described on the Wikipedia "Histogram" page in the section "...
3k views

### Rationale for the use of Regressogram (Bin-Smooth)

I am taking a class in data mining and we have recently been introduced to bin-smoothing in regression analysis but i cannot seem to understand the usefulness of this method nor how the method works ...
7k views

### When should we discretize/bin continuous independent variables/features and when should not?

When should we discretize/bin independent variables/features and when should not? My attempts to answer the question: In general, we should not bin, because binning will lose information. Binning is ...
2k views

### Should we bin continuous variables?

I know this has been asked before, and I have read through the responses to the earlier queries related to binning continuous variables. I do understand that generally we should avoid binning, given ...
10k views

### Optimal Binning with respect to a given response variable

I'm looking for optimal binning method (discretization) of a continuous variable with respect to a given response (target) binary variable and with maximum number of intervals as a parameter. example:...
15k views

### Calculating the variance of the histogram of a grayscale image

I am doing image processing and I want to calculate the variance of a histogram of pixel intensities. The first method I have tried: The images store the pixels values using double precision numbers,...
5k views

### Should the final R glm include only significant levels of factors

I am running a glm in R on data with quite many predictors (~50), both initially continuous and factors. The response is binary and the volume of the data is OK (~100K rows), in order to model non-...
6k views

### Number of bins when computing mutual information

I want to quantify the relationship between two variables, A and B, using mutual information. The way to compute it is by binning the observations (see example Python code below). However, what ...
3k views

### Why should binning be avoided at all costs?

So I've read a few posts about why binning should always be avoided. A popular reference for that claim being this link. The main getaway being that the binning points (or cutpoints) are rather ...
930 views

### How Do You Choose The Number of Bins To Use For A Chi-Squared GOF Test?

I'm working on developing a physics lab about radioactive decay, and in analyzing sample data I've taken, I ran into a statistics issue that surprised me. It is well known that the number of decays ...
2k views

### optimal binning in R

SPSS has an optimal binning function that helps categorizing into meaningful intervals continuous predictors when a binary response variable exists. I was looking for an equivalent function in R but I'...
404 views

### Cox-Proportional Hazards Survival Curve has too many lines - can binning the continuous variable help?

I am doing survival analysis on some continuous variables and am finding that some of my plots are difficult to interpret because there are too many lines. Here is an example: I am interested in ...
539 views

### Mutual info via binning gives non-zero results for independent variables

I'm trying to calculate mutual information in Python, using numpy. My implementation so far is: ...
123 views

### treatment for factors with many levels [duplicate]

I'm running a predictive model and I have one possible predictive variable that is a factor and has more than 800 levels. I tried to reduce it running ctree in R (with the variable as the only ...
126 views

### Learning a continuous model from binned data

A very similar question has been asked before, but it didn't get a real answer. Background I would like to develop a probability model for a continuous, ratio-scale random variable $Y$. Let's say it ...
949 views

### Post-hoc power size calculation

I have, probably, a simple problem. I've finished analysing the results of an observational prospective study conducted in our unit. In this study I evaluated if a specific biomarker is independently ...
8k views

### Best way to bin continuous data

I have a data frame with 1 vector of integers and 1 as a character factor like so: I have created a linear model that shows a relationship between age and party affiliation. I now want to determine ...
991 views

### Can binning a continuous predictor or DV variable improve large data sets fit?

I read that averaging and binning a continuous predictor variable is in general a bad idea because it's always better to fit the continuous relationship through splines, poly and all of that. Sure, I ...
136 views

### R: Automatically group the insignificant dummy levels and re-fit the model

I am running a reg model with Weekdays as my dummy variables so I can find the weekday effects to the output metric. The picture below shows the results from this regression, and only Sunday is ...
238 views

### MLEs of Poisson lambda values

I have sample data that I expect to contain values from at least several Poisson distributions (set around various lambda values). Some of these lambda values are nicely spaced, leading to what are ...
I have a health dataset with the number of drinks per month someone consumes, and many other variables that are binned. For example, 1: income less than \$10000, 2=income less than \$20000, and so on. ...
I asked a question here but I did a rather poor job of explaining my problem the question was poorly formed. If I have some histogram with $N_{total}$ number of total data points, and $N_{bins}$ ...