<?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: NLMIXED Execution error for observation 1 in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/318053#M16760</link>
    <description>c as bound (censored point), c value is third quartile every number iD. can you help me to fix my syntax sas.&lt;BR /&gt;</description>
    <pubDate>Sat, 10 Dec 2016 03:57:06 GMT</pubDate>
    <dc:creator>rizayuli</dc:creator>
    <dc:date>2016-12-10T03:57:06Z</dc:date>
    <item>
      <title>NLMIXED Execution error for observation 1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/317810#M16743</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello Please, I simulated the data below, ran NLMIXED but had execution error. Any correction.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* Step 1: Generate a data set that contains many samples */&lt;BR /&gt;%let N = 500; /* sample size */&lt;BR /&gt;%let NumSamples = 3; /* number of samples */&lt;BR /&gt;data a;&lt;BR /&gt;call streaminit(1234);&lt;BR /&gt;do SampleID=1 to &amp;amp;NumSamples; /* ID variable for each sample */&lt;BR /&gt;do i = 1 to &amp;amp;N;&lt;BR /&gt;x1 = ranuni(1234);&lt;BR /&gt;x2 = ranuni(1234);&lt;BR /&gt;x3 = rannor(1234);&lt;BR /&gt;theta = 1;&lt;BR /&gt;mu = exp(1 + .3*x1 + .3*x2);&lt;BR /&gt;parm1 = 1/(1+mu/theta);&lt;BR /&gt;yneg = rand('NEGB',parm1,theta);&lt;BR /&gt;pzero = cdf('LOGISTIC',x3*2);&lt;BR /&gt;if ranuni(1234)&amp;gt;pzero then do;&lt;BR /&gt;ynegzim = yneg;&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;ynegzim = 0;&lt;BR /&gt;end;&lt;BR /&gt;y=ynegzim;&lt;BR /&gt;output ;&lt;BR /&gt;end ;&lt;BR /&gt;end;&lt;BR /&gt;keep SampleID i y x1 x2;&lt;BR /&gt;run;&lt;BR /&gt;proc means data=a qntldef=3 q3;&lt;BR /&gt;by SampleID; var y;&lt;BR /&gt;output out=c;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=a;&lt;BR /&gt;run;&lt;BR /&gt;/* Step 2: Compute the hurdle of each sample */&lt;BR /&gt;data a;&lt;BR /&gt;set a;&lt;BR /&gt;bound=c;&lt;BR /&gt;if y &amp;gt; bound then y=bound+1;&lt;BR /&gt;proc nlmixed data=a TECH=NEWRAP;&lt;BR /&gt;by SampleID;&lt;BR /&gt;parms a0=0 a1=0 a2=0 b0=0 b1=0 b2=0 alpha=0.5;&lt;BR /&gt;bounds alpha&amp;gt;0;&lt;BR /&gt;lin = a0 + a1*x1 + a2*x2;&lt;BR /&gt;w = exp(lin) / (1+exp(lin));&lt;BR /&gt;eta = b0 + b1*x1 + b2*x2;&lt;BR /&gt;mu = exp(eta);&lt;BR /&gt;phi = 1/alpha;&lt;BR /&gt;pdf = (gamma(y+phi)/(gamma(y+1)*gamma(phi)))&lt;BR /&gt;*((1/(1+alpha*mu))**phi*(alpha*mu/(1+alpha*mu))**y);&lt;BR /&gt;l_1 = w;&lt;BR /&gt;l_2 = (1-w)*pdf/ (1-(1+alpha*mu)**(-phi));&lt;BR /&gt;cdf=0;&lt;BR /&gt;do t=1 to c;&lt;BR /&gt;cdf=cdf+((1-w)*((gamma(t+phi)/(gamma(t+1)*gamma(phi)))&lt;BR /&gt;*((1/(1+alpha*mu))**phi*(alpha*mu/(1+alpha*mu))**t)/(1-(1+alpha*mu)**(-phi))));&lt;BR /&gt;end;&lt;BR /&gt;l_3= 1-cdf;&lt;BR /&gt;if y = 0 then ll = log(l_1);&lt;BR /&gt;if 0 &amp;lt; y &amp;lt;= bound then ll = log(l_2);&lt;BR /&gt;if y &amp;lt;= bound then d=0; else d=1;&lt;BR /&gt;ll=(1-d)*ll+d*log(l_3);&lt;BR /&gt;model y~general(ll);&lt;BR /&gt;ods output FitStatistics=OutStats;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=OutStats;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 06:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/317810#M16743</guid>
      <dc:creator>rizayuli</dc:creator>
      <dc:date>2016-12-09T06:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED Execution error for observation 1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/317900#M16744</link>
      <description>&lt;P&gt;I think you made a mistake in Step 2. &amp;nbsp;You wrote:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* Step 2: Compute the hurdle of each sample */&lt;BR /&gt;data a;&lt;BR /&gt;set a;&lt;BR /&gt;bound=c;&lt;BR /&gt;if y &amp;gt; bound then y=bound+1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, there is no variable in data set A that is named c. &amp;nbsp;Therefore this DATA step results in assigning y=. (missing value) for all observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 14:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/317900#M16744</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-12-09T14:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: NLMIXED Execution error for observation 1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/318053#M16760</link>
      <description>c as bound (censored point), c value is third quartile every number iD. can you help me to fix my syntax sas.&lt;BR /&gt;</description>
      <pubDate>Sat, 10 Dec 2016 03:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/NLMIXED-Execution-error-for-observation-1/m-p/318053#M16760</guid>
      <dc:creator>rizayuli</dc:creator>
      <dc:date>2016-12-10T03:57:06Z</dc:date>
    </item>
  </channel>
</rss>

