<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to include multiple variables in PROC SGPLOT or SGPANEL in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-include-multiple-variables-in-PROC-SGPLOT-or-SGPANEL/m-p/808566#M15981</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array temp (*) _NUMERIC_ val1-val10;

do client=1 to 400;
do j=1 to dim(temp);
temp(j)=ceil(rand('integer',1,10) + rand("normal", mod(client, 5), rand('bernoulli', rand('integer',1,10)/10))) ;
end;
client_id=cats("id_", client);
outcome= rand('bernoulli', mod(client, 3)/2);
output;
end;

drop client j;

run;

proc format;
value outy
0='deceased'
1='survived'
;
run;


ods graphics on;
proc sgplot data=test;
format outcome outy.;
title 'AST overall value by survival';
vbox val1 / category=outcome;
run;

proc transpose data=test out=long(rename=(col1=value));
by client_id outcome notsorted;
var val1-val10;
run;

proc sgpanel data=long;
panelby _name_;
format outcome outy.;
vbox value / category=outcome;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 870px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70577iB60C332EBCB3C184/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 14:25:03 GMT</pubDate>
    <dc:creator>acordes</dc:creator>
    <dc:date>2022-04-19T14:25:03Z</dc:date>
    <item>
      <title>How to include multiple variables in PROC SGPLOT or SGPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-include-multiple-variables-in-PROC-SGPLOT-or-SGPANEL/m-p/808318#M15980</link>
      <description>&lt;P&gt;I am comparing median laboratory values and mortality. &amp;nbsp;I have 10 different labs on about 400 patients. &amp;nbsp;I have created a box and whisker plot for each lab individually and mortality - see simple example code below. &amp;nbsp;I would like them to all be included in one panel such as with sgpanel but since they are separate variables, I haven't been able to figure it out. &amp;nbsp;They would each require their own Y axis since they have different scales.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also love help with labeling mortality (outcome,&amp;nbsp;0 = deceased, 1 = survived) on the x-axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=eb;&lt;BR /&gt;title 'AST overall value by survival';&lt;BR /&gt;vbox AST / category=outcome;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 14:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-include-multiple-variables-in-PROC-SGPLOT-or-SGPANEL/m-p/808318#M15980</guid>
      <dc:creator>pdrsn13</dc:creator>
      <dc:date>2022-04-18T14:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to include multiple variables in PROC SGPLOT or SGPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-include-multiple-variables-in-PROC-SGPLOT-or-SGPANEL/m-p/808566#M15981</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
array temp (*) _NUMERIC_ val1-val10;

do client=1 to 400;
do j=1 to dim(temp);
temp(j)=ceil(rand('integer',1,10) + rand("normal", mod(client, 5), rand('bernoulli', rand('integer',1,10)/10))) ;
end;
client_id=cats("id_", client);
outcome= rand('bernoulli', mod(client, 3)/2);
output;
end;

drop client j;

run;

proc format;
value outy
0='deceased'
1='survived'
;
run;


ods graphics on;
proc sgplot data=test;
format outcome outy.;
title 'AST overall value by survival';
vbox val1 / category=outcome;
run;

proc transpose data=test out=long(rename=(col1=value));
by client_id outcome notsorted;
var val1-val10;
run;

proc sgpanel data=long;
panelby _name_;
format outcome outy.;
vbox value / category=outcome;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 870px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70577iB60C332EBCB3C184/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-include-multiple-variables-in-PROC-SGPLOT-or-SGPANEL/m-p/808566#M15981</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-04-19T14:25:03Z</dc:date>
    </item>
  </channel>
</rss>

