<?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 do I create a random effects data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/458413#M284465</link>
    <description>&lt;P&gt;I see what you are saying about c and e being equivalent. Thanks for the help!&lt;/P&gt;</description>
    <pubDate>Sun, 29 Apr 2018 01:40:05 GMT</pubDate>
    <dc:creator>bdp</dc:creator>
    <dc:date>2018-04-29T01:40:05Z</dc:date>
    <item>
      <title>How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457600#M284458</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate a data set for a two factor random-effects model. The closest I have been able to get is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data part1;&lt;BR /&gt;do i=1 to 3;&lt;BR /&gt;do j=1 to 9;&lt;BR /&gt;do k=1 to 2;&lt;BR /&gt;a=rannor(1);&lt;BR /&gt;b=rannor(1);&lt;BR /&gt;c=rannor(1);&lt;BR /&gt;e=rannor(1);&lt;BR /&gt;x=a+b+c+e;&lt;BR /&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this doesn't work because, for example, a will equal something different every time that i=1. I believe that I need to have the same random a for every i, b for every j, and c for every k. How do I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you everyone&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 03:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457600#M284458</guid>
      <dc:creator>bdp</dc:creator>
      <dc:date>2018-04-26T03:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457606#M284459</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data part1;
 array A [*] A1-A3;
 array B [*] B1-B9;
 array C [*] C1-C2;
 do I=1 to dim(A);
   A[I]=rannor(1);
 end;
 do I=1 to dim(B);
   B[I]=rannor(1);
 end;
 do I=1 to dim(C);
   C[I]=rannor(1);
 end;
 do I=1 to dim(A);
  do J=1 to dim(B);
   do K=1 to dim(C);
    E=rannor(1);
    X=A[I]+B[J]+C[K]+E;
    output;
   end;
  end;
 end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 05:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457606#M284459</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-26T05:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457919#M284460</link>
      <description>&lt;P&gt;Which variables are fixed effects and which are random effects?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The general rule is that the random effects change for each level of&amp;nbsp;district/school/classroom/student.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 19:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457919#M284460</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-04-26T19:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457966#M284461</link>
      <description>&lt;P&gt;A and b are both random, and c is actually the interaction term. This is actually more of a theoretical exercise. It would make sense though that for each level of a, the random effect will be the same for all y's corresponding to that level of a?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 21:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457966#M284461</guid>
      <dc:creator>bdp</dc:creator>
      <dc:date>2018-04-26T21:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457967#M284462</link>
      <description>&lt;P&gt;This seems to be almost exactly what I was looking for. I had meant to specify that c is actually the a*b interaction term though-there is no actual term c. So this would lead me to believe that I would need to do c=1 to 27 to get every combination of a*b. But when I do that I get 729 entries. Do you have any suggestions on how to&amp;nbsp;accomplish this?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 21:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457967#M284462</guid>
      <dc:creator>bdp</dc:creator>
      <dc:date>2018-04-26T21:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457974#M284463</link>
      <description>&lt;P&gt;Then this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data part1;
 array B [*] B1-B9;
 do I=1 to dim(B);
   B[I]=rannor(1);
 end;
 do I=1 to dim(A);
  A=rannor(1); &lt;BR /&gt;  do J=1 to dim(B);
    C=rannor(1);
    E=rannor(1);
    X=A+B[J]+C+E;
    output;
  end;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;C is unique and constant for each A and B combination, but that's probably not what you meant as there is now no logical difference between C and E.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 21:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457974#M284463</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-26T21:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457976#M284464</link>
      <description>&lt;P&gt;Or this, but the comment about C and E being equivalent still stands&lt;/P&gt;
&lt;P&gt;I hope you can modify one of these to do what you want (assuming you know what you want).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data part1;
 array A [*] A1-A3;
 array B [*] B1-B9;
 array C [3,9,2] ;
 do I=1 to dim(A);
   A[I]=rannor(1);
 end;
 do I=1 to dim(B);
   B[I]=rannor(1);
 end;
 do I=1 to dim(A);
  do J=1 to dim(B);
   do K=1 to 2;
    C[I,J,K]=rannor(1);
    E=rannor(1);
    X=A[I]+B[J]+C[I,J,K]+E;
    output;
   end;
  end;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 21:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/457976#M284464</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-26T21:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a random effects data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/458413#M284465</link>
      <description>&lt;P&gt;I see what you are saying about c and e being equivalent. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Sun, 29 Apr 2018 01:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-random-effects-data-set/m-p/458413#M284465</guid>
      <dc:creator>bdp</dc:creator>
      <dc:date>2018-04-29T01:40:05Z</dc:date>
    </item>
  </channel>
</rss>

