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

hello, i have a problem to make a bloxplot on SAS.

i want to represent the fetal weight depending the pesticide exposition.

i have a continue variable of the fetal weight and i have a qualitative variable with exposition/non exposition of pesticide.

i've made this procedure :

proc boxplot data = bou;                                                                                                                
plot poidsbb* MCP_nmol_lbis;                                                                                                            
run;                                                                                                                                    
                                                                                                                                        
                              

but when i look the boxplot, i have multiple legends to exposed and not exposed, i would like to have just two boxs with expose/non exposed in terms of mean of pesticide exposition, non exposition

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @marica14,

 

Is it possible that variable MCP_nmol_lbis contains not just two values (e.g. 1 for "exposed", 0 for "not exposed"), but several categories (or even quantitative values) for the "exposed" subjects? Maybe a user-defined format is associated with this variable which has only two categories ("exposed", "not exposed"). But PROC BOXPLOT would still use the individual values and just label the boxes according to the format (so that several boxes were labelled "exposed").

 

In this case you should create a new variable with only two values corresponding to "exposed" and "not exposed" and replace MCP_nmol_lbis with this variable in the PLOT statement. You could use the existing format in the definition of the new variable:

data bou;
set bou;
expo=put(MCP_nmol_lbis, yourformat.);
run;

(or use the VVALUE function).

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

This site will help you, it has many examples of all types of graphs: 

http://blogs.sas.com/content/graphicallyspeaking/

 

Specifically searched on boxplot:

http://blogs.sas.com/content/graphicallyspeaking/?s=boxplot

FreelanceReinh
Jade | Level 19

Hello @marica14,

 

Is it possible that variable MCP_nmol_lbis contains not just two values (e.g. 1 for "exposed", 0 for "not exposed"), but several categories (or even quantitative values) for the "exposed" subjects? Maybe a user-defined format is associated with this variable which has only two categories ("exposed", "not exposed"). But PROC BOXPLOT would still use the individual values and just label the boxes according to the format (so that several boxes were labelled "exposed").

 

In this case you should create a new variable with only two values corresponding to "exposed" and "not exposed" and replace MCP_nmol_lbis with this variable in the PLOT statement. You could use the existing format in the definition of the new variable:

data bou;
set bou;
expo=put(MCP_nmol_lbis, yourformat.);
run;

(or use the VVALUE function).

marica14
Calcite | Level 5

my variable is already with two issues,

when i represent with a proc boxplot it doesn't run but when i represent with a sgplot it runs. so i will do it with the sgplot. thanks !

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
  • 3 replies
  • 2036 views
  • 1 like
  • 3 in conversation