<?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: Sample size effect on variance - create data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441260#M110359</link>
    <description>&lt;P&gt;Do you know what the distribution of the data should follow? Because it's concentration it likely cannot go below zero, so a normal distribution may not be appropriate. Once you know the distribution you can use the mean/std to simulate your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have enough data to determine the distribution, sometimes literature in your field will have the type of distribution and you can assume that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Mar 2018 16:21:52 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-01T16:21:52Z</dc:date>
    <item>
      <title>Sample size effect on variance - create data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441227#M110341</link>
      <description>&lt;P&gt;Good day my friends:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based in laboratory research at 1, 12, 24&amp;nbsp;36 and 72 hours it has been collected&amp;nbsp;3 observations each hour:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input&amp;nbsp;hour&amp;nbsp;repetition concentration;&lt;BR /&gt;cards;&lt;BR /&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.21 &lt;BR /&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;12.15 &lt;BR /&gt; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;9.91 &lt;BR /&gt; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.21 &lt;BR /&gt; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;10.28 &lt;BR /&gt; 12&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;3&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.82 &lt;BR /&gt; 24&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;1&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;10.28 &lt;BR /&gt; 24&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;2&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;10.28 &lt;BR /&gt; 24&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;3&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;12.61 &lt;BR /&gt; 36&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;1&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.21 &lt;BR /&gt; 36&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;2&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.21 &lt;BR /&gt; 36&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;3&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.71 &lt;BR /&gt; 72&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;1&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;10.28 &lt;BR /&gt; 72&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;2&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;11.21 &lt;BR /&gt; 72&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;3&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;12.73&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as you can see, in each hour can be obtained the mean ans standar deviation. For teaching purposes i need to increase the sample size to 10, 50, 100, 1000 and 10 000 repetitions, each sample size in diferent data sets. Thus, i need to create a new data set using aleatory data with the mean ans standar deviation from the original data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thankyou very much.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 15:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441227#M110341</guid>
      <dc:creator>jonatan_velarde</dc:creator>
      <dc:date>2018-03-01T15:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sample size effect on variance - create data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441260#M110359</link>
      <description>&lt;P&gt;Do you know what the distribution of the data should follow? Because it's concentration it likely cannot go below zero, so a normal distribution may not be appropriate. Once you know the distribution you can use the mean/std to simulate your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have enough data to determine the distribution, sometimes literature in your field will have the type of distribution and you can assume that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 16:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441260#M110359</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-01T16:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sample size effect on variance - create data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441262#M110360</link>
      <description>Thank you for the answer:&lt;BR /&gt;&lt;BR /&gt;The data we need to simulate is normally distributed&lt;BR /&gt;&lt;BR /&gt;thank you</description>
      <pubDate>Thu, 01 Mar 2018 16:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441262#M110360</guid>
      <dc:creator>jonatan_velarde</dc:creator>
      <dc:date>2018-03-01T16:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sample size effect on variance - create data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441272#M110362</link>
      <description>&lt;P&gt;Then if I understand your question correclty you're looking for something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input hour repetition concentration;
cards;
1         1       11.21 
1         2       12.15 
1         3       9.91 
12       1       11.21 
12       2       10.28 
12       3       11.82 
24       1       10.28 
24       2       10.28 
24       3       12.61 
36       1       11.21 
36       2       11.21 
36       3       11.71 
72       1       10.28 
72       2       11.21 
72       3       12.73
;

proc means data=have noprint nway;
class hour;
var concentration;
output out=stats mean=p1 std=p2;
run;

%let n_records = 1000;

data simulated;
call streaminit(24);
set stats;
do rep = 1 to &amp;amp;n_records;
conc_sim = rand('normal', p1, p2);
conc_sim = round(conc_sim, 0.01);
output;
end;
run;

proc means data=simulated noprint nway;
class hour p1 p2;
var conc_sim;
output out=check mean=p1_sim std=p2_sim;
run;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I used the old RNG though, you can look into the new ones and see if you want to use one of those instead:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/01/29/random-number-generators-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/01/29/random-number-generators-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 16:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sample-size-effect-on-variance-create-data/m-p/441272#M110362</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-01T16:36:39Z</dc:date>
    </item>
  </channel>
</rss>

