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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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