<?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: SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796543#M39140</link>
    <description>&lt;P&gt;Dear Rick&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;May you kindly try to give the code using dummy variables and parameters. Here is what I want to achieve:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Simulate a LMM in SAS as what I achieve in R when I follow the following steps after generating ANOVA F-tests results:&lt;/DIV&gt;
&lt;DIV&gt;
&lt;OL&gt;
&lt;LI&gt;set.seed(123)&lt;/LI&gt;
&lt;LI&gt;set out parameters of the model&lt;/LI&gt;
&lt;LI&gt;simulate the random errors in the model&lt;/LI&gt;
&lt;LI&gt;fit a model of simulated response&lt;/LI&gt;
&lt;LI&gt;store the variables and simulated data&lt;/LI&gt;
&lt;LI&gt;fit simulated model&lt;/LI&gt;
&lt;LI&gt;functionize the data simulating and fitting process (to test if the function works properly, it must produce similar results as in 6.)&lt;/LI&gt;
&lt;LI&gt;use the working function to simulate, say 10000 samples and note the simulation results.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 16 Feb 2022 13:31:16 GMT</pubDate>
    <dc:creator>Lyson</dc:creator>
    <dc:date>2022-02-16T13:31:16Z</dc:date>
    <item>
      <title>SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796109#M39124</link>
      <description>&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Anyone with a SAS code to simulate the linear mixed model results, e.g. from the SAS code given below:&lt;/P&gt;&lt;PRE&gt;proc mixed data=LDH_univ method=reml covtest;&lt;BR /&gt;&lt;BR /&gt;class CCI4 CHCI3  Time Flask ;&lt;BR /&gt;&lt;BR /&gt;model Leakage=CCI4 CHCI3  CCI4*CHCI3 Time CCI4*Time CHCI3*Time CCI4*CHCI3*Time;&lt;BR /&gt;repeated Time  / subject=Flask  type=cs;&lt;BR /&gt;lsmeans CCI4 / pdiff cl adjust=tukey;&lt;BR /&gt;lsmeans CHCI3 / pdiff cl adjust=tukey;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;with the following &lt;SPAN&gt;SAS Proc Mixed output:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lyson_0-1644864383743.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68453i8274F15527ED7E96/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Lyson_0-1644864383743.png" alt="Lyson_0-1644864383743.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 18:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796109#M39124</guid>
      <dc:creator>Lyson</dc:creator>
      <dc:date>2022-02-14T18:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796173#M39125</link>
      <description>&lt;P&gt;If I understand what you want then the steps I think you need are&lt;/P&gt;
&lt;P&gt;1) Modify the code to include a STORE statement to create a file that holds the information the model created that can be used to score other data using the model results.&lt;/P&gt;
&lt;P&gt;Something like&lt;/P&gt;
&lt;PRE&gt;Store work.Ldhmixed ;&lt;/PRE&gt;
&lt;P&gt;which place the information in the work library in a store name Ldhmixed. &amp;lt;loosely based on your data set name and the procedure&amp;gt;&lt;/P&gt;
&lt;P&gt;2. Create a data set with&amp;nbsp; the model variables having values you are interested in.&lt;/P&gt;
&lt;P&gt;3. Use Proc PLM with the store created in proc mixed and the data set to create output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warning: You Class variables should only contain values from the original model. Classes that did not exist in the original data don't have any parameters in the model. Think of building model with Gender as a class and all the values are Male. You can't do much predicting(scoring) for Females.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 23:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796173#M39125</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-14T23:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796326#M39132</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;&amp;nbsp;Anyone with a SAS code to simulate the linear mixed model results&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I assume you are asking for simulation code that will simulate data so that the parameter estimates in your output are the expected values for a regression of Leakage onto the indep variables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You need more information about your data. The correlation of the independent variables with each other is important and should be modeled. You can use PROC FREQ to analyze the proportion of observations in each level of the class variables. Because of the interaction terms, you want to look at 1-way, 2-way, and 3-way interactions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There are several sample simulation programs for repeated measures in Gibbs and Kiernan (2020), &lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4400-2020.pdf" target="_self"&gt;"Simulating Data for Complex Linear Models."&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 16:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796326#M39132</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-02-15T16:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796540#M39139</link>
      <description>Hi Ballardw&lt;BR /&gt;&lt;BR /&gt;May you kindly try to give the code using dummy variables and parameters.&lt;BR /&gt;Here is what I want to achieve:&lt;BR /&gt;&lt;BR /&gt;Simulate a LMM in SAS as what I achieve in R when I follow the following&lt;BR /&gt;steps after generating ANOVA F-tests results:&lt;BR /&gt;&lt;BR /&gt;1. set.seed(123)&lt;BR /&gt;2. set out parameters of the model&lt;BR /&gt;3. simulate the random errors in the model&lt;BR /&gt;4. fit a model of simulated response&lt;BR /&gt;5. store the variables and simulated data&lt;BR /&gt;6. fit simulated model&lt;BR /&gt;7. functionize the data simulating and fitting process (to test if the&lt;BR /&gt;function works properly, it must produce similar results as in 6.)&lt;BR /&gt;8. use the working function to simulate, say 10000 samples and note the&lt;BR /&gt;simulation results.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Feb 2022 13:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796540#M39139</guid>
      <dc:creator>Lyson</dc:creator>
      <dc:date>2022-02-16T13:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796543#M39140</link>
      <description>&lt;P&gt;Dear Rick&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;May you kindly try to give the code using dummy variables and parameters. Here is what I want to achieve:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Simulate a LMM in SAS as what I achieve in R when I follow the following steps after generating ANOVA F-tests results:&lt;/DIV&gt;
&lt;DIV&gt;
&lt;OL&gt;
&lt;LI&gt;set.seed(123)&lt;/LI&gt;
&lt;LI&gt;set out parameters of the model&lt;/LI&gt;
&lt;LI&gt;simulate the random errors in the model&lt;/LI&gt;
&lt;LI&gt;fit a model of simulated response&lt;/LI&gt;
&lt;LI&gt;store the variables and simulated data&lt;/LI&gt;
&lt;LI&gt;fit simulated model&lt;/LI&gt;
&lt;LI&gt;functionize the data simulating and fitting process (to test if the function works properly, it must produce similar results as in 6.)&lt;/LI&gt;
&lt;LI&gt;use the working function to simulate, say 10000 samples and note the simulation results.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Feb 2022 13:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796543#M39140</guid>
      <dc:creator>Lyson</dc:creator>
      <dc:date>2022-02-16T13:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to simulate linear mixed model results obtained from Proc Mixed or Proc GLM</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796545#M39141</link>
      <description>Dear Rick&lt;BR /&gt;&lt;BR /&gt;Thank you for the reading by Gibbs and Kiernan (2020), "Simulating Data for Complex Linear Models."&lt;BR /&gt;&lt;BR /&gt;I see its full of wonderful sample simulation programs for linear models that I need time to grasp on. I appreciate the assistance.</description>
      <pubDate>Wed, 16 Feb 2022 13:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Code-to-simulate-linear-mixed-model-results-obtained-from/m-p/796545#M39141</guid>
      <dc:creator>Lyson</dc:creator>
      <dc:date>2022-02-16T13:41:13Z</dc:date>
    </item>
  </channel>
</rss>

