<?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 Hierarhical model with spatial covariance structure in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Hierarhical-model-with-spatial-covariance-structure/m-p/622847#M29996</link>
    <description>&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a dataset that I am interested in the effect of A including two covariates (cov1 and cov2) on Y.&lt;/P&gt;&lt;P&gt;I want to use a hierarhical model because different levels of A were used in 10 years, in 300 locations (within each year) and I should take into account the non-independence of the observations within location-years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the model I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;mixed&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;dataset plots&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;year&lt;/SPAN&gt; location A&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; Y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;A&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov1&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov2&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;ddfm&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;satterth s outp&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;res&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
random intercept location A&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;subject&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;year&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I also want to take into account any spatial auto-correlation (I have the coordinates for each location). I extracted the residuals of the previous model (outp=res in the model statement) and using proc variogram, I concluded that the spherical covariance structure with nugget effect agrees the best with my data (better than Gaussian and exponential).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am not sure how to set up my model properly to account for G-side (random statement) and R-side (repeated) errors in proc mixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the model I am considering so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;mixed&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;dataset plots&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;year&lt;/SPAN&gt; location A&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; Y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;A&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov1&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov2&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;ddfm&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;satterth s&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
random intercept location A&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;subject&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;year&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
repeated &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;subject&lt;SPAN class="token operator"&gt;=A(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;year)&lt;/SPAN&gt; type&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sp&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;sph&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;lat long&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; local&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar models (I tried a few different repeated statements) resulted in non-positive Hessian matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas of the proper approach?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 11 Feb 2020 07:21:32 GMT</pubDate>
    <dc:creator>szm</dc:creator>
    <dc:date>2020-02-11T07:21:32Z</dc:date>
    <item>
      <title>Hierarhical model with spatial covariance structure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Hierarhical-model-with-spatial-covariance-structure/m-p/622847#M29996</link>
      <description>&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on a dataset that I am interested in the effect of A including two covariates (cov1 and cov2) on Y.&lt;/P&gt;&lt;P&gt;I want to use a hierarhical model because different levels of A were used in 10 years, in 300 locations (within each year) and I should take into account the non-independence of the observations within location-years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the model I am using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;mixed&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;dataset plots&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;year&lt;/SPAN&gt; location A&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; Y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;A&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov1&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov2&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;ddfm&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;satterth s outp&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;res&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
random intercept location A&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;subject&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;year&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I also want to take into account any spatial auto-correlation (I have the coordinates for each location). I extracted the residuals of the previous model (outp=res in the model statement) and using proc variogram, I concluded that the spherical covariance structure with nugget effect agrees the best with my data (better than Gaussian and exponential).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I am not sure how to set up my model properly to account for G-side (random statement) and R-side (repeated) errors in proc mixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the model I am considering so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;mixed&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;dataset plots&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;all&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;year&lt;/SPAN&gt; location A&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; Y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;A&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov1&lt;SPAN class="token operator"&gt;|&lt;/SPAN&gt;cov2&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;ddfm&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;satterth s&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
random intercept location A&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;location&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;subject&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;year&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
repeated &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;subject&lt;SPAN class="token operator"&gt;=A(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;year)&lt;/SPAN&gt; type&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;sp&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;sph&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;lat long&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; local&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar models (I tried a few different repeated statements) resulted in non-positive Hessian matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas of the proper approach?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all in advance&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Feb 2020 07:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Hierarhical-model-with-spatial-covariance-structure/m-p/622847#M29996</guid>
      <dc:creator>szm</dc:creator>
      <dc:date>2020-02-11T07:21:32Z</dc:date>
    </item>
  </channel>
</rss>

