<?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: Generating data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generating-data/m-p/861954#M340446</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    do record_number=1 to 20000;
        x1=rand('normal',3,2);
        ...
        output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I leave the code to calculate X2 and Y to you as a homework assignment.&amp;nbsp;Please see the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p0fpeei0opypg8n1b06qe4r040lv.htm" target="_self"&gt;RAND() function documentation&lt;/A&gt; for other random number generation options.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2023 14:37:26 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-03-02T14:37:26Z</dc:date>
    <item>
      <title>Generating data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-data/m-p/861950#M340443</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to generate a data set. What i want to learn is the SAS commands to do this; the specifics i describe are not the focus per se. I want to add that i know how to do this in spss and there, as is true here, the issue is the commands.&lt;/P&gt;&lt;P&gt;That said. Let's say i want to create 20000 records with each record having four variables: record number (_N_ ??), x1, a draw from a normal distribution with a mean of 3 and an SD of 2; x2, a draw from a uniform distribution with a range of 2 to 5 and y, the resulting value of this regression equation y = 3.0 + 2.0*x1 + 4.0*x2+err&lt;/P&gt;&lt;P&gt;where err equals a draw from a normal distribution with a mean of 0 and an SD of 1.5.&lt;/P&gt;&lt;P&gt;I expect that this is a trivially simple thing to do; i need to know the commands and how those commands are located in a data xxx1; set ??used??; run; code block.&lt;/P&gt;&lt;P&gt;Thanks, Gene Maguin&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 14:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-data/m-p/861950#M340443</guid>
      <dc:creator>emaguin</dc:creator>
      <dc:date>2023-03-02T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Generating data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-data/m-p/861954#M340446</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    do record_number=1 to 20000;
        x1=rand('normal',3,2);
        ...
        output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I leave the code to calculate X2 and Y to you as a homework assignment.&amp;nbsp;Please see the &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lefunctionsref/p0fpeei0opypg8n1b06qe4r040lv.htm" target="_self"&gt;RAND() function documentation&lt;/A&gt; for other random number generation options.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 14:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-data/m-p/861954#M340446</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-02T14:37:26Z</dc:date>
    </item>
  </channel>
</rss>

