<?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: How to specify input data set for PRIOR statement in PROC MIXED in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958886#M48020</link>
    <description>&lt;P&gt;I copy/pasted your question just for fun into Copilot - and it made me laugh!&lt;/P&gt;
&lt;P&gt;I don't have the skills to judge if the Copilot response is correct. Below the answer I got.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I understand your frustration with the documentation. Let's break it down step-by-step to create an example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="1"&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Run PROC MIXED and Output Base Densities&lt;/STRONG&gt;: First, you need to run PROC MIXED and output the "Base Densities" table to a data set. This will give you the format for the input data set you need for the &lt;CODE class="font-ligatures-none mx-0.5 rounded-[4px] border border-stroke-300 bg-spot-peach-200/50 px-1 py-px font-mono text-foreground-800 text-sm dark:bg-midnight-900"&gt;PRIOR&lt;/CODE&gt; statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=your_dataset;
   class factor1 factor2;
   model response = factor1 factor2 / solution;
   random intercept / subject=subject;
   ods output BaseDensities=base_densities;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Create the Input Data Set&lt;/STRONG&gt;: The &lt;CODE&gt;base_densities&lt;/CODE&gt; data set will contain the necessary columns (&lt;CODE&gt;Type&lt;/CODE&gt;, &lt;CODE&gt;Parm1&lt;/CODE&gt;, &lt;CODE&gt;Parm2&lt;/CODE&gt;, etc.). You can use this data set directly or modify it if needed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="ps-2"&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Run PROC MIXED with PRIOR Statement&lt;/STRONG&gt;: Now, use the &lt;CODE&gt;base_densities&lt;/CODE&gt; data set in the &lt;CODE&gt;PRIOR&lt;/CODE&gt; statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=your_dataset;
   class factor1 factor2;
   model response = factor1 factor2 / solution;
   random intercept / subject=subject;
   prior (intercept) / data=base_densities;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This should give you a concrete example of how to use the &lt;CODE&gt;PRIOR&lt;/CODE&gt; statement with &lt;CODE&gt;PROC MIXED&lt;/CODE&gt;. Does this help clarify things?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2025 22:56:37 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2025-02-10T22:56:37Z</dc:date>
    <item>
      <title>How to specify input data set for PRIOR statement in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958885#M48019</link>
      <description>&lt;P&gt;Does anyone know about an example of how to use PRIOR statement with PROC MIXED? The documentation is not very specific about how to specify the densities. This help &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_mixed_syntax12.htm#statug.mixed.priorstmt_data" target="_blank"&gt;page&lt;/A&gt; indicates that you can use a DATA= option to specify the prior distributions (?) but I can’t find a concrete example of how to do it. The page says you can do a run of the procedure an export a "Base Densities" ODS table to get an example, but I can't seem to get that to work. I'm trying to find an example of the input data set to use with DATA= in the PRIOR statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is from the documentation:&lt;/P&gt;
&lt;P&gt;"DATA= enables you to input the prior densities of the variance components used by the sampling algorithm. This data set must contain the &lt;CODE class="aa-varname"&gt;Type&lt;/CODE&gt; and &lt;CODE class="aa-varname"&gt;Parm1&lt;/CODE&gt;–&lt;CODE class="aa-varname"&gt;Parm&lt;/CODE&gt;&lt;SPAN class=" aa-mathtext"&gt;n&lt;/SPAN&gt; variables, where &lt;SPAN class=" aa-mathtext"&gt;n&lt;/SPAN&gt; is the largest number of parameters among each of the base densities. The format of the DATA= data set matches that created by PROC MIXED in the "Base Densities" table, so you can output the densities from one run and use them as input for a subsequent run."&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 22:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958885#M48019</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2025-02-10T22:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify input data set for PRIOR statement in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958886#M48020</link>
      <description>&lt;P&gt;I copy/pasted your question just for fun into Copilot - and it made me laugh!&lt;/P&gt;
&lt;P&gt;I don't have the skills to judge if the Copilot response is correct. Below the answer I got.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I understand your frustration with the documentation. Let's break it down step-by-step to create an example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL start="1"&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Run PROC MIXED and Output Base Densities&lt;/STRONG&gt;: First, you need to run PROC MIXED and output the "Base Densities" table to a data set. This will give you the format for the input data set you need for the &lt;CODE class="font-ligatures-none mx-0.5 rounded-[4px] border border-stroke-300 bg-spot-peach-200/50 px-1 py-px font-mono text-foreground-800 text-sm dark:bg-midnight-900"&gt;PRIOR&lt;/CODE&gt; statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=your_dataset;
   class factor1 factor2;
   model response = factor1 factor2 / solution;
   random intercept / subject=subject;
   ods output BaseDensities=base_densities;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Create the Input Data Set&lt;/STRONG&gt;: The &lt;CODE&gt;base_densities&lt;/CODE&gt; data set will contain the necessary columns (&lt;CODE&gt;Type&lt;/CODE&gt;, &lt;CODE&gt;Parm1&lt;/CODE&gt;, &lt;CODE&gt;Parm2&lt;/CODE&gt;, etc.). You can use this data set directly or modify it if needed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="ps-2"&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Run PROC MIXED with PRIOR Statement&lt;/STRONG&gt;: Now, use the &lt;CODE&gt;base_densities&lt;/CODE&gt; data set in the &lt;CODE&gt;PRIOR&lt;/CODE&gt; statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed data=your_dataset;
   class factor1 factor2;
   model response = factor1 factor2 / solution;
   random intercept / subject=subject;
   prior (intercept) / data=base_densities;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This should give you a concrete example of how to use the &lt;CODE&gt;PRIOR&lt;/CODE&gt; statement with &lt;CODE&gt;PROC MIXED&lt;/CODE&gt;. Does this help clarify things?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 22:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958886#M48020</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-02-10T22:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify input data set for PRIOR statement in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958893#M48021</link>
      <description>&lt;P&gt;If you want to do Bayesian Analysis for Mixed model, Check PROC BGLIMM :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1739238566254.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104517i1D689EA0615D5A83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1739238566254.png" alt="Ksharp_0-1739238566254.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2025 01:49:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958893#M48021</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-02-11T01:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify input data set for PRIOR statement in PROC MIXED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958916#M48022</link>
      <description>Nope, that does not work for me.</description>
      <pubDate>Tue, 11 Feb 2025 12:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-specify-input-data-set-for-PRIOR-statement-in-PROC-MIXED/m-p/958916#M48022</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2025-02-11T12:29:43Z</dc:date>
    </item>
  </channel>
</rss>

