<?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: A simple transpose with multiple variables with a prefix, or different output to proc univariate in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797099#M33033</link>
    <description>&lt;HR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/417098"&gt;@eh51&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;
&lt;P&gt;This is a cool procedure. I got a warning that it is expiring though.&amp;nbsp; Thanks for the recommendation.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;PROC STDIZE is a SAS/STAT procedure.&amp;nbsp; The message about expiring soon is related to the license for SAS/STAT.&amp;nbsp; It is a bit odd to me that you don't also get a message about BASE SAS expiring.&amp;nbsp; I have "never" seen an installation were the various products expiration was not all the same date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Time to pay the bill. &lt;span class="lia-unicode-emoji" title=":bomb:"&gt;💣&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Feb 2022 22:01:28 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2022-02-17T22:01:28Z</dc:date>
    <item>
      <title>A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796716#M33009</link>
      <description>&lt;P&gt;I have this code to create a table of percentiles. It outputs a wide table. But imho a tall table would be easier to read, and it will fit better on an excel sheet with a SAS box/whiskers plot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked on this forum and elsewhere on how to transpose across multiple columns with a common prefix, and maybe this is real simple, but I have not found a solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another way to skin this cat would be to have proc univariate output a tall table instead of a wide table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any recommendations are appreciated.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc univariate data=work.w_run;
var w_avg;
by mycat;
output out=w_avg_out
pctlpts = 00, 01, 10, 25, 50, 75, 90, 99, 100
pctlpre = P_;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Obs&lt;/TD&gt;&lt;TD&gt;mycat&lt;/TD&gt;&lt;TD&gt;P_0&lt;/TD&gt;&lt;TD&gt;P_1&lt;/TD&gt;&lt;TD&gt;P_10&lt;/TD&gt;&lt;TD&gt;P_25&lt;/TD&gt;&lt;TD&gt;P_50&lt;/TD&gt;&lt;TD&gt;P_75&lt;/TD&gt;&lt;TD&gt;P_90&lt;/TD&gt;&lt;TD&gt;P_99&lt;/TD&gt;&lt;TD&gt;P_100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;TD&gt;-3.47517&lt;/TD&gt;&lt;TD&gt;-3.20683&lt;/TD&gt;&lt;TD&gt;8.96184&lt;/TD&gt;&lt;TD&gt;86.291&lt;/TD&gt;&lt;TD&gt;110.444&lt;/TD&gt;&lt;TD&gt;116.45&lt;/TD&gt;&lt;TD&gt;126.381&lt;/TD&gt;&lt;TD&gt;133.746&lt;/TD&gt;&lt;TD&gt;137.535&lt;/TD&g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;/TD&gt;&lt;TD&gt;62.953&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P_90&lt;/TD&gt;&lt;TD&gt;126.381&lt;/TD&gt;&lt;TD&gt;110.816&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P_99&lt;/TD&gt;&lt;TD&gt;133.746&lt;/TD&gt;&lt;TD&gt;128.516&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P_100&lt;/TD&gt;&lt;TD&gt;137.535&lt;/TD&gt;&lt;TD&gt;129.165&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 21:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796716#M33009</guid>
      <dc:creator>eh51</dc:creator>
      <dc:date>2022-02-16T21:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796719#M33011</link>
      <description>&lt;P&gt;So do the transposition:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input Obs	mycat $	P_0	P_1	P_10	P_25	P_50	P_75	P_90	P_99	P_100;
cards;
1	No	-3.47517	-3.20683	8.96184	86.291	110.444	116.45	126.381	133.746	137.535
2	Yes	-4.86	-3.308	0.19083	5.6582	15.096	62.953	110.816	128.516	129.165
;
run;
proc print;
run;

proc transpose data = have out = want(drop =_NAME_);
  var P_:;
  id mycat;
run;
proc print;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 21:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796719#M33011</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2022-02-16T21:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796721#M33012</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=w_avg_out out=want;
id mycat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can be as simple as above, if the VAR statement is excluded all numeric values are included.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 21:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796721#M33012</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-16T21:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796725#M33013</link>
      <description>&lt;P&gt;It might be easier/cleaner in the long run to use a different procedure to do the display and calculation.&lt;/P&gt;
&lt;P&gt;Consider this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.class;
  class sex ;
  var weight;
  table weight*(min P1 p10 p25 p50 p75 p95 p99 max),
        sex 
  ;
run;
&lt;/PRE&gt;
&lt;P&gt;At least I think P0 is Min and P100 is max.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One advantage of a report procedure like tabulate is besides controlling layout you can do things like getting the overall distribution in one table by adding ONE WORD:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.class;
  class sex ;
  var weight;
  table weight*(min P1 p10 p25 p50 p75 p95 p99 max),
        sex All
  ;
run;&lt;/PRE&gt;
&lt;P&gt;If you want separate similar tables for multiple variables&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.class;
  class sex age;
  var weight height;
  table weight*(min P1 p10 p25 p50 p75 p95 p99 max),
        ALL sex ;
  ;
  table height*(min P1 p10 p25 p50 p75 p95 p99 max),
        ALL sex ;
  ;
  table weight*(min P1 p10 p25 p50 p75 p95 p99 max),
        ALL Age ;
  ;
   table height*(min P1 p10 p25 p50 p75 p95 p99 max),
        ALL Age ;
  ;
run;
&lt;/PRE&gt;
&lt;P&gt;You could even "stack" the summarized variables into one table:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.class;
  class sex age;
  var weight height;
  table (weight height)*(min P1 p10 p25 p50 p75 p95 p99 max),
        sex ;
  ;

run;
&lt;/PRE&gt;
&lt;P&gt;You can use a Keylabel to assign different text than the default for the statistics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This actually just scratches the surface of what you do with this report procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 22:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796725#M33013</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-16T22:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796904#M33024</link>
      <description>&lt;P&gt;This might meet your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc stdize data=sashelp.class outstat=want out=_null_
   pctlpts = 00, 01, 10, 25, 50, 75, 90, 99, 100;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 254px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68586iFA47A080D8AB241B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 15:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/796904#M33024</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-02-17T15:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797069#M33031</link>
      <description>&lt;P&gt;I looked at proc tabulate, but the output data sets are also wide, though the display is tall. Thanks for the recommendation though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 20:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797069#M33031</guid>
      <dc:creator>eh51</dc:creator>
      <dc:date>2022-02-17T20:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797071#M33032</link>
      <description>&lt;P&gt;This is a cool procedure. I got a warning that it is expiring though.&amp;nbsp; Thanks for the recommendation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 20:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797071#M33032</guid>
      <dc:creator>eh51</dc:creator>
      <dc:date>2022-02-17T20:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: A simple transpose with multiple variables with a prefix, or different output to proc univariate</title>
      <link>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797099#M33033</link>
      <description>&lt;HR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/417098"&gt;@eh51&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;
&lt;P&gt;This is a cool procedure. I got a warning that it is expiring though.&amp;nbsp; Thanks for the recommendation.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;PROC STDIZE is a SAS/STAT procedure.&amp;nbsp; The message about expiring soon is related to the license for SAS/STAT.&amp;nbsp; It is a bit odd to me that you don't also get a message about BASE SAS expiring.&amp;nbsp; I have "never" seen an installation were the various products expiration was not all the same date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Time to pay the bill. &lt;span class="lia-unicode-emoji" title=":bomb:"&gt;💣&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Feb 2022 22:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/A-simple-transpose-with-multiple-variables-with-a-prefix-or/m-p/797099#M33033</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-02-17T22:01:28Z</dc:date>
    </item>
  </channel>
</rss>

