Hello,
How to get the lower and upper boundary limits of the bucket inside a dataset that is result of proc HPBIN?
proc hpbin data=sashelp.cars numbin=10 output=out_bin quantile ;
input mpg_city;
id mpg_city;
run;If you run the above code you will get the below in results:
I want the Range in a dataset. How can i do that?
Well, Not in this case-- it seems like it.
THe out dataset has 2 variables:
1. actual MPG_City variable
2. BIN_MPG_City: This variable has the Bin number for that particular mpg_city.
I am looking for a way to get the lower and upper bounds in a dataset.
It worked fine for me using the ODS table, you can use SCAN() to split the range since it's the text so it's a slight extra step but not too bad IMO.
EDIT: I stand corrected, it has the LB and UB in the table as well.
Obs Variable BinnedVariable LB UB Range Bin Frequency Proportion 1 MPG_City BIN_MPG_City . 15.5 MPG_City < 15.5 1 48 0.11214953 2 MPG_City BIN_MPG_City 15.5 17.5 15.5 <= MPG_City < 17.5 2 72 0.16822430 3 MPG_City BIN_MPG_City 17.5 18.5 17.5 <= MPG_City < 18.5 3 69 0.16121495 4 MPG_City BIN_MPG_City 18.5 19.5 18.5 <= MPG_City < 19.5 4 37 0.08644860 5 MPG_City BIN_MPG_City 19.5 20.5 19.5 <= MPG_City < 20.5 5 57 0.13317757 6 MPG_City BIN_MPG_City 20.5 21.5 20.5 <= MPG_City < 21.5 6 38 0.08878505 7 MPG_City BIN_MPG_City 21.5 23.5 21.5 <= MPG_City < 23.5 7 25 0.05841121 8 MPG_City BIN_MPG_City 23.5 26.5 23.5 <= MPG_City < 26.5 8 53 0.12383178 9 MPG_City BIN_MPG_City 26.5 . 26.5 <= MPG_City 9 29 0.06775701
Can you please give the code you used to produce this result?
My code looks like:
proc hpbin data=_temp_ numbin=10 output=out_bin quantile ;
input ficeclv9_score;
id ficeclv9_score;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.