BookmarkSubscribeRSS Feed
AmandaEHS
Calcite | Level 5

PLEASE Help!

I have a dataset of customers who are flagged with whether they have viewed a film or not. Each row represents a customer. Each column represents a film, where a 0 or 1 states whether they have seen that film or not. I need to work out the correlation between these films i.e. if people watch X they are also most likely to have watched Y. A simple way would be to cross tab all variables so that I create a dataset with all films as a row and all films as a column, with the count of customers who had seen each film pairing. I don't know how to do this so I thought if my variables were continuous, a standard PROC CORR would give me all the information I need in matrix form i.e. the correlation coefficient and the frequency of customers. But how do I create this when my variables are binary? Or can anyone help me with creating the count matrix?

2 REPLIES 2
mfisher
Fluorite | Level 6

You want to calculate a phi coefficient as a measure of association for binary data.  If you run the usual Pearson correlation in Proc Corr on binary data, the measure you get will be the phi coefficient, as they are equivalent.

Ksharp
Super User

I don't think you have a good idea here. and also don't need to make a new dataset.

proc corr only consider the correlation of  two variables which has bivariate normal distribution ,it  wouldn't consider the influence of other variable(i.e. other film ) to a variable ----- which are named partial correlation.

I think you should use Cluster Analysis to see which film belong to which cluster.

I highly recommend you to post it at SAS Statistical Procedure , where has some experts such as Steve, lvm, Rick, they are all seasoned statistician . Thay can give you a whole explanation about your question.

Ksharp

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
  • 2 replies
  • 6623 views
  • 6 likes
  • 3 in conversation