Help using Base SAS procedures

Nobel Prize Type of Question???

Not applicable
Posts: 0

Nobel Prize Type of Question???

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?

Valued Guide
Posts: 653

Re: Nobel Prize Type of Question???

Posted in reply to deleted_user
Do a search on random subsets. There are a number of possible solutions. Look at PROC SURVEYSELECT first.
Super Contributor
Super Contributor
Posts: 366

Re: Nobel Prize Type of Question???

Posted in reply to deleted_user
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.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation