<?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 Using the MATERN covariance structure in PROC MIXED in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224885#M11874</link>
    <description>&lt;P&gt;My long term question is how to duplicate a particular analysis in R but first I'm trying to understand the output from SAS.&amp;nbsp; Here is the analysis code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Blackcap example from the corrHLfit function in the R spaMM library;

* Input data;
  data test;
    input latitude longitude migStatus means pos;
    cards;
36.1291   -5.3469       0.0 161.4000   1
15.0522  -23.6010       0.0 162.2857   2
43.5226    4.7189       1.0 162.6111   3
28.6742  -17.7859       0.5 163.4400   4
32.6743  -16.9105       0.5 162.6667   5
28.1600  -17.1980       0.5 163.6667   6
28.4772  -16.4479       0.5 163.4000   7
41.5335    2.2991       1.0 162.6818   8
40.6653   -4.0871       1.5 162.3667   9
48.2850   16.9086       2.0 162.8800  10
-0.1671   37.0154       2.5 163.5000  11
47.8160    8.9887       2.0 163.7049  12
41.7425   12.4035       2.0 163.1667  13
55.7559   37.6197       2.5 163.8333  14
run;

* Run analysis;
  proc mixed data=test method=ml;
    model migStatus = means / solution;
    repeated / type=sp(matern)(latitude longitude);
  run;

/* Output:
 
    Covariance Parameter
        Estimates

 Cov Parm       Estimate

 SP(MATERN)       1.0000
 Smoothness       0.5000
 Residual         0.5263

*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't understand the "Cov Parm" estimates.&amp;nbsp; Even when I change the data, I get the same estimates for SP(MATERN) and Smoothness.&amp;nbsp; And given that the values certainly don't look like typical estimates (1.0 and 0.5), I'm wondering if these are just set to a default value and not fitted using maximum likelihood.&amp;nbsp; Can someone explain this output to me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2015 02:18:37 GMT</pubDate>
    <dc:creator>jbaldwin</dc:creator>
    <dc:date>2015-09-10T02:18:37Z</dc:date>
    <item>
      <title>Using the MATERN covariance structure in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224885#M11874</link>
      <description>&lt;P&gt;My long term question is how to duplicate a particular analysis in R but first I'm trying to understand the output from SAS.&amp;nbsp; Here is the analysis code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Blackcap example from the corrHLfit function in the R spaMM library;

* Input data;
  data test;
    input latitude longitude migStatus means pos;
    cards;
36.1291   -5.3469       0.0 161.4000   1
15.0522  -23.6010       0.0 162.2857   2
43.5226    4.7189       1.0 162.6111   3
28.6742  -17.7859       0.5 163.4400   4
32.6743  -16.9105       0.5 162.6667   5
28.1600  -17.1980       0.5 163.6667   6
28.4772  -16.4479       0.5 163.4000   7
41.5335    2.2991       1.0 162.6818   8
40.6653   -4.0871       1.5 162.3667   9
48.2850   16.9086       2.0 162.8800  10
-0.1671   37.0154       2.5 163.5000  11
47.8160    8.9887       2.0 163.7049  12
41.7425   12.4035       2.0 163.1667  13
55.7559   37.6197       2.5 163.8333  14
run;

* Run analysis;
  proc mixed data=test method=ml;
    model migStatus = means / solution;
    repeated / type=sp(matern)(latitude longitude);
  run;

/* Output:
 
    Covariance Parameter
        Estimates

 Cov Parm       Estimate

 SP(MATERN)       1.0000
 Smoothness       0.5000
 Residual         0.5263

*/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I don't understand the "Cov Parm" estimates.&amp;nbsp; Even when I change the data, I get the same estimates for SP(MATERN) and Smoothness.&amp;nbsp; And given that the values certainly don't look like typical estimates (1.0 and 0.5), I'm wondering if these are just set to a default value and not fitted using maximum likelihood.&amp;nbsp; Can someone explain this output to me?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 02:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224885#M11874</guid>
      <dc:creator>jbaldwin</dc:creator>
      <dc:date>2015-09-10T02:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using the MATERN covariance structure in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224941#M11880</link>
      <description>&lt;P&gt;Some quick testing seems to indicate that since all of the observations are "lumped" into the same subject, there is no movement away from the initial values. &amp;nbsp;I tried the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    input latitude longitude migStatus means pos;
	id=mod(pos,7);
    cards;
