<?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: Eventstudy: Can I use conditioning like: if row 1 satisfies a criteria, use row 2 for calculatio in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Eventstudy-Can-I-use-conditioning-like-if-row-1-satisfies-a/m-p/523310#M142175</link>
    <description>&lt;P&gt;Lucy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per my response to your other posting, do you have a daily price file.&amp;nbsp; If so, please show us what it looks like, and we can show how to make a trading-day calendar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Dec 2018 01:24:45 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2018-12-23T01:24:45Z</dc:date>
    <item>
      <title>Eventstudy: Can I use conditioning like: if row 1 satisfies a criteria, use row 2 for calculation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eventstudy-Can-I-use-conditioning-like-if-row-1-satisfies-a/m-p/523238#M142154</link>
      <description>&lt;P&gt;Hello SAS gurus,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am calculating the cumulative abnormal return for an event study. I used the event window of (-180, +1). 0 is the event; +1 day is the next day of the event. I suppose to calculate +1 day in workdays only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the example&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;datalines&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;below. In this file, I have some variables for one stock: date,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;eventdate, ticker $, mrkReturn (return of the market), return (of this stock), before (#of days before/after the event date, before=date-eventdate), and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;wday&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;(check the weekday of each date, from 2=monday to 6=friday).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data now;
input date eventdate ticker $ mrkReturn return before wday;
datalines;
20120830 20120831 AA -0.007806 -0.01171 -1 5
20120831 20120831 AA 0.005073 0.014218 0 6
20120904 20120831 AA -0.001166 -0.01635 4 3
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Normally, if the event date&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fall&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in (2,5), that's fine because the +1 day I want to use to calculate the abnormal return will be the following day (3,6 respectively). However, if the event day falls in wday=6 (Friday), I need to calculate the abnormal return on Monday (skip Sat, Sunday, and in this case, it even skipped Monday (2012/09/03-the labor day of 2012) because it is not a trading day). Moreover, in this file the variable before = 4 while I need to make the variable "before" = 1 for later calculation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my questions are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I make a program that&amp;nbsp;automatically recognizes the following &lt;U&gt;&lt;STRONG&gt;trading day (not weekend or holidays)&lt;/STRONG&gt;&lt;/U&gt; as a "+1" day of the event and sets&lt;SPAN&gt;&amp;nbsp;the&amp;nbsp;&lt;/SPAN&gt;"before" variable =1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that likely that I can create a code and assign "if EventDate = Date = Friday, then retain &amp;amp; write the next row (which record data for a trading day) to output table &amp;amp; set the variable "before" of that row = 1"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Dec 2018 08:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eventstudy-Can-I-use-conditioning-like-if-row-1-satisfies-a/m-p/523238#M142154</guid>
      <dc:creator>LucyDang</dc:creator>
      <dc:date>2018-12-22T08:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Eventstudy: Can I use conditioning like: if row 1 satisfies a criteria, use row 2 for calculatio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Eventstudy-Can-I-use-conditioning-like-if-row-1-satisfies-a/m-p/523310#M142175</link>
      <description>&lt;P&gt;Lucy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per my response to your other posting, do you have a daily price file.&amp;nbsp; If so, please show us what it looks like, and we can show how to make a trading-day calendar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Dec 2018 01:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Eventstudy-Can-I-use-conditioning-like-if-row-1-satisfies-a/m-p/523310#M142175</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-12-23T01:24:45Z</dc:date>
    </item>
  </channel>
</rss>

