Hi guys,
My data tables has about 1,000 records with the following variables:
Name
Age
City
State
MonthlyBill
I am using the following code to remove retain those who are from NY and pays monthly of $500 or less
proc sql; create table want as select t1.* from have t1 where t1.state IN ('NY') and t1.MonthlyBill lt 500; quit;
I am left with 300 records and I am confused. Upon checking, my tables have about 200 NY customers and 500 are those below 500 bill. I was only expecting about 200 to be removed.
Any thoughts?
Your description is confusing. Your code is not "removing" anything. It is selecting just the observations that meet both criteria.
So if there are only 200 NY records then the maximum number of observations you will get is 200. If any of them have bills larger than 500 then you will get less than 200. Remember that SAS will treat missing values as less than any actual number so your WANT dataset could include observations with missing values for monthlybill
Your description is confusing. Your code is not "removing" anything. It is selecting just the observations that meet both criteria.
So if there are only 200 NY records then the maximum number of observations you will get is 200. If any of them have bills larger than 500 then you will get less than 200. Remember that SAS will treat missing values as less than any actual number so your WANT dataset could include observations with missing values for monthlybill
Oh. Let me revisit my code. Thanks!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.