36.1291   -5.3469       0.0 61.4000   1
15.0522  -23.6010       0.0 162.2857   2
43.5226    4.7189       1.0 162.6111   3
28.6742  -17.7859       0.5 163.4400   4
32.6743  -16.9105       0.5 162.6667   5
28.1600  -17.1980       0.5 163.6667   6
28.4772  -16.4479       0.5 163.4000   7
41.5335    2.2991       1.0 162.6818   8
40.6653   -4.0871       1.5 162.3667   9
48.2850   16.9086       2.0 162.8800  10
-0.1671   37.0154       2.5 163.5000  11
47.8160    8.9887       2.0 163.7049  12
41.7425   12.4035       2.0 163.1667  13
55.7559   37.6197       2.5 163.8333  14
run;

* Run analysis;
  proc mixed data=test method=reml;
  class id;
    model migStatus = means / solution;
    repeated /subject=id type=sp(matern)(latitude longitude);
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This introduces subject to subject variability (note that it is all made up at this point). &amp;nbsp;The results from this were:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Covariance Parameter Estimates&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Cov Parm&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Subject&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Estimate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;SP(MATERN)&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.9001&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Smoothness&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.5211&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Residual&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0.7293&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;So it appears you need a subject= option in the REPEATED statement to move the estimates away from the initial values.&lt;/DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="center"&gt;It still results in a non-positive Hessian warning in the output, as well.&lt;/DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="center"&gt;And I have no idea why this is now centered, or how to get back to normal fomatting &lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;&lt;/DIV&gt;&lt;DIV align="center"&gt;Steve Denham&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Sep 2015 12:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224941#M11880</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-09-10T12:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using the MATERN covariance structure in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224944#M11882</link>
      <description>&lt;P&gt;I would never have guessed this, but try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=test method=reml;
  
    model migStatus = means / solution;
    repeated /subject=intercept type=sp(matern)(latitude longitude);
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This seems to solve both problems of moving off the initial values and getting rid of the non-positive definite Hessian output warning. &amp;nbsp;A subject= option is definitely needed, it was just lucky that I looked at the anisotropic spherical example above the Matern examples in the documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 12:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224944#M11882</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2015-09-10T12:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using the MATERN covariance structure in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224961#M11885</link>
      <description>&lt;P&gt;Excellent!&amp;nbsp; Thank you!&amp;nbsp; That makes everything match up between SAS and R.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For others who might have this issue&amp;nbsp;I offer the following Rosetta Stone:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SAS parameter = corrHLfit parameter &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SP(MATERN) = 1/rho&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Smoothness = nu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Residual = lambda&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS counts the fixed effects and the covariance terms as&amp;nbsp;parameters&amp;nbsp;in the construction&amp;nbsp;of the AIC statistic whereas the&amp;nbsp;corrHLfit&amp;nbsp;function in R only considers the fixed effects (i.e., adding in twice the number of parameters).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 14:07:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/224961#M11885</guid>
      <dc:creator>jbaldwin</dc:creator>
      <dc:date>2015-09-10T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using the MATERN covariance structure in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/225155#M11907</link>
      <description>&lt;P&gt;With a repeated statement: If you do not specify a subject, then each observation is considered a subject. Thus, there could be no correlation structure. If you specify subject=intercept, the entire dataset is considered to be one large subject, so that every observation could be correlated (depending on the correlation structure parameters).&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 13:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-the-MATERN-covariance-structure-in-PROC-MIXED/m-p/225155#M11907</guid>
      <dc:creator>lvm</dc:creator>
      <dc:date>2015-09-11T13:20:21Z</dc:date>
    </item>
  </channel>
</rss>

