<?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: Basic Simulation in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249934#M56562</link>
    <description>&lt;P&gt;So you have a function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;y(b_1, b_2) = 3.4 + 0.58b_1 + 0.89b_2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;define a new function as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dy(b_1, b_2) = y(b_1, b_2 + 0.9) - y(b_1, b_2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;choose a range for &lt;EM&gt;b_1&lt;/EM&gt; and &lt;EM&gt;b_2&lt;/EM&gt;, and a resolution db for your simulation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Calculate the values of &lt;EM&gt;dy&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data simul;
low_b_1 = 0;
high_b_1 = 3;
low_b_2 = -2;
high_b_2 = 2;
db = 0.1;
do b_1 = low_b_1 to high_b_1 by db;
	do b_2 = low_b_2 to high_b_2 by 1;
		dy = 3.4 + 0.58*b_1 + 0.89*(b_2+0.9) - (3.4 + 0.58*b_1 + 0.89*b_2);
		output;
		end;
	end;
keep b_1 b_2 dy;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plot the results with proc sgplot or sgpanel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=simul;
series y=dy x=b_1 / group=b_2;
run;

proc sgpanel data=simul;
panelby b_2;
series y=dy x=b_1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, the results will not look very interesting unless &lt;EM&gt;dy&lt;/EM&gt; is not a constant function... but you get the idea.&lt;/P&gt;</description>
    <pubDate>Sun, 14 Feb 2016 03:51:26 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-02-14T03:51:26Z</dc:date>
    <item>
      <title>Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249905#M56560</link>
      <description>&lt;P class=""&gt;My name is Kuda Makoni from the University of Malawi and i wanted to ask a basic stata question&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;This is a pretty basic question but i am trying to do a simulation.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;I have the following equation&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;y=3.4+0.58b_1 +0.89b_2&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;so i am trying to see how much y would change if I increased b_1 to 0.9 while b_2 stayed the same.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;How do i write a simulation code for that?&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Kuda&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 13 Feb 2016 23:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249905#M56560</guid>
      <dc:creator>kudamakoni100</dc:creator>
      <dc:date>2016-02-13T23:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249923#M56561</link>
      <description>Determine the range of values for b_1/2. &lt;BR /&gt;Simulate those values and then run both models to compare. &lt;BR /&gt;</description>
      <pubDate>Sun, 14 Feb 2016 02:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249923#M56561</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-14T02:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249934#M56562</link>
      <description>&lt;P&gt;So you have a function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;y(b_1, b_2) = 3.4 + 0.58b_1 + 0.89b_2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;define a new function as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dy(b_1, b_2) = y(b_1, b_2 + 0.9) - y(b_1, b_2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;choose a range for &lt;EM&gt;b_1&lt;/EM&gt; and &lt;EM&gt;b_2&lt;/EM&gt;, and a resolution db for your simulation&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Calculate the values of &lt;EM&gt;dy&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data simul;
low_b_1 = 0;
high_b_1 = 3;
low_b_2 = -2;
high_b_2 = 2;
db = 0.1;
do b_1 = low_b_1 to high_b_1 by db;
	do b_2 = low_b_2 to high_b_2 by 1;
		dy = 3.4 + 0.58*b_1 + 0.89*(b_2+0.9) - (3.4 + 0.58*b_1 + 0.89*b_2);
		output;
		end;
	end;
keep b_1 b_2 dy;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plot the results with proc sgplot or sgpanel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=simul;
series y=dy x=b_1 / group=b_2;
run;

proc sgpanel data=simul;
panelby b_2;
series y=dy x=b_1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, the results will not look very interesting unless &lt;EM&gt;dy&lt;/EM&gt; is not a constant function... but you get the idea.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Feb 2016 03:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/249934#M56562</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-14T03:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/250006#M56566</link>
      <description>&lt;P&gt;It is totally depended on the coefficient of b_1 ( 0.58 ), since you don't care about other covariables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;y=3.4+0.58b_1 +0.89b_2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;==&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;y-3.4-0.89b_2=0.58b_1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;y1-3.4-&lt;SPAN&gt;0.89b_2=&lt;/SPAN&gt;&lt;SPAN&gt;0.58(b_1+0.9)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;y0-3.4-&lt;SPAN&gt;0.89b_2=&lt;/SPAN&gt;&lt;SPAN&gt;0.58b_1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;=&amp;gt; y1-y0=0.58*0.9&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2016 01:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/250006#M56566</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-15T01:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252430#M56826</link>
      <description>&lt;P&gt;How do i do that basically what i am trying to do is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;simulation but i am not sure how to do the code. I have a linear equation &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;y=c+0.05X1+1.28X2&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;so here i am trying to obtain the values of y and b2 when I fix b1 first at 2 then 0 &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;How do i do that?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 17:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252430#M56826</guid>
      <dc:creator>kudamakoni100</dc:creator>
      <dc:date>2016-02-25T17:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252431#M56827</link>
      <description>&lt;P&gt;I am so confused right now&amp;nbsp;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;i am just &amp;nbsp;trying to do a simulation but i am not sure how to do the code. I have a linear equation &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;y=c+0.05X1+1.28X2&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;so here i am trying to obtain the values of y and b2 when I fix b1 first at 2 then 0 &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;How do i do that?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 17:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252431#M56827</guid>
      <dc:creator>kudamakoni100</dc:creator>
      <dc:date>2016-02-25T17:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252432#M56828</link>
      <description>&lt;P&gt;I am a bit confused the only thing i am trying to do is&amp;nbsp;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;a simulation but i am not sure how to do the code. I have a linear equation &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;y=c+0.05X1+1.28X2&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;so here i am trying to obtain the values of y and b2 when I fix b1 first at 2 then 0 &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="HelveticaNeue"&gt;&lt;SPAN&gt;How do i do that?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 17:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252432#M56828</guid>
      <dc:creator>kudamakoni100</dc:creator>
      <dc:date>2016-02-25T17:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252609#M56844</link>
      <description>How is simulation coming into play then? Its a mathematical formula. Or are you trying to run multiple regression models. I don't know if we're interpreting your question correctly.</description>
      <pubDate>Fri, 26 Feb 2016 01:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252609#M56844</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-26T01:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Basic Simulation</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252617#M56846</link>
      <description>&lt;P&gt;I am trying to run a multiple regression analysis where i set beta 1 to a certain value then see what happens to x2 and y&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 02:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Basic-Simulation/m-p/252617#M56846</guid>
      <dc:creator>kudamakoni100</dc:creator>
      <dc:date>2016-02-26T02:26:18Z</dc:date>
    </item>
  </channel>
</rss>

