Programming the statistical procedures from SAS

Proc Corr with Character Variables

Reply
Regular Contributor
Posts: 165

Proc Corr with Character Variables

I do services for banking and I need help to find the correlation between two variables. Interestingly I need to do with character variables and below are the sample data.

Our task is to sell loan products. Eg: many occasions people who brought mortgage loan is likely to buy auto loan.

Similarly I need to identify the loan products which has correlation.

product_dsc    loan_amt

AUTO LOAN       26,698.65

AUTO LOAN       15,000.00

AUTO LOAN     15,200.00

Used Auto        7,194.00

Personal loan   1,000.00

Used Auto     23,000.00

Used Auto    12,400.00

Any help would be really appreciated.

Grand Advisor
Posts: 9,452

Re: Proc Corr with Character Variables

You need to focus the count number of person who have a loan  not load amount , then use proc freq or proc corresp  .

Regular Contributor
Posts: 165

Re: Proc Corr with Character Variables

Thanks Ksharp.

So you're suggesting me to use proc corresp instead of Proc corr because of character variables? My assignment is on correlation and I will be worried if we don't have relationship between proc corresp and proc corr

Grand Advisor
Posts: 9,452

Re: Proc Corr with Character Variables

Yes. proc freq also can compute person,spearman correlation coefficient for category variable ,but you need frequency of people , check documentation.

BTW, you also could try proc corr ,but that will give you person product-moment correlation coefficient  if you have data like

name   home_load auto_load

Arthur.T   23    45

Peter.E   34  45

KSharp   56 78

Xia Keshan

Trusted Advisor
Posts: 1,195

Re: Proc Corr with Character Variables

Hi,

Change your data structure to run correlation analysis. Identify people who are having more than one loan (auto_loan, used_auto etc.) then using proc corr can give some idea about the customers' behavior.

Id      AUTO_LOAN       Used_Auto     

1       26,698.65            7,194.00

2      15,000.00            23,000.00

3      15,200.00            12,400.00

Ask a Question
Discussion stats
  • 4 replies
  • 862 views
  • 0 likes
  • 3 in conversation