<?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: Get the empirical CDF in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103887#M5493</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I'll divide the ecdf with total return and then times my biggest return number, that way it's standardized. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Apr 2013 03:24:16 GMT</pubDate>
    <dc:creator>JOLSAS</dc:creator>
    <dc:date>2013-04-10T03:24:16Z</dc:date>
    <item>
      <title>Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103881#M5487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset with a column 1 of stock return numbers, with each row representing a company. Now I'm supposed to calculate a new column 2, being the empirical cumulative distribution function (CDF) of column 1. I don't necessarily need the function itself, I just need to get the density number for each company. So basically, all the numbers in column 1 is supposed to follow this CDF, and each company has a different density number, based on its column 1 return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I've made myself clear...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I googled about it and found a "severity" procedure. Maybe my SAS system is too old but it says " Procedure SEVERITY not found." I wonder if there's a simple solution to my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 02:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103881#M5487</guid>
      <dc:creator>JOLSAS</dc:creator>
      <dc:date>2013-04-10T02:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103882#M5488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that means just sorting it and then dividing by the n for each order. &lt;/P&gt;&lt;P&gt;E.G. &lt;/P&gt;&lt;P&gt;Proc sort data=have; by column1; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;ecdf=_n_/number_of_companies;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;If I'm way off post then please post some more details.&lt;/P&gt;&lt;P&gt;Proc Severity is part of ETS package and you may not have that licensed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 02:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103882#M5488</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-10T02:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103883#M5489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I think your way would imply that the returns follow a uniform distribution, hence the difference between different ecdf's equals 1, which isn't really the case for my column 1.&lt;/P&gt;&lt;P&gt;My column 1 looks something like this:&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5940285.422&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15182646.036&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34539.400618&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4184974.0126&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3824416.2707&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 02:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103883#M5489</guid>
      <dc:creator>JOLSAS</dc:creator>
      <dc:date>2013-04-10T02:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103884#M5490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the definition of ECDF as far as I know it, and wikipedia:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://en.wikipedia.org/wiki/Empirical_distribution_function" title="http://en.wikipedia.org/wiki/Empirical_distribution_function"&gt;http://en.wikipedia.org/wiki/Empirical_distribution_function&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're looking for the distribution of the returns you can sum returns, still sort and then divide each return by the total return.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 03:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103884#M5490</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-10T03:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103885#M5491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This seems to make a lot of sense. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 03:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103885#M5491</guid>
      <dc:creator>JOLSAS</dc:creator>
      <dc:date>2013-04-10T03:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103886#M5492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BTW, Reeza, the ecdf is supposed to range from 0 to 1. But with the method above, my biggest ecdf is smaller than 0.3, and the smallest almost zero. It seems to me it needs some kind of standardization. Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 03:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103886#M5492</guid>
      <dc:creator>JOLSAS</dc:creator>
      <dc:date>2013-04-10T03:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103887#M5493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I'll divide the ecdf with total return and then times my biggest return number, that way it's standardized. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 03:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103887#M5493</guid>
      <dc:creator>JOLSAS</dc:creator>
      <dc:date>2013-04-10T03:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103888#M5494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I forgot about the cumulative part, you need to divide the running total by the total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;retain running_total;&lt;/P&gt;&lt;P&gt;running_total=running_total+column1;&lt;/P&gt;&lt;P&gt;ecdf=running_total/overaltotal;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 04:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103888#M5494</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-10T04:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103889#M5495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PROC SEVERITY is in the SAS/ETS product, but you can use PROC UNIVARIATE to get this automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc univariate data=sashelp.class noprint;&lt;/P&gt;&lt;P&gt;var weight;&lt;/P&gt;&lt;P&gt;cdfplot weight;&lt;/P&gt;&lt;P&gt;ods output CDFPlot=ECDF;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data set ECDF contains two columns, ECDFX and ECDFY, that contain the empirical CDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, the DATA step code works provided that all the data are nonmissing, but it should be adjusted to handle missing values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 10:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103889#M5495</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-04-10T10:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103890#M5496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I did and finally worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;retain running_total 0;&lt;/P&gt;&lt;P&gt;running_total+column1;&lt;/P&gt;&lt;P&gt;ecdf=running_total/overaltotal;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Rick you are right. I did first sort the data by column1 and I had checked that there was no missing data. So what it is is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by column1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain running_total 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; running_total+column1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ecdf=running_total/overaltotal;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 06:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103890#M5496</guid>
      <dc:creator>JOLSAS</dc:creator>
      <dc:date>2013-04-15T06:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103891#M5497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your program computes the cumulative proportion of total values.&amp;nbsp; If that's what you want, then fine. But the cumulative proportion is not equivalent to the ECDF unless the original data are sorted and nonmissing. So make sure you remember to sort and remove missings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 14:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103891#M5497</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-04-18T14:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103892#M5498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick is this an 9.3 option? I'm trying it in 9.2 with a class variable but I can't seem to figure out what the table name is. &lt;/P&gt;&lt;P&gt;Output Added:&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;Name:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNIVAR12&lt;/P&gt;&lt;P&gt;Label:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CDF Plot 1&lt;/P&gt;&lt;P&gt;Data Name:&amp;nbsp; GRSEG&lt;/P&gt;&lt;P&gt;Path:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Univariate.time_to_pay.CDFPlot.UNIVAR12&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE UNIVARIATE used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.70 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.71 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output Added:&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;Name:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNIVAR13&lt;/P&gt;&lt;P&gt;Label:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CDF Plot 1&lt;/P&gt;&lt;P&gt;Data Name:&amp;nbsp; GRSEG&lt;/P&gt;&lt;P&gt;Path:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Univariate.time_to_pay.CDFPlot.UNIVAR13&lt;/P&gt;&lt;P&gt;-------------&lt;/P&gt;&lt;P&gt;WARNING: Output 'CDFPlot' was not created.&amp;nbsp; Make sure that the output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object name, label, or path is spelled correctly.&amp;nbsp; Also, verify&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; that the appropriate procedure options are used to produce the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requested output object.&amp;nbsp; For example, verify that the NOPRINT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; option is not used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 15:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103892#M5498</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-24T15:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103893#M5499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you don't have ODS graphics turned on?&lt;/P&gt;&lt;P&gt;ODS graphics on;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 16:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103893#M5499</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-04-24T16:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get the empirical CDF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103894#M5500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup, that was it, thanks &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 18:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Get-the-empirical-CDF/m-p/103894#M5500</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-24T18:14:28Z</dc:date>
    </item>
  </channel>
</rss>

