<?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 Bayesian Random Mixed Models in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/691845#M33387</link>
    <description>&lt;P&gt;Hi, I am working with a data, which is at customer x week x tier level and has other features- P1, P2, P3 and Sales. Treating Sales as a dependent variable and P1, P2 and P3 as independent variables I am planning to run a Bayesian regression model. Additionally, I would like to randomize this model at tier level(there are 4 tiers in the data). For e.g- if Model is Sales = B0+ B1*P1+&amp;nbsp;B2*P2+B3*P3, I would expect 4 intercepts B0 for each tier, 4 slopes B1 for each tier and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I explored GENMOD, but it seems GENMOD does not support randomization. Next, I tested BGLIMM which seems to have worked best in my case but my current SAS version does not support BGLIMM. Lastly, I am left with only PROC MCMC. I have used below codes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc mcmc data=baymdb outpost=PostOut_re nmc=100 thin=5;&lt;BR /&gt;ods select Parameters REparameters PostSumInt tracepanel;&lt;BR /&gt;parms B0-B3 S2 ;&lt;BR /&gt;parms S2g 1;&lt;BR /&gt;prior B: ~ normal(0, var=1e6);&lt;BR /&gt;prior S2 ~ igamma(0.01, scale = 0.01);&lt;BR /&gt;prior S2g ~ general(0, lower=0);&lt;BR /&gt;random theta ~ normal(0,var=S2g) subject=tier ;&lt;BR /&gt;Mu = B0 + B1*P1 + B2*P2 +B3*P3 + theta ;&lt;BR /&gt;model LN_AHC_ENTNRX_ONE ~ normal(Mu,var=S2);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the output of the above model does not have intercepts and estimates at tier level. I am seeing only overall level B0, B1, B2, B3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything I am missing or if there is any other procedure which I could use? Thanks in advance for your help.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 14:31:10 GMT</pubDate>
    <dc:creator>sham414</dc:creator>
    <dc:date>2020-10-15T14:31:10Z</dc:date>
    <item>
      <title>Bayesian Random Mixed Models</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/691845#M33387</link>
      <description>&lt;P&gt;Hi, I am working with a data, which is at customer x week x tier level and has other features- P1, P2, P3 and Sales. Treating Sales as a dependent variable and P1, P2 and P3 as independent variables I am planning to run a Bayesian regression model. Additionally, I would like to randomize this model at tier level(there are 4 tiers in the data). For e.g- if Model is Sales = B0+ B1*P1+&amp;nbsp;B2*P2+B3*P3, I would expect 4 intercepts B0 for each tier, 4 slopes B1 for each tier and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I explored GENMOD, but it seems GENMOD does not support randomization. Next, I tested BGLIMM which seems to have worked best in my case but my current SAS version does not support BGLIMM. Lastly, I am left with only PROC MCMC. I have used below codes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc mcmc data=baymdb outpost=PostOut_re nmc=100 thin=5;&lt;BR /&gt;ods select Parameters REparameters PostSumInt tracepanel;&lt;BR /&gt;parms B0-B3 S2 ;&lt;BR /&gt;parms S2g 1;&lt;BR /&gt;prior B: ~ normal(0, var=1e6);&lt;BR /&gt;prior S2 ~ igamma(0.01, scale = 0.01);&lt;BR /&gt;prior S2g ~ general(0, lower=0);&lt;BR /&gt;random theta ~ normal(0,var=S2g) subject=tier ;&lt;BR /&gt;Mu = B0 + B1*P1 + B2*P2 +B3*P3 + theta ;&lt;BR /&gt;model LN_AHC_ENTNRX_ONE ~ normal(Mu,var=S2);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the output of the above model does not have intercepts and estimates at tier level. I am seeing only overall level B0, B1, B2, B3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything I am missing or if there is any other procedure which I could use? Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 14:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/691845#M33387</guid>
      <dc:creator>sham414</dc:creator>
      <dc:date>2020-10-15T14:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bayesian Random Mixed Models</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/692100#M33391</link>
      <description>&lt;P&gt;They are in the model via the RANDOM statement, but you will need to add the MONITOR= option on the RANDOM statement to see their distributions actually reported in the output.&lt;/P&gt;
&lt;P&gt;random theta ~ normal(0,var=S2g) subject=tier monitor=(theta);&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 11:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/692100#M33391</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-10-16T11:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bayesian Random Mixed Models</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/692455#M33406</link>
      <description>&lt;P&gt;Thanks for the suggestion. This helped. I just had to made slight changes with the way I define intercept level random effect estimates:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;prior B: ~ normal(0, var=1e6);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prior S2 ~ igamma(0.01, scale = 0.01);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prior S2g ~ general(0, lower=0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;random b0 ~ normal(0,var=S2g) subject=tier monitor=(b0) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;random b1~ normal(0,var=S2g) subject=tier monitor=(b1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;random b2~ normal(0,var=S2g) subject=tier monitor=(b2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;random b2~ normal(0,var=S2g) subject=tier monitor=(b3);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mu = (B0+b0) + (B1+b1)*P1 + (B2+b2)*P2 +(B3+b3)*P3 ;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 09:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Bayesian-Random-Mixed-Models/m-p/692455#M33406</guid>
      <dc:creator>sham414</dc:creator>
      <dc:date>2020-10-19T09:06:34Z</dc:date>
    </item>
  </channel>
</rss>

