<?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: Computing cross correlation for various time stamps in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421852#M22195</link>
    <description>&lt;P&gt;If you have SAS/ETS you could use:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_timeseries_sect024.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_timeseries_sect024.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Dec 2017 16:33:55 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2017-12-17T16:33:55Z</dc:date>
    <item>
      <title>Computing cross correlation for various time stamps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421844#M22194</link>
      <description>&lt;P&gt;Hello everybody.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set which contains the following variables: date, firm and abnormal return. I attached a sample file.&lt;/P&gt;&lt;P&gt;I want to compute the cross correlation of the returns between the firms at each time stamp and then compute a mean cross correlation for the whole time period. I am a beginner in SAS and guess I need matrix notation but already got stuck on converting my data into a matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greatly appreciate your help!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 15:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421844#M22194</guid>
      <dc:creator>Annalena</dc:creator>
      <dc:date>2017-12-17T15:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Computing cross correlation for various time stamps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421852#M22195</link>
      <description>&lt;P&gt;If you have SAS/ETS you could use:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_timeseries_sect024.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_timeseries_sect024.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 16:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421852#M22195</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-12-17T16:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Computing cross correlation for various time stamps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421856#M22196</link>
      <description>&lt;P&gt;Yes, I also found this procedure and have tried it but since there is very few explanations on syntax online I don't know how to implement it.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 17:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421856#M22196</guid>
      <dc:creator>Annalena</dc:creator>
      <dc:date>2017-12-17T17:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Computing cross correlation for various time stamps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421976#M22205</link>
      <description>&lt;P&gt;I'm not entirely sure what your desired result looks like here?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data= ret.abnormalreturn out=abnormalreturn;
   by date;
run;

proc transpose data=abnormalreturn out=abnormalreturn_wide(drop=date);
    by date;
    id firm;
    var ar;
run;

ods select PearsonCorr;
proc corr data=abnormalreturn_wide noprob outp=OutCorr
          nomiss;
var _numeric_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Dec 2017 14:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421976#M22205</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-18T14:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Computing cross correlation for various time stamps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421993#M22211</link>
      <description>&lt;P&gt;Hi draycut,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm not sure if this does what i want since i need to calculate cross correlation and not only correlations.&lt;/P&gt;&lt;P&gt;I figured something out this morning and not sure if this is correct:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=WORK.abnormalreturn out=WORK.SORTTempTableSorted;
	by Date Firm;
run;

proc transpose data=WORK.SORTTempTableSorted out=WORK.ARCor;
	var ar;
	id Firm;
	by Date;
run;

proc delete data=WORK.SORTTempTableSorted;
run;

proc timeseries data=ARcor outcrosscorr=crosscor;
	var _all_ ;
	id date interval=weekday; 
	crosscorr lag n ccf;
run;

proc means data=crosscor mean noprint;
	output out=cormean (drop=_type_ _freq_)
	mean(ccf)=roh ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does this lead to the same output as the code you suggested? And if this is wrong and I should use your code, how would I compute a mean across all the correlations since their not in the same column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 14:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/421993#M22211</guid>
      <dc:creator>Annalena</dc:creator>
      <dc:date>2017-12-18T14:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Computing cross correlation for various time stamps</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/425051#M22355</link>
      <description>&lt;P&gt;Cross-correlations are computed over multiple time periods (ie. lags) rather than over a single time point.&amp;nbsp; Also, one typically has a single dependent variable and multiple potential inputs, and a CCF analysis is performed to help you see how correlated other potential inputs are with that dependent variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wonder if a similarity analysis might be more in line with what you need…&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 20:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Computing-cross-correlation-for-various-time-stamps/m-p/425051#M22355</guid>
      <dc:creator>StatsMan</dc:creator>
      <dc:date>2018-01-04T20:41:31Z</dc:date>
    </item>
  </channel>
</rss>

