Advice on categorizing data in quantiles as a new variable.
Solved - thanks!
Hi,
I am not aware of a built-in function that would yield what you need. Instead, I use the formula below to classify my data dynamically into quartiles.
If( :DATA <= Col Quantile( :DATA, 0.25 ), 1, Col Quantile( :DATA, 0.25 ) < :DATA <= Col Quantile( :DATA, 0.5 ), 2, Col Quantile( :DATA, 0.5 ) < :DATA <= Col Quantile( :DATA, 0.75 ), 3, 4 )
I hope it helps.
Best,
TS
My approach is the same as @Thierry_S, but I used temporary variables in the formula for efficiency.