<?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: SAS code for event study estimated period in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534653#M146737</link>
    <description>Thank you for your time. If I get time I will explain the situation later.</description>
    <pubDate>Mon, 11 Feb 2019 23:05:43 GMT</pubDate>
    <dc:creator>abdulla</dc:creator>
    <dc:date>2019-02-11T23:05:43Z</dc:date>
    <item>
      <title>SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533811#M146408</link>
      <description>&lt;P&gt;Hi, I need urgent help for SAS code for the attached data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to know the code for an estimated event window(-5, -2) and event window for (-1, 1). I highlighted the event date.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 03:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533811#M146408</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-08T03:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533826#M146414</link>
      <description>&lt;P&gt;Welcome to the SAS forum. You haven't provided enough information to help you out here. How do you know it goes from -5 to 2? Why those rows, what's the logic in identifying those records? Have you tried anything so far?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In general, you're more likely to get a response if you post your question and data directly into the forum, rather than as an attachment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
informat permno $8. date yymmdd10. returns value_weighted_return equal_weighted_Return 32.7;
input PERMNO $  Date    Returns     value_weighted_return   equal_weighted_Return;
cards;
10696   20100104    0.019596    0.017045    0.019077 
10696   20100105    0.004248    0.003362    0.002451 
10696   20100106    -0.00423    0.001769    0.00318
10696   20100107    -0.004653   0.002821    0.006834
10696   20100108    -0.011179   0.004161    0.007224
10696   20100111    0.005344    0.001122    0.003547
10696   20100112    -0.008792   -0.011004   -0.010224
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;10696   20100113    0.008457    0.008537    0.008648&lt;/STRONG&gt;&lt;/FONT&gt;
10696   20100114    -0.002864   0.002293    0.004398
10696   20100115    -0.016615   -0.011348   -0.008675
10838   20100618    -0.032258   0.001659    0.002824
10838   20100621    -0.044444   -0.004353   -0.006434
10838   20100622    -0.046395   -0.016232   -0.013948
10838   20100623    -0.000122   -0.003042   -0.002017
10838   20100624    0.012195    -0.016297   -0.012466
10838   20100625    0.024096    0.006027    0.010236
10838   20100628    -0.047059   -0.003338   -0.004938
10838   20100629    -0.037037   -0.032917   -0.031228
10838   20100630    -0.012821   -0.009028   -0.00558
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;10838   20100701    -0.025974   -0.004084   -0.007698&lt;/STRONG&gt;&lt;/FONT&gt;
10838   20100702    0.02    -0.004793   -0.00443
10838   20100706    -0.08366    0.003311    -0.00643
;;;;
run;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I need urgent help for SAS code for the attached data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to know the code for an estimated event window(-5, -2) and event window for (-1, 1). I highlighted the event date.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 04:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533826#M146414</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-08T04:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533835#M146417</link>
      <description>&lt;P&gt;The window is from (-5 to -2). The highlighted one is the day of an event. I posted this as an example. My file is super big. If I get code for this example I can apply that for the whole data set.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 04:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533835#M146417</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-08T04:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533837#M146418</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The window is from (-5 to -2). The highlighted one is the day of an event. I posted this as an example. My file is super big. If I get code for this example I can apply that for the whole data set.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is the logic to identify those two rows though? How do you know that's the 'day of an event'? I see nothing that uniquely identifies those rows.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 04:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533837#M146418</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-08T04:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533848#M146421</link>
      <description>-5 to -2 is not two rows. The highlighted ones are the day of an event. These are just an example, not the real one. The real file is super big. Please have a good idea about an event study. Then you will see the logic of estimation window and evaluation window.</description>
      <pubDate>Fri, 08 Feb 2019 05:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533848#M146421</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-08T05:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533965#M146451</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;-5 to -2 is not two rows. The highlighted ones are the day of an event. These are just an example, not the real one. The real file is super big. Please have a good idea about an event study. Then you will see the logic of estimation window and evaluation window.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;WHY those dates? What rule based on values in the data set tells us those two records are any more important in determining a "window".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where do 5 and -2 come from. Neither of those values is in the data.&lt;/P&gt;
