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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 1306 views
  • 0 likes
  • 3 in conversation