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
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).
This site will help you, it has many examples of all types of graphs:
http://blogs.sas.com/content/graphicallyspeaking/
Specifically searched on 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).
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 !
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.