<?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 corr function with missing values in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102134#M740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm running a corr function in iml, e.g., &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;&amp;nbsp; use want_ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp; read all var _NUM_ into x[colname=permno];&lt;/P&gt;&lt;P&gt;&amp;nbsp; close want_ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp; corr=corr(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; print corr;&lt;/P&gt;&lt;P&gt;quit; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because my data has some missing value I get an execution error - "Invalid argument or operand; contains missing value."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this page which seems to suggest that I should be able to compute it with missing values: &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_langref_sect051.htm"&gt;http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_langref_sect051.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought the syntax would be corr(x,Pearson,pairwise); but that doesn't seem to work either. Any ideas? I'd like the correlation even though I'm missing just a few observations in the time series.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Jul 2012 20:46:49 GMT</pubDate>
    <dc:creator>coug914</dc:creator>
    <dc:date>2012-07-08T20:46:49Z</dc:date>
    <item>
      <title>corr function with missing values</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102134#M740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm running a corr function in iml, e.g., &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;&amp;nbsp; use want_ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp; read all var _NUM_ into x[colname=permno];&lt;/P&gt;&lt;P&gt;&amp;nbsp; close want_ret;&lt;/P&gt;&lt;P&gt;&amp;nbsp; corr=corr(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; print corr;&lt;/P&gt;&lt;P&gt;quit; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because my data has some missing value I get an execution error - "Invalid argument or operand; contains missing value."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this page which seems to suggest that I should be able to compute it with missing values: &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_langref_sect051.htm"&gt;http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_langref_sect051.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought the syntax would be corr(x,Pearson,pairwise); but that doesn't seem to work either. Any ideas? I'd like the correlation even though I'm missing just a few observations in the time series.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jul 2012 20:46:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102134#M740</guid>
      <dc:creator>coug914</dc:creator>
      <dc:date>2012-07-08T20:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: corr function with missing values</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102135#M741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The CORR function supports missing values:&lt;/P&gt;&lt;P&gt;proc iml;&lt;BR /&gt;use sashelp.class;&lt;BR /&gt;read all var _NUM_ into X;&lt;BR /&gt;X[{1 7 19 32}]=.;&lt;BR /&gt;c = corr(x);&lt;BR /&gt;print c;&lt;BR /&gt;print (countmiss(X,"col"));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, you can have all missing values and hte CORR function still doesn't return an error:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;X = j(10,3,.);&lt;BR /&gt;c = corr(x);&lt;BR /&gt;print c;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This assumes that you are running SAS/IML 9.22 or later. Please copy/paste the EXACT contents of the SAS log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, if you use optional arguments, be sure to enclose them in quotes&lt;/P&gt;&lt;P&gt;corr(x,"Pearson","pairwise");&lt;/P&gt;&lt;P&gt;as specified in the doc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jul 2012 21:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102135#M741</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-07-08T21:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: corr function with missing values</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102136#M742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I appear to be running sas 9.2. If I hit about sas it says SAS 9.2 TS Level 2M2, X64_VSPRO platform. Is that the issue?&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jul 2012 22:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102136#M742</guid>
      <dc:creator>coug914</dc:creator>
      <dc:date>2012-07-08T22:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: corr function with missing values</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102137#M743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that TS2M3 is the stealth SAS/Stat upgrade to 9.22.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jul 2012 22:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/corr-function-with-missing-values/m-p/102137#M743</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-07-08T22:56:13Z</dc:date>
    </item>
  </channel>
</rss>

