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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 6929 views
  • 6 likes
  • 3 in conversation