Programming the statistical procedures from SAS

boxplot

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

boxplot

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

 

 


Accepted Solutions
Solution
‎03-25-2016 11:19 AM
Trusted Advisor
Posts: 1,115

Re: boxplot

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


All Replies
Super User
Super User
Posts: 7,565

Re: boxplot

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

Solution
‎03-25-2016 11:19 AM
Trusted Advisor
Posts: 1,115

Re: boxplot

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).

Occasional Contributor
Posts: 5

Re: boxplot

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 !

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 297 views
  • 1 like
  • 3 in conversation