BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ameurgen
Obsidian | Level 7
species shell_color flesh_color
Otala_punctata brown_beige  Gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  beige_black
Otala_punctata white_brown_beige Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata white_brown Black_gray
Otala_punctata beige Black_gray
Otala_punctata white_brown Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  beige_black
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown Black_gray
Otala_punctata brown_beige  beige_black
Otala_punctata brown_beige  beige_black
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown_beige  Black_gray
Otala_punctata brown Black_gray
Otala_punctata brown_beige  Black_gray

 

 

Hi guys, 

need i quick help please, here is above a cut for my data, and i need to apply the Multiple correspondence analysis (MCA)  using proc correspbut this is my fist time and the syntax is so complicate, you know sas doc, also, i cant make a difference between Var statment and table statment.

i need to plot differents species by shell and flesh color.

Thank you all

regards

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Ammonite | Level 13

Others have answered your questions so let me just add that the VAR statement is used when you want to read an existing table, and the TABLES statement is used when you want to create a table from raw categorical data (similar to but not identical to the TABLES statement in PROC FREQ).

View solution in original post

10 REPLIES 10
PaigeMiller
Diamond | Level 26

The example here creates a similar plot to the one you are asking for.

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_corresp_examples01.htm

--
Paige Miller
Ameurgen
Obsidian | Level 7

Hi, 

Do i need to encoding my data or just leave it, because with some code icoudnt get the scatter plot .

Thank you

Ameurgen
Obsidian | Level 7
proc corresp mca observed data=snails;
   tables  shell_color flesh_color;
run;

with this code  doesnt work, please what im missing here. thank you

ballardw
Super User

Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the "</>" to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "</>" icon or attached as text to show exactly what you have and that we can test code against.

StatDave
SAS Super FREQ
If you want a plot and analysis for each species separately, then you probably just need a simple correspondence analysis as in the first part of the example titled "Simple and Multiple Correspondence Analysis of Automobiles and Their Owners" in the CORRESP documentation. For these data, the plot is just one dimensional.
WarrenKuhfeld
Ammonite | Level 13

Others have answered your questions so let me just add that the VAR statement is used when you want to read an existing table, and the TABLES statement is used when you want to create a table from raw categorical data (similar to but not identical to the TABLES statement in PROC FREQ).

Ksharp
Super User


TABLE  statement is for your raw data like you post.
VAR statement is for NxM contingency table (like PROC FREQ), you need change your raw data into NxM table .

So your code looks right. Could you post your LOG to see where is not working ?

WarrenKuhfeld
Ammonite | Level 13

@Ksharp Sorry, but it is the other way around.

Ksharp
Super User

Warren,
Sorry. My bad. my brain must run into some problem .
TABLE is for raw data, VAR is for mxn table just like PROC FREQ .

Ameurgen
Obsidian | Level 7

Thank all for your help is appreciated.

 

regards

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 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
  • 10 replies
  • 1995 views
  • 3 likes
  • 6 in conversation