<?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: simulate from a logistics in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176135#M302250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simulation of logistic data is covered in Section 12.2 of &lt;EM&gt;&lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Simulating Data with SAS&lt;/A&gt;&lt;/EM&gt;. You can download the code for free from the book's web site. The distribution of the explanatory variables can be whatever you want, but as Reeza points out, the distribution does affect the variability of the estimates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your code, your computation of Y is incorrect. Use&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; line-height: 107%; font-family: 'Courier New'; font-size: 14pt;"&gt;y = rand("Bernoulli",prob);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though 1000 obs seems like a lot of observations (and is for linear regression), the logistic parameter estimates are quite variable, so turn on the CLPARM=WALD option to check whether the parameter estimates are "close" to the parameter values:&lt;/P&gt;&lt;P&gt;You'll see that the 95% confidence intervals do in fact contain the parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add&lt;/P&gt;&lt;P&gt;CLASS x;&lt;/P&gt;&lt;P&gt;to your model, you also have to be concerned with the parameterization used for the 0/1 variable.That is described in Section 11.3 of my book.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 14:20:56 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2014-05-29T14:20:56Z</dc:date>
    <item>
      <title>simulate from a logistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176133#M302248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I wish to ask why this logistic simulated data does give the correct estimates for t&amp;nbsp; when I ran the simulation with 1000 replicate; Any help?&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;intercept = 0.01;&lt;/P&gt;&lt;P&gt;beta = 0.5;&lt;/P&gt;&lt;P&gt;beta1=0.1;&lt;/P&gt;&lt;P&gt;do i = 1 to 1000;&lt;/P&gt;&lt;P&gt;t = rand("WEIBULL", .5, .25; );&lt;/P&gt;&lt;P&gt; X=ranbin(0,1,.5);&lt;/P&gt;&lt;P&gt;linpred = intercept + t*beta + x*beta1;&lt;/P&gt;&lt;P&gt;prob = exp(linpred)/ (1 + exp(linpred));&lt;/P&gt;&lt;P&gt;U=.6*(uniform(0)) + 0.4;&lt;/P&gt;&lt;P&gt;y = U lt prob;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc logistic data=test;&lt;/P&gt;&lt;P&gt;model Y&lt;STRONG&gt;(event='1') = t x;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 02:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176133#M302248</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2014-05-29T02:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: simulate from a logistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176134#M302249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought x should be normally distributed?&lt;/P&gt;&lt;P&gt;Do you have a reference for this particular methodology, I'm not familiar with it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd suggest looking at Rick Wicklins Simulation book if you're interested in simulating data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 02:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176134#M302249</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-29T02:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: simulate from a logistics</title>
      <link>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176135#M302250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simulation of logistic data is covered in Section 12.2 of &lt;EM&gt;&lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Simulating Data with SAS&lt;/A&gt;&lt;/EM&gt;. You can download the code for free from the book's web site. The distribution of the explanatory variables can be whatever you want, but as Reeza points out, the distribution does affect the variability of the estimates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your code, your computation of Y is incorrect. Use&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; line-height: 107%; font-family: 'Courier New'; font-size: 14pt;"&gt;y = rand("Bernoulli",prob);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though 1000 obs seems like a lot of observations (and is for linear regression), the logistic parameter estimates are quite variable, so turn on the CLPARM=WALD option to check whether the parameter estimates are "close" to the parameter values:&lt;/P&gt;&lt;P&gt;You'll see that the 95% confidence intervals do in fact contain the parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add&lt;/P&gt;&lt;P&gt;CLASS x;&lt;/P&gt;&lt;P&gt;to your model, you also have to be concerned with the parameterization used for the 0/1 variable.That is described in Section 11.3 of my book.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 14:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/simulate-from-a-logistics/m-p/176135#M302250</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-05-29T14:20:56Z</dc:date>
    </item>
  </channel>
</rss>

