<?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: How to estimate a variance-covariance matrix for use in t-statistic? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691102#M33319</link>
    <description>&lt;P&gt;I haven't been able to find a solution yet, does anyone know of any similar threads that I can have a look at or anyone they think would know how to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2020 23:10:03 GMT</pubDate>
    <dc:creator>kwil</dc:creator>
    <dc:date>2020-10-12T23:10:03Z</dc:date>
    <item>
      <title>How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689411#M33232</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a set of buy and hold abnormal returns for periods of 6, 12, 24 and 36 months. I want to adjust the t-statistic used to test the significance of the means in order to account for the events being non-random. I would like to adjust the t-statistics for overlapping samples by adjusting the variance covariance matrix for the overlapping long run returns. I am using the methodology outlined in Lyon, Barber &amp;amp; Tsai (1999) but am really unsure how to implement this in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Set:&lt;/P&gt;&lt;P&gt;Firm Month&amp;nbsp;BHAR&lt;/P&gt;&lt;P&gt;x&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10%&lt;/P&gt;&lt;P&gt;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15%&lt;/P&gt;&lt;P&gt;z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-10%&lt;/P&gt;&lt;P&gt;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5%&lt;/P&gt;&lt;P&gt;z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40%&lt;/P&gt;&lt;P&gt;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 24&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20%&lt;/P&gt;&lt;P&gt;z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 24&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -10%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="kwil_0-1602028055920.png" style="width: 676px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50243iA3121C447FF04881/image-size/large?v=v2&amp;amp;px=999" role="button" title="kwil_0-1602028055920.png" alt="kwil_0-1602028055920.png" /&gt;&lt;/span&gt;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&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;&lt;P&gt;Any help would be really appreciated, thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 02:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689411#M33232</guid>
      <dc:creator>kwil</dc:creator>
      <dc:date>2020-10-07T02:28:30Z</dc:date>
    </item>
    <item>
      <title>How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689381#M33235</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a set of buy and hold abnormal returns for periods of 6, 12, 24 and 36 months. I want to adjust the t-statistic used to test the significance of the means in order to account for the events being non-random. I would like to adjust the t-statistics for overlapping samples by adjusting the variance covariance matrix for the overlapping long run returns. I am using the methodology outlined in Lyon, Barber &amp;amp; Tsai (1999) but am really unsure how to implement this in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Set:&lt;/P&gt;&lt;P&gt;Firm Month&amp;nbsp;BHAR&lt;/P&gt;&lt;P&gt;x&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10%&lt;/P&gt;&lt;P&gt;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15%&lt;/P&gt;&lt;P&gt;z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-10%&lt;/P&gt;&lt;P&gt;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5%&lt;/P&gt;&lt;P&gt;z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40%&lt;/P&gt;&lt;P&gt;y&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 24&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20%&lt;/P&gt;&lt;P&gt;z&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 24&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -10%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kwil_0-1602028055920.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50243iA3121C447FF04881/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kwil_0-1602028055920.png" alt="kwil_0-1602028055920.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated, thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 00:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689381#M33235</guid>
      <dc:creator>kwil</dc:creator>
      <dc:date>2020-10-07T00:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689400#M33236</link>
      <description>&lt;P&gt;I notice no one yet, has responded to your question.&amp;nbsp; There's nothing wrong with posting it here in the Programming forum, but I wonder if it might be seen by more qualified people if you posted it in one of the Analytics forums.&amp;nbsp; Just a thought.&amp;nbsp; Either way, I hope you find a good solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602034274456.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50247i51E23243BA9E4197/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602034274456.png" alt="jimbarbour_0-1602034274456.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 01:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689400#M33236</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-07T01:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689410#M33237</link>
      <description>Thanks! Will try posting there.</description>
      <pubDate>Wed, 07 Oct 2020 02:23:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689410#M33237</guid>
      <dc:creator>kwil</dc:creator>
      <dc:date>2020-10-07T02:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689465#M33238</link>
      <description>&lt;P&gt;I merged everything into one thread. I'm sure the experts will chime in at least as soon as Cary starts up &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 07:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/689465#M33238</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-07T07:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691102#M33319</link>
      <description>&lt;P&gt;I haven't been able to find a solution yet, does anyone know of any similar threads that I can have a look at or anyone they think would know how to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 23:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691102#M33319</guid>
      <dc:creator>kwil</dc:creator>
      <dc:date>2020-10-12T23:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691184#M33323</link>
      <description>&lt;P&gt;Calling out to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 10:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691184#M33323</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-13T10:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691195#M33324</link>
      <description>&lt;P&gt;This formula is a modification of the usual covariance estimate between two variables X and Y.&lt;/P&gt;
&lt;P&gt;However, it requires that the X and Y variables by time series, which means the observations are equally spaced in time, which your data are not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My suggestions:&lt;/P&gt;
&lt;P&gt;1. Do you have monthly data? If not, you can't directly apply the formula.&lt;/P&gt;
&lt;P&gt;2. Do you know how to manually create the usual covariance estimate for variables X and Y? If not, start there, since you can compare your answers with PROC CORR.&lt;/P&gt;
&lt;P&gt;3. Do you know how to perform matrix programming in SAS/IML? If not, applying the estimation process will be more complex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how you can use PROC IML to reproduce the usual covariance estimate. If you have monthly data, you can modify this method to get the time series covariance.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data=sashelp.class cov noprob; 
   var Height Weight;
   ods select Cov;
run;


/* Manual compuation. Reproduce convariance estimate and
   compare with PROC CORR. */
proc iml;
 
use sashelp.class; 
read all var "Height" into X; 
read all var "Weight" into Y; 
close sashelp.class;
 
n = nrow(X);           /* assume no missing values */
cX = X - X[:];         /* subtract mean to center X */
cY = Y - Y[:];         /* center Y */
cov = (cX` * cY) / (n-1);
print cov;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Oct 2020 10:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691195#M33324</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-10-13T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691721#M33364</link>
      <description>Hi Rick,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;I do have the data in a time series format - I have the monthly excess returns for each firm. However, i have no experience with matrix programming and am not sure how to do it.&lt;BR /&gt;&lt;BR /&gt;I am trying to test the significance of the mean returns for the 6 month, 12 month, 24 month and 36 month horizons using a normal t statistic. How would i set this up to then do the matrix programming in IML?&lt;BR /&gt;&lt;BR /&gt;Currently i have::&lt;BR /&gt;&lt;BR /&gt;Firm Month BHAR&lt;BR /&gt;a 1 0.01&lt;BR /&gt;a 2 0.05&lt;BR /&gt;a 3 0.07&lt;BR /&gt;b 1 0.9&lt;BR /&gt;b 2 0.51&lt;BR /&gt;b 3 0.01</description>
      <pubDate>Thu, 15 Oct 2020 02:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691721#M33364</guid>
      <dc:creator>kwil</dc:creator>
      <dc:date>2020-10-15T02:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to estimate a variance-covariance matrix for use in t-statistic?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691781#M33365</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp; i have no experience with matrix programming and am not sure how to do it.&amp;nbsp;How would i set this up to then do the matrix programming in IML?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best way to gain experience is to start writing programs. I have provided an example. You need to read the observations for group 'a' into the X vector and read the observations with group 'b' into the Y vector:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;use Have;
read all var {Firm Month BHAR};
close;

X = BHAR[ loc(Firm='a') ];
Y = BHAR[ loc(Firm='b') ];
print X Y;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Oct 2020 09:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-estimate-a-variance-covariance-matrix-for-use-in-t/m-p/691781#M33365</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-10-15T09:44:46Z</dc:date>
    </item>
  </channel>
</rss>

