<?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: cumulative percent in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216373#M53249</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;set have nobs=_nobs_;&lt;/P&gt;&lt;P&gt;cumulative_percent=_n_/_nobs_;&lt;/P&gt;&lt;P&gt;format cumulative_percent percent6.0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 05 Apr 2015 01:21:22 GMT</pubDate>
    <dc:creator>stat_sas</dc:creator>
    <dc:date>2015-04-05T01:21:22Z</dc:date>
    <item>
      <title>cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216368#M53244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset in which i'd like to create a variable which represents cumulative percent of observations. Can you please let me know whether this is possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Obs Company Sales Cumulative_Percent&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Abc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 350&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.33&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xyz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 500&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.66&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sdt&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 450&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 23:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216368#M53244</guid>
      <dc:creator>qsilver23</dc:creator>
      <dc:date>2015-04-04T23:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216369#M53245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possible in a variety of ways, one of the simplest is PROC FREQ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;table company/out=want outcum;&lt;/P&gt;&lt;P&gt;weight sales;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 23:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216369#M53245</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-04T23:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216370#M53246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, investigate PROC FREQ. It can give you Frequency Counts, Cum Frequency, Percent and Cum Percent. In addition, if you want it (and you are running SAS 9.3 or higher), you can get automatic graphs from PROC FREQ, too. You should be able to test this code, since SASHELP.SHOES is generally available on all installations of SAS.&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Cynthia&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods graphics on;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc freq data=sashelp.shoes;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title '1) taking all defaults';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; tables region;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc freq data=sashelp.shoes;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title '2) adding plots';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; tables region / plots=all;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc freq data=sashelp.shoes;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title '3) adding nocum';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; tables region / nocum;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc freq data=sashelp.shoes;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title '4) using nopercent';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; tables region / nopercent;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods output onewayfreqs=work.outfrq;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc freq data=sashelp.shoes;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title '5) making dataset -- output same as #1';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; tables region ;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=work.outfrq noobs;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; title '6) print only desired variables';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; var region frequency cumpercent;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 23:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216370#M53246</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-04-04T23:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216371#M53247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza. Will this be based on observation (row) or sales? Hoping to leverage your example on observation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Apr 2015 00:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216371#M53247</guid>
      <dc:creator>qsilver23</dc:creator>
      <dc:date>2015-04-05T00:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216372#M53248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza. Will this calc the cumulative percent by observation (row)? just want to make sure it's not based on sales. For example, if there are 3 rows, each row will be divided by 3. 1/3, 2/3, 3/3. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Apr 2015 00:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216372#M53248</guid>
      <dc:creator>qsilver23</dc:creator>
      <dc:date>2015-04-05T00:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216373#M53249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;set have nobs=_nobs_;&lt;/P&gt;&lt;P&gt;cumulative_percent=_n_/_nobs_;&lt;/P&gt;&lt;P&gt;format cumulative_percent percent6.0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Apr 2015 01:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216373#M53249</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-04-05T01:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216374#M53250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing!! Thank you so much. I really appreciate the prompt solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Apr 2015 01:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216374#M53250</guid>
      <dc:creator>qsilver23</dc:creator>
      <dc:date>2015-04-05T01:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative percent</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216375#M53251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, I misread your question. If you only have each company listed once you could remove the WEIGHT statement and it would calculate the row percent for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Apr 2015 23:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/cumulative-percent/m-p/216375#M53251</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-05T23:29:23Z</dc:date>
    </item>
  </channel>
</rss>

