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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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