<?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: rank inverse-weighting scheme in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/643202#M30800</link>
    <description>Thank you so much @ FreelanceReinhard, it worked awesomely. Thank you once again.</description>
    <pubDate>Mon, 27 Apr 2020 06:00:28 GMT</pubDate>
    <dc:creator>Princeelvisa</dc:creator>
    <dc:date>2020-04-27T06:00:28Z</dc:date>
    <item>
      <title>rank inverse-weighting scheme</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/642171#M30710</link>
      <description>&lt;P&gt;Please i need help with writing a code to calculate the equation below ...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="fontstyle0"&gt;It is a rank inverse-weighting scheme that assigns higher weights to more recent observations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="fontstyle0"&gt;For each fund &lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;j &lt;/SPAN&gt;&lt;SPAN class="fontstyle0"&gt;and quarter &lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;t &lt;/SPAN&gt;&lt;SPAN class="fontstyle0"&gt;, i want to compute the weighted average of &lt;/SPAN&gt;&lt;SPAN class="fontstyle3"&gt;β &lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;j&lt;/SPAN&gt;&lt;SPAN class="fontstyle3"&gt;,&lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;t &lt;/SPAN&gt;&lt;SPAN class="fontstyle0"&gt;during the fund’s history up to quarter &lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;t&lt;/SPAN&gt;&lt;SPAN class="fontstyle0"&gt;, with weights that vary inversely with the distance of the coefficients from quarter &lt;/SPAN&gt;&lt;SPAN class="fontstyle2"&gt;t&lt;/SPAN&gt;&amp;nbsp;. Thank you.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 307px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38574iBC57F1FAF42FC4D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 06:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/642171#M30710</guid>
      <dc:creator>Princeelvisa</dc:creator>
      <dc:date>2020-04-23T06:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: rank inverse-weighting scheme</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/642246#M30729</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/156387"&gt;@Princeelvisa&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your input dataset is sorted by &lt;FONT face="courier new,courier"&gt;j&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;t&lt;/FONT&gt;&amp;nbsp;, where &lt;FONT face="courier new,courier"&gt;t=1, 2, 3,&lt;/FONT&gt; ... (cf. below test dataset HAVE), you can use the code suggested below (creating dataset WANT) for the computation of&amp;nbsp;&lt;EM&gt;FH&lt;SUB&gt;j,t&lt;/SUB&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create sample data */

data have;
input j t beta;
cards;
1 1 100
1 2 110
1 3 108
1 4 117
1 5 120
2 1 200
2 2 222
2 3 212
2 4 228
;

/* Compute FH values */

data want(drop=_:);
array _b[999] _temporary_;
call missing(of _b[*]);
do until(last.j);
  set have;
  by j;
  _b[t]=beta;
end;
do until(last.j);
  set have;
  by j;
  FH=0; _w=0;
  do _h=1 to t;
    FH+_b[t-_h+1]/_h;
    _w+1/_h;
  end;
  FH=FH/_w;
  output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This assumes at most 999 quarters per fund (see array dimension).&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 14:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/642246#M30729</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-04-23T14:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: rank inverse-weighting scheme</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/643202#M30800</link>
      <description>Thank you so much @ FreelanceReinhard, it worked awesomely. Thank you once again.</description>
      <pubDate>Mon, 27 Apr 2020 06:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/rank-inverse-weighting-scheme/m-p/643202#M30800</guid>
      <dc:creator>Princeelvisa</dc:creator>
      <dc:date>2020-04-27T06:00:28Z</dc:date>
    </item>
  </channel>
</rss>

