<?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: Market adjusted buy and hold return calculation using monthly return data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/627641#M185319</link>
    <description>&lt;P&gt;Thank you so much, mkeintz. I greatly appreciate for your kind advice. Your code works well.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 19:55:35 GMT</pubDate>
    <dc:creator>joon1</dc:creator>
    <dc:date>2020-02-26T19:55:35Z</dc:date>
    <item>
      <title>Market adjusted buy and hold return calculation using monthly return data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626592#M184842</link>
      <description>&lt;P&gt;Dear mkeniz,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have difficulty to understand the generated output by sas program you advised. I would like to compute the following BHAR:&lt;/P&gt;&lt;P&gt;Buy and Hold Abnormal return= ((1+return(m1))(1+return(m2))----(1+return(m12)) - (1+marketreturn(m1)(1+marketreturn(m2))---(1+marketreturn(m12)), where m1=closemonth-11, m2=closemonth-10, m3=closemonth-9, m4=closemonth-8, m5=closemonth-7, --- m12=closemonth&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As shown in the excel sheet, the computed values in three different ways&amp;nbsp; are different.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;computed value by original definition above: 0.052&lt;/P&gt;&lt;P&gt;computed value by log and exponential: 0.023&lt;/P&gt;&lt;P&gt;computed value by current sas program: 0.388&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be highly appreciative if you can give an idea how to fix program to generate the closest computed value by original definition (0.052).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data c4;&lt;BR /&gt;** Generate 12-month rolling benchmark returns **&lt;BR /&gt;** Do this only once and save in an array **;&lt;BR /&gt;if _n_=1 then do until (end_of_benchmark);&lt;BR /&gt;set benchmark end=end_of_benchmark;&lt;BR /&gt;array bmrk_ret {1990:2019,1:12} _temporary_ ;&lt;BR /&gt;array logplusone {12} _temporary_;&lt;BR /&gt;y=year(date);&lt;BR /&gt;m=month(date);&lt;BR /&gt;logplusone{m}=log(1+vwretd);&lt;BR /&gt;if n(of logplusone{*})=12 then bmrk_ret{y,m}=exp(sum(of logplusone{*}));&lt;BR /&gt;end;&lt;BR /&gt;set ch2;&lt;BR /&gt;by permno;&lt;BR /&gt;if first.permno then call missing(of logplusone{*});&lt;BR /&gt;m=month(date);&lt;BR /&gt;y=year(date);&lt;BR /&gt;logplusone{m}=log(1+ret);&lt;BR /&gt;if closemonth^=.;&lt;BR /&gt;if n(of logplusone{*})=12 then bhar=exp(sum(of logplusone{*})- bmrk_ret{y,m});&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Joon1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 02:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626592#M184842</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2020-02-22T02:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Market adjusted buy and hold return calculation using monthly return data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626752#M184887</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This might be a call to you?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 20:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626752#M184887</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-02-23T20:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Market adjusted buy and hold return calculation using monthly return data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626780#M184900</link>
      <description>&lt;P&gt;Hi ChrisNZ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your comment&lt;/P&gt;&lt;P&gt;Could you please clarify your comment? I don't understand your comment.&lt;/P&gt;&lt;P&gt;Joon1&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 02:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626780#M184900</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2020-02-24T02:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Market adjusted buy and hold return calculation using monthly return data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626795#M184909</link>
      <description>&lt;P&gt;You start your question with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Dear mkeniz,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which I assume means you directed your question to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 03:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/626795#M184909</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-02-24T03:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Market adjusted buy and hold return calculation using monthly return data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/627517#M185272</link>
      <description>&lt;P&gt;It looks like a misplaced close parens:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if n(of logplusone{*})=12 then bhar=exp(sum(of logplusone{*})- bmrk_ret{y,m});&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;bmrk_ret{y,m} was already exponentiated, so it should not be inside another EXP() function.&amp;nbsp; Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if n(of logplusone{*})=12 then bhar=exp(sum(of logplusone{*}))- bmrk_ret{y,m};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I've been mostly offline lately, so apologies for the tardy response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 14:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/627517#M185272</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-02-26T14:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Market adjusted buy and hold return calculation using monthly return data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/627641#M185319</link>
      <description>&lt;P&gt;Thank you so much, mkeintz. I greatly appreciate for your kind advice. Your code works well.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 19:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-adjusted-buy-and-hold-return-calculation-using-monthly/m-p/627641#M185319</guid>
      <dc:creator>joon1</dc:creator>
      <dc:date>2020-02-26T19:55:35Z</dc:date>
    </item>
  </channel>
</rss>

