# Questions tagged [binning]

Binning means grouping a continuous variable into discrete categories. It is particularly used in reference to histograms, but could also be used more generally in the sense of coarsening.

249 questions
Filter by
Sorted by
Tagged with
11 views

### Using maximally selected log rank to find two cutoffs instead of one

I have used the maximally selected log rank test to dichotomize a continuous variable (high vs low). I was curious if the maximally selected log rank test could be generalized to make 3 groups instead ...
60 views

### WOE (Weight of evidence) cross-validation bias

I have a task to create credit scoring model using WOE encoding. I have a very small dataset, so I wont be able to perform testing on test and out-of-time samples. Thus, I am going to use cross-...
36 views

### Creating well-separated bins

I want to distribute my hospital data into 4 tiers (bins) based on the score. Tier 1 (good hospitals) has the highest score and Tier 4 (not so good hospitals) has the lowest score. The tiers can be of ...
13 views

### Un-binning/Upsampling Ordinal Year-Bins into Individual Years for Random Forest Likert Analysis?

Question: Is it "quantitatively sound" to decompose/upsample year-bins (e.g., 2002-2006) into the component years when analyzing Likert Score data that was collected as a recollection of ...
159 views

I have read on many occasions deep learning practitioners recommending to treat regression problems (with continuous variables) as classification problems, by quantizing the output into bins and using ...
41 views

### Descriptive statistics: a metric of the "lumpiness" of numeric vector

I have three datasets of continuous data. Is there a convenient metric for the "binnedness" of the data? How "lumpy" it is? I'd like a single number to allow me to distinguish ...
1 vote
106 views

### Quantize a continuous random variable

Suppose we have a continuous random variable $X$. We do not know its distribution function, but have $n$ i.i.d. samples. I am looking for methods that quantize (discretize) $X$ into a categorical ...
67 views

### Target binning in regression

I would like to find a predictive density for target variable via multi-class classification. Suppose we are given a set of features $\mathbf X$ and continuous target $\mathbf y$. Replace each $y$ ...
14 views

### Setting threshold with dynamic feedback

I have a dataset with 200,000 obs and the following variables: score (continuous: 0-100), pred (binary: 0/1). I want to create a binary variabel: pred2, that acts the following: a) if score is high, ...
38 views

### Binning continuous predictors, What is the best way? [duplicate]

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 ...
126 views

### Regression With Binned Variables

Today our professor was discussing Sutradhar, Gu and Paszat (2016). In this paper the authors decided to study the relationships between patient characteristics and following the "advice" ...
36 views

51 views

### Histogram where the bin heights take values into account

In a regular histogram the bin heights reflect the density of observations/data within them. Therefore, the areas of the bins on the chart reflect the quantity of observations they cover. They are for ...
400 views

### Number of bins for discretization

How do I decide on the right number of bins to discretize my continuous data? Are there are tests/techniques to do the same? Could someone give me some idea into existing approaches?
1 vote
228 views

### Binning Calibrated probability scores for business use

Context: We have a model that outputs calibrated probability scores for a binary classification problem (events/nonevents). There is a general business requirement that we bin these outputs further to ...
1 vote
76 views

### Variance of 2D binned uniform density

I will start off by saying that I am aware of this post, but applying Sheppard's correction in my case would seem to lead to a negative variance; so either I don't understand that post, or I have a ...
328 views

### Transform target/label variable into classes but classes are data-dependent: How to approach this correctly?

I was redirected from StackOverflow because my question is more about theory. I have a usual set-up with a pandas dataframe with some features and a numeric target variable (financial returns for ...
1 vote
218 views

### What can we learn from binning before correlation?

I've seen a lot of questions about binning data and how it produces wrong results. "wrong" here refers to arbitrary increases in correlation strength, or sometimes even achieving two ...
1 vote
3k views

### How to calculate the mean from bin endpoints and frequencies? [duplicate]

Sometimes data extracted from reports do not have individual values, like 4, 23, 43, but grouped together like this: income level people in this group 10k to 20k 44 20k to 40k 240 40k to 80k 400 ...
45 views

### When should I use a dummy variable?

I have data for neighbourhoods with median income. I also have a standard low-income cutoff. (Just using regression analysis) I feel it would lead to a simpler and cleaner result if I just use the ...
64 views

### How do I bin my PCA results i.e., 120 equal bins of my large data set?

I am a new researcher in Japan and working on my project. I am lost after reading one paper, the paper is from very good general he uses the technique of binning of PCA but I don't know how what does ...
1 vote
35 views

### Logistic regression using a predictor that's part of the outcome

Say I have 2 continuous variables measuring the same thing (e.g., at-home blood pressure monitor and in-office blood pressure cuff with in-office measurements being the gold standard). At a cut-off of ...
348 views

### Preferred way to sum different time series together (in software)

Is there a canonical/best approach to computationally summing different time series together? What I mean by that is the operation $$\sum_i{s_i(t)} = S(t)$$ where $s_i(t)$ is the $i$-th time series, ...
137 views

### binning numerical variables?

I am dealing with a dataset composed of both numerical (discrete) and nominal variables and I have to classify a binary response. Since the dataset is imbalanced, I decided to oversample the minority ...
7k views

### Difference between equal frequency and quantile binning

Equal-frequency binning divides the data set into bins that all have the same number of samples. Quantile binning assigns the same number of observations to each bin. What is the difference between ...
288 views

### One Hot Encoding of ranges of data vs. leaving data as is for Logistic Regression

Recently whilst doing an assignment using the PIMA Diabetes set I ran Logistic Regression using, amongst others: the age predictor as is segmented the age into ranges and applied OHE (with and ...
131 views

### Converting continuous predictor to category e.g. Age [duplicate]

I notice that on many examples one is keen to convert Age to a categorical age range. I am wondering if that is always necessary. The famous golf play decision tree example has ranges for temperatures ...
1 vote
590 views

### Modeling covariates in multiple regression

My aim is to find the association between intake of chocolate (continuous predictor) and blood pressure (continuous outcome) in a multiple linear regression. I have to include many covariates in order ...
4k views

### How can I determine the optimal binning system for a continuous variable in Python?

I've got two columns of data - a continuous variable that I'd like to treat as a categorical variable (i.e. bin it up), and a metric I want to measure by bin. Let's say the first column is income and ...
102 views

### Plotting average shows (log) linear trend but fitting line has 0 p value

I have some data and I am examining the relationship between two variables. When I form x-bins and take summary statistics of y in those bins, I see the plot below. The black line is the mean of each ...
29 views

### Which statistical techniques can be used to decide which definition of sets produces the most coherent grouping of data

To explain. I am a historian, and an almost complete statistical novice. I am interested in exploring the ways in which generational alignments might be identified, not via use of generational labels, ...
Assume a variable $x$ follows a uniform distribution i.e. $P(x)-=const$. In my case this is constant background as shown in the following figure with the green curve This is a distribution with a ...