Data visualization with SAS programming

add label in boxplot

Reply
Frequent Contributor
Posts: 76

add label in boxplot

Hi all,

 

I want to have a boxplot figure below, in the topleft area (mean area) I want to add some results analysized by myself, for example, I want to add "E1 vs E2  E2 VS E3" in the rectangle (mean area). I tried to use inset statement in the proc boxplot, but shows syntax error. 

Any idea?

 

Thanks

boxplot.png

Grand Advisor
Posts: 17,308

Re: add label in boxplot

Show your code and log

Frequent Contributor
Posts: 76

Re: add label in boxplot

Hi,

I know my code is wrong. I was wondering if there is a way to add some text in the figure?

 

1893 proc boxplot data=box;

1894 plot lin_*group /
1895 nohlabel;
1896 label lin_ = 'No. of Lin+';
1897 inset P-Value / height=5 cfill=blank header='' pos=nw;
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: DATA, MAX, MEAN, MIN, NMAX, NMIN, NOBS, STDDEV.
ERROR 76-322: Syntax error, statement will be ignored.
1898 run;

 

Thanks,

Chen

Super User
Posts: 1,098

Re: add label in boxplot

you should try the data option in the inset statement as below, in the position option in place of the x and y coordinates. Please specify the x and y axis where you want to have the box positioned.

 

also p-value is not a variable name, could you please check the p-value variable name and mention the same in place of p-value.

 
proc boxplot data=box;

plot lin_*group /
nohlabel;
label lin_ = 'No. of Lin+';
inset P-Value / height=5 cfill=blank header='E1 vs E2  E2 VS E3' position=(x,y) data;

quit;

run;

 

 

Thanks,
Jag
Ask a Question
Discussion stats
  • 3 replies
  • 119 views
  • 0 likes
  • 3 in conversation