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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1669 views
  • 0 likes
  • 3 in conversation