<?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: Custom Correlation Matrix in Proc Glimmix &amp;amp; Genmod in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644518#M30915</link>
    <description>&lt;P&gt;Thank you very much for this Steve!&lt;/P&gt;&lt;P&gt;I'll run this in SAS and see how things unfold.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 May 2020 14:00:32 GMT</pubDate>
    <dc:creator>hakeem</dc:creator>
    <dc:date>2020-05-01T14:00:32Z</dc:date>
    <item>
      <title>Custom Correlation Matrix in Proc Glimmix &amp; Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644447#M30911</link>
      <description>&lt;P&gt;I have binary outcome data to be fitted on a binary treatment effect and a continuous covariate. Each of my subjects have data collected over two weeks. Below is the correlation structure that I want to fit:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2020-05-01 at 11.00.11 AM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/38963i79B66F44E47B32C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2020-05-01 at 11.00.11 AM.png" alt="Screenshot 2020-05-01 at 11.00.11 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to run this in both glimmix and genmod, since I want to compare both conditional and marginal models. I can nest the AR(1) blocks in the weekday and weekend. However, is there a way for me to estimate psi and phi while forcing 0's in specific entries from the above correlation structure in glimmix, or even genmod?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd greatly appreciate advice and comments on this matter. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 03:08:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644447#M30911</guid>
      <dc:creator>hakeem</dc:creator>
      <dc:date>2020-05-01T03:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Correlation Matrix in Proc Glimmix &amp; Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644505#M30914</link>
      <description>&lt;P&gt;Absolutely no guarantees on this. This is for GLIMMIX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fit the AR(1) within weekday and weekend and save the covariance matrices from those.&amp;nbsp; In a datastep create a 3x4 matrix and its transpose, with 1's at the corners and zeroes everywhere else. Now get all 4 matrices into one that matches the schema shown.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the PARMS statement and the pdata= option, load this matrix as the covariance structure.&amp;nbsp; You will need to use HOLD to fix the values for the upper and lower blocks, and all the desired zeroes (45 entries).&amp;nbsp; In the end, only 4 parameters will be estimated.&amp;nbsp; If the covariance matrix is positive definite, then the 2 parameters for psi and 2 for phi should be equal. This assumes that 1 is a good starting value for the estimation process for these parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There might be a way using the type=lin(q) and the ldata= option, but I would be even more cautious about giving advice on that as I have never used that structure.&amp;nbsp; Still, Google is your friend and there might be something out there on the interwebs where someone has used this approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I can tell, GENMOD doesn't have anything equivalent to this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, as for marginal and conditional estimates, you can get both from GLIMMIX.&amp;nbsp; To get the marginal estimates, include a residual option in the RANDOM statement with method=MSPL in the PROC GLIMMIX statement.&amp;nbsp; For the conditional fit, delete the residual option and change to method=laplace or method=quad.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck - this is a complex analysis and fitting this model will be as much art as technique.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 12:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644505#M30914</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-01T12:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Correlation Matrix in Proc Glimmix &amp; Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644518#M30915</link>
      <description>&lt;P&gt;Thank you very much for this Steve!&lt;/P&gt;&lt;P&gt;I'll run this in SAS and see how things unfold.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 14:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Custom-Correlation-Matrix-in-Proc-Glimmix-amp-Genmod/m-p/644518#M30915</guid>
      <dc:creator>hakeem</dc:creator>
      <dc:date>2020-05-01T14:00:32Z</dc:date>
    </item>
  </channel>
</rss>