&lt;P&gt;The highlighted rows are the "day of an event". There are possible date values but I would suspect the dates are &lt;STRONG&gt;seven&lt;/STRONG&gt; months apart, so not a "day" in any apparent form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without a lot more detail about what the file represents I don't see anything defining&amp;nbsp; "estimation window and evaluation window"&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 15:33:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/533965#M146451</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-08T15:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534087#M146479</link>
      <description>You should know first what event study is. Without knowing anything properly, please don't ask logic behind anything. It is like a childish question for someone who has idea about event study.</description>
      <pubDate>Fri, 08 Feb 2019 23:01:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534087#M146479</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-08T23:01:57Z</dc:date>
    </item>
    <item>
      <title>Event study estimation window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534088#M146485</link>
      <description>&lt;P&gt;Hi, I need urgent help for SAS code for the attached data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to know the code for an estimated event window(-5, -2) and an evaluation window for (-1, 1). I highlighted the event dates. This is just an example. My real data is huge. If anyone can give the code for this example, I can apply that to my real data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 00:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534088#M146485</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-09T00:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534101#M146488</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;You should know first what event study is. Without knowing anything properly, please don't ask logic behind anything. It is like a childish question for someone who has idea about event study.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since Wikipedia only has an entry for "event window" on the page: &lt;A href="https://en.wikipedia.org/wiki/Event_study" target="_blank"&gt;https://en.wikipedia.org/wiki/Event_study&lt;/A&gt; and does not define the term it strongly implies that the user has to know what an "event" is and what the duration of an "event window" would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is apparently no standard or fixed definition though it does seem to have some sort of time component. If I am incorrect with this statement please post somewhere I can find a standard definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find at &lt;A href="https://eventstudymetrics.com/index.php/9-steps-to-follow-when-performing-a-short-time-study/" target="_blank"&gt;https://eventstudymetrics.com/index.php/9-steps-to-follow-when-performing-a-short-time-study/&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Once you have chosen a model and gathered all necessary data for expected return estimation, you need to determine the estimation window and the event window. The two windows do not overlap, i.e., the trading days prior to the event day which are part of the event window are not part of the estimation window. The estimation window is the period of trading days (before the event date) that is used to estimate the expected return for each asset and each event (using the constant mean return model, the market model, or any other of the aforementioned models). The event window is the period of trading days over which you want to calculate abnormal returns. An event window of one day, abbreviated [0], only includes the event day itself. In many studies the maximum event window includes 41 trading days symmetrically surrounding the identified event day, abbreviated [-20,+20].&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So if your -5 and 2 is supposed to mean 5 days before and 2 days after a given date, what is so hard about saying that?&lt;/P&gt;
&lt;P&gt;But that still brings up -&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;How&amp;nbsp; do we tell from your sample data in a generic values of the data what dates are of interest? And if the interval is going to change how to determine the different interval.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt; To write a program we need rules that use the&amp;nbsp; data.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have a date that you want to compare an interval then you may want INTNX or INTCK functions. But you will need to tell us how to 1) determine which date is the base date, 2) how to determine the interval for any of those given base dates and 3) what the resulting data set is supposed to look like with the identified intervals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example of finding 5 days before and 2 days after a given date:&lt;/P&gt;
&lt;PRE&gt;data example;
   x='15JAN2019'd;
   fivedaysprior = intnx('day',x,-5);
   twodaysafter = intnx('day',x,2);
   format x fivedaysprior twodaysafter date9.;
run;&lt;/PRE&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>Sat, 09 Feb 2019 00:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534101#M146488</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-09T00:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534113#M146492</link>
      <description>Please check the attachment I have just posted in my previous post. That contains the actual data. And I need to know the code for the following window&lt;BR /&gt;(estimate the parameters in the period -250,-10).&lt;BR /&gt;It is like before the event day(which is different for different stock) you have to select (-250, -10) days for every group (by permno) then you have to find regression. For me regreesion is not a problem. The problem is the event date for each group(permno) is different and the (-250, -10) period will be different for different stock . Now how will I code so that I can get my period in a work file. I have delete the other observations which are not in the (-250, -10) period from the event day.&lt;BR /&gt;By the way I highlighted the event day. And my Permno are of 400 different stocks. I just gave you two stocks as an example.</description>
      <pubDate>Sat, 09 Feb 2019 00:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534113#M146492</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-09T00:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534217#M146549</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;You should know first what event study is. Without knowing anything properly, please don't ask logic behind anything. It is like a childish question for someone who has idea about event study.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That isn't very polite. Please remember you're asking on a &lt;STRONG&gt;programming&lt;/STRONG&gt; forum for help. If you have subject specific terms, it is up to you to define that or post on a subject specific forum. Good Luck.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534217#M146549</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-10T00:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534566#M146700</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Please check the attachment I have just posted in my previous post. That contains the actual data. And I need to know the code for the following window&lt;BR /&gt;(estimate the parameters in the period -250,-10).&lt;BR /&gt;It is like before the event day(which is different for different stock) you have to select (-250, -10) days for every group (by permno) then you have to find regression. For me regreesion is not a problem. The problem is the event date for each group(permno) is different and the (-250, -10) period will be different for different stock . Now how will I code so that I can get my period in a work file. I have delete the other observations which are not in the (-250, -10) period from the event day.&lt;BR /&gt;By the way I highlighted the event day. And my Permno are of 400 different stocks. I just gave you two stocks as an example.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And my program code cannot determine what you may have highlighted as an example and really cannot tell which base date you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A rule to&amp;nbsp;allow the data to tell which is the date of interest for each event&amp;nbsp;like "earliest date for a Permno where variable x exceeds value y" or "last date some value occurs", or value changes by z amount or greater. Something that can identify the date of the event in question.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 18:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534566#M146700</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-11T18:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for event study estimated period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534653#M146737</link>
      <description>Thank you for your time. If I get time I will explain the situation later.</description>
      <pubDate>Mon, 11 Feb 2019 23:05:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-event-study-estimated-period/m-p/534653#M146737</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-02-11T23:05:43Z</dc:date>
    </item>
  </channel>
</rss>

