BookmarkSubscribeRSS Feed
dmorrell
Calcite | Level 5
Forgive me if I've posted this in the wrong forum and please suggest a more appropriate site as needed.

I have some customer sales data. I'll keep it simple, two variables: CUSTOMER and ITEM. ITEM is a code specifying what the CUSTOMER purchased during their visit. Each CUSTOMER will have at least one ITEM. ITEM is unique within each CUSTOMER.

What I'd like to know is for each ITEM, how often do each of the other ITEMs get purchased by the same CUSTOMER, expressed in terms of a count or percent.

Is there a way to do this for the entire dataset in one shot using a PROC or do I have to do it one ITEM at a time?

My product set is BASE SAS only, so I hope this doesn't tie my hands too much.

Thanks for any assistance.
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12
Base-only does make it challenging.

This is a straightforward cluster analysis from data mining. It is in SAS enterprise miner.

If you get SAS IML Studio (part of SAS/Stat), you could use the R-interface to get to the clustering algorithms there.

In Base SAS, one approach with a relatively limited of ITEMs would be to do a TRANSPOSE by CUSTOMER (to get one record per person) and follow-up with FREQ to get all the two-way combinations, save the outputs and order by percent.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 721 views
  • 0 likes
  • 2 in conversation