BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
_Piyush
Calcite | Level 5

Hi Team,

 

I am trying to run correspondence analysis on a m*n contingency matrix, which I am using as input data. I want the plot in 2 dimension. What is the code for it? I tried simple corresponding analysis code, but that requires categorical variables  as input data.

 

Can you please help. Have attached the sample data

1 ACCEPTED SOLUTION

Accepted Solutions
Anjanita
Calcite | Level 5

I guess you want to see it Brand wise. So, please add Brand in the first column. Then use the code below:

 

PROC CORRESP DATA=XXX outc=corres_result noprint;
 var Var1 - Var40 ;
id BRAND;
run;
 
ods html file="/home/YYY/corresp/xxx_coords_pct.xls";
proc print data=corres_result;
run;
ods html close;
endsas;
 
Please edit the code as per your dataset & variable name..
 
Hope this will help.

View solution in original post

3 REPLIES 3
Reeza
Super User

If your data is continuous wouldn't you be using Principal components analysis or factor analysis instead?

 


@_Piyush wrote:

Hi Team,

 

I am trying to run correspondence analysis on a m*n contingency matrix, which I am using as input data. I want the plot in 2 dimension. What is the code for it? I tried simple corresponding analysis code, but that requires categorical variables  as input data.

 

Can you please help. Have attached the sample data


 

Anjanita
Calcite | Level 5

I guess you want to see it Brand wise. So, please add Brand in the first column. Then use the code below:

 

PROC CORRESP DATA=XXX outc=corres_result noprint;
 var Var1 - Var40 ;
id BRAND;
run;
 
ods html file="/home/YYY/corresp/xxx_coords_pct.xls";
proc print data=corres_result;
run;
ods html close;
endsas;
 
Please edit the code as per your dataset & variable name..
 
Hope this will help.

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1569 views
  • 0 likes
  • 3 in conversation