BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I need help.

Who can help me unlock this mystery?


I have a set of data with 1,000 records. There are various columns such as Transaction Date, Customer ID, Age, Town, Zip Code, Country, etc. Of the 1,000 customers that I get every month, about 8% to 10% pay with credit cards.

If I pull a subset of my dataset using a certain age range AND certain zip codes AND a few other things together, I get fewer records e.g. 80 records, with 40 of them being those who buy on credit. With this subset, the percentage credit card customers becomes 50% of the subset.

When I use the same specifications (age range, those same zip codes, etc.) the next month, the subset becomes about 100 with 35 credit card customers. The percentage in this case is 35%

My interest is to pull a subset that has 50% credit card customers, and I don't mind much about what criteria is used. I don't care about how many customers are produced in the subset. I just want that 50% composition. My question is, what SAS/SQL language/clause/function/etc can I use in a code to produce a SUBSET that has 50% credit card customers?

Thanks
2 REPLIES 2
ArtC
Rhodochrosite | Level 12
Do a search on random subsets. There are a number of possible solutions. Look at PROC SURVEYSELECT first.
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Mack,

Do you have an atribute indicating that a customer is a credit card customer? If yes then it is very simple. Please, explain your point.

Sincerely,
SPR

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 814 views
  • 0 likes
  • 3 in conversation