<?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 How to Generate Random Number Data Sets and Display Set Furthest From Normal Distribution? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646717#M193492</link>
    <description>&lt;P&gt;I'll preface by saying I am a complete novice to SAS so may need more in depth explanations than other users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wanting to generate a cluster of data sets (say 50) comprised of 75 rolls of two dice. Then with these 50 data sets, I want to have SAS find the data set that least resembles a normal distribution. I want to view that seeds set of 75 rolls as a PROC Freq table. I have the code to randomize 75 dice rolls (I'll paste below in case you want to make changes) but have no clue where to start with coding for a cluster of data 50 data sets, and what function may exist to have SAS identify the data set that is furthest from a normal distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA DICE(KEEP=SUM) OUTCOMES(KEEP=OUTCOME);
	DO ROLL=1 TO 75;
		OUTCOME1=1+INT(6*RANUNI(123));
		OUTCOME2=1+INT(6*RANUNI(123));
		SUM=OUTCOME+OUTCOME2;
		OUTPUT DICE;
		OUTCOME=OUTCOME1; OUTPUT OUTCOMES;
		OUTCOME=OUTCOME2; OUTPUT OUTCOMES;
	END;
RUN;

PROC FREQ DATA=DICE;
	TABLE SUM;
RUN;
PROC FREQ DATA=OUTCOMES;
	TABLE OUTCOME;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 May 2020 14:28:14 GMT</pubDate>
    <dc:creator>culliso3</dc:creator>
    <dc:date>2020-05-11T14:28:14Z</dc:date>
    <item>
      <title>How to Generate Random Number Data Sets and Display Set Furthest From Normal Distribution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646717#M193492</link>
      <description>&lt;P&gt;I'll preface by saying I am a complete novice to SAS so may need more in depth explanations than other users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wanting to generate a cluster of data sets (say 50) comprised of 75 rolls of two dice. Then with these 50 data sets, I want to have SAS find the data set that least resembles a normal distribution. I want to view that seeds set of 75 rolls as a PROC Freq table. I have the code to randomize 75 dice rolls (I'll paste below in case you want to make changes) but have no clue where to start with coding for a cluster of data 50 data sets, and what function may exist to have SAS identify the data set that is furthest from a normal distribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA DICE(KEEP=SUM) OUTCOMES(KEEP=OUTCOME);
	DO ROLL=1 TO 75;
		OUTCOME1=1+INT(6*RANUNI(123));
		OUTCOME2=1+INT(6*RANUNI(123));
		SUM=OUTCOME+OUTCOME2;
		OUTPUT DICE;
		OUTCOME=OUTCOME1; OUTPUT OUTCOMES;
		OUTCOME=OUTCOME2; OUTPUT OUTCOMES;
	END;
RUN;

PROC FREQ DATA=DICE;
	TABLE SUM;
RUN;
PROC FREQ DATA=OUTCOMES;
	TABLE OUTCOME;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 14:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646717#M193492</guid>
      <dc:creator>culliso3</dc:creator>
      <dc:date>2020-05-11T14:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to Generate Random Number Data Sets and Display Set Furthest From Normal Distribution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646726#M193495</link>
      <description>&lt;P&gt;modify your code as follows&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA DICE(KEEP=SUM cluster) OUTCOMES(KEEP=OUTCOME cluster);
        do cluster=1 to 50;
	DO ROLL=1 TO 75;
		OUTCOME1=1+INT(6*RANUNI(123));
		OUTCOME2=1+INT(6*RANUNI(123));
		SUM=OUTCOME+OUTCOME2;
		OUTPUT DICE;
		OUTCOME=OUTCOME1; OUTPUT OUTCOMES;
		OUTCOME=OUTCOME2; OUTPUT OUTCOMES;
	END;
       end;
RUN;

PROC FREQ DATA=DICE;
	TABLE SUM;
         by cluster;
RUN;
PROC FREQ DATA=OUTCOMES;
	TABLE OUTCOME;
        by cluster;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you add in a PROC UNIVARIATE, you can do a test of normality for each of the 50 clusters — although OUTCOME doesn't follow a normal distribution, and SUM is only approximately normal and would be better tested against the proper distribution, using a Chi-Squared goodness of fit test, as shown in &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_freq_examples03.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en" target="_self"&gt;this example&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 15:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646726#M193495</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-11T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Generate Random Number Data Sets and Display Set Furthest From Normal Distribution?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646745#M193503</link>
      <description>&lt;P&gt;SAS has added a distribution that it nicer to code for things like dice rolls&lt;/P&gt;
&lt;PRE&gt;      roll = rand('integer',1,6);
&lt;/PRE&gt;
&lt;P&gt;Returns integer values with equal probability, i.e. 6-sided die above.&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 15:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Generate-Random-Number-Data-Sets-and-Display-Set-Furthest/m-p/646745#M193503</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-11T15:01:44Z</dc:date>
    </item>
  </channel>
</rss>

