<?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: SAS Not responding in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454530#M23736</link>
    <description>&lt;P&gt;Ignore the 'DATA new' step. That was just to simulate some data so that I could demonstrate the&amp;nbsp;technique. Use the code that begins with the long 'divider' comment /*************************************/&lt;/P&gt;</description>
    <pubDate>Mon, 16 Apr 2018 18:24:37 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-04-16T18:24:37Z</dc:date>
    <item>
      <title>SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454210#M23727</link>
      <description>&lt;P&gt;Hi Guys&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an issue when I'm running this code of my dataset.&amp;nbsp; which sas&amp;nbsp;giving (Not responding) after a few minutes&amp;nbsp;by&amp;nbsp;running this code, while when I was running the same code for small dataset had great results.&amp;nbsp; Dataset has 218006 observations and 28 variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you think the best way to solve this problem?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SORT DATA = NEW;
BY  cow_id pr;
RUN;

proc nlin data = new outest=ESTIMATES;
parms A = 15 B = 0.19 C = -0.0012 ;
bounds  A B C &amp;gt; 0; 
by cow_id pr;
model  TEST_DAY_MILK_KG = A * Time **b * exp(-C*Time);
output out = Fit predicted = Pred ;
run;


proc sql;
create table persistency as
select 
cow_id,pr,
A, B, C, 
-(B+1)*LOG(C) as P,
A * (B/C)**(B) * exp(-B) as peakYield,
(B/C) as tmdays
from ESTIMATES
where _TYPE_ = "FINAL";
select * from persistency;
run;
quit;

data merged;
merge new persistency;
by cow_id pr;
run;

PROC SORT DATA = MERGED;
BY cow_id time ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 22:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454210#M23727</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-04-14T22:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454230#M23728</link>
      <description>Please run each of the procs / data step one by one.&lt;BR /&gt;You can identify the error.&lt;BR /&gt;Then post the logs</description>
      <pubDate>Sun, 15 Apr 2018 03:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454230#M23728</guid>
      <dc:creator>thesasuser</dc:creator>
      <dc:date>2018-04-15T03:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454251#M23729</link>
      <description>&lt;P&gt;This part:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select * from persistency;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;sends all data from the dataset to the output window, which can take&amp;nbsp;&lt;EM&gt;very&lt;/EM&gt; long in a client/server environment and cause the client (EG) to hang/crash in some cases because of running out of memory.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 06:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454251#M23729</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-15T06:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454258#M23730</link>
      <description>&lt;P&gt;this part takes a long time and then following by not responding prosses, and I can't reach&amp;nbsp;the log file of the software or any tool of the software, which forces me to end the program.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc nlin data = new outest=ESTIMATES;
parms A = 15 B = 0.19 C = -0.0012 ;
bounds  A B C &amp;gt; 0; 
by cow_id pr;
model  TEST_DAY_MILK_KG = A * Time **b * exp(-C*Time);
output out = Fit predicted = Pred ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 08:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454258#M23730</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-04-15T08:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454261#M23731</link>
      <description>&lt;P&gt;Hello &lt;BR /&gt;You have defined c =-0.0012&lt;BR /&gt;Again in the bounds A B C&amp;gt;0&lt;BR /&gt;These two statements are contradictory.&lt;BR /&gt;Remove the negative sign. Take C=0.0012&lt;BR /&gt;There is already a negative sign in the exp part.&lt;BR /&gt;Please try this and let us know&lt;BR /&gt;Please don’t forget to put&lt;BR /&gt;endsas; before proc sql. &lt;BR /&gt;Pl also take care of the suggestion by Kurt.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify your model by linearizing it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 10:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454261#M23731</guid>
      <dc:creator>thesasuser</dc:creator>
      <dc:date>2018-04-15T10:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454295#M23732</link>
      <description>&lt;P&gt;Unfortunately, nothing change. I'm still having the same issue.&lt;/P&gt;&lt;P&gt;I will try much more to see what will happen.&lt;/P&gt;&lt;P&gt;thank you so much for your time that you spent to help me out with that problem, and I will keep in touch&amp;nbsp;with you if I found any solution&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 20:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454295#M23732</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-04-15T20:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454330#M23733</link>
      <description>&lt;P&gt;Further to what I have said,. you should reconsider your model.&lt;BR /&gt;&lt;SPAN&gt;TEST_DAY_MILK_KG &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; A &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Time&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;**&lt;/SPAN&gt;&lt;SPAN&gt;b &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;C&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Time&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;At Time=0 (start)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Time**b=0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exp(-C*Time) =exp(0) =1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thus&amp;nbsp;&lt;SPAN&gt;TEST_DAY_MILK_KG &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; A &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;(0)*(1) =0&lt;/P&gt;
&lt;P&gt;At Time = Infinity &amp;nbsp; (After a large time)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Time **b will be very large or infinity&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exp(-C * Time)=1/exp(C*Time)=1/infinity =0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thus&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TEST_DAY_MILK_KG &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; A &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;(Infinity)*0 = 0&lt;/SPAN&gt; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though I understand modeling, I do not know about your process. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 01:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454330#M23733</guid>
      <dc:creator>thesasuser</dc:creator>
      <dc:date>2018-04-16T01:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454511#M23734</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;What do you think the best way to solve this problem?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I think the best way to solve this equation is to transform it to a&amp;nbsp;LINEAR&amp;nbsp; system. If&lt;/P&gt;
&lt;P&gt;M = A * t**B * exp(-C*t)&lt;/P&gt;
&lt;P&gt;then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;log(M) = log(A)&amp;nbsp;+ B*log(t) - C*t;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, in the DATA step define&lt;/P&gt;
&lt;P&gt;logM = log(TEST_DAY_MILK_KG);&lt;/P&gt;
&lt;P&gt;logT = log(Time);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use PROC REG to solve the linear system. If desired, you can transform the parameter estimates and predictions back to their original scale, as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* simulate data */
data new;
do cow_id=1,2; pr=1;
   do Time = 1 to 500 by 7;
      logM = log(15) + 0.2*log(Time) - 0.0012*Time + rand("Normal",0,0.05);
      TEST_DAY_MILK_KG = exp(logM);
      output;
   end;
end;
keep TEST_DAY_MILK_KG Time cow_id pr;
run;
/* end simulation */&lt;BR /&gt;/************************************/

/* take LOG transform of the data */
data LOG;
   set new;
   logM = log(TEST_DAY_MILK_KG);
   logT = log(Time);
run;

/* linear regression */
proc reg data=LOG noprint outest=LogESTIMATES;
   by cow_id pr;
   model  logM = logT Time;
   output out = LogFit predicted = LogPred;
run;

/* transform estimates to original scale */
data Estimates;
   set LogESTIMATES;
   A = exp(Intercept);
   B = logT;
   C = -Time;
run;

/* transform predictions to original scale */
data Fit;
   set LogFit;
   Pred = exp(LogPred);
run;

/* graph data; overlay fit */
proc sgplot data=Fit;
   where cow_id=1 and pr=1;
   scatter x=Time y=TEST_DAY_MILK_KG;
   series x=Time y=Pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454511#M23734</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-04-16T18:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454525#M23735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;&lt;P&gt;But I have more questions about this part of the code. I want to keep all cow_id data, this one just presented two cow_ids and I&amp;nbsp;have a lot&amp;nbsp;in my&amp;nbsp;dataset.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do cow_id=1,2; pr=1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;also, I want&amp;nbsp;to keep all variables that presented in data new.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;keep TEST_DAY_MILK_KG Time cow_id pr;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So, how it could look like this code?&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
do cow_id=1,2; pr=1;
   do Time = 1 to 500 by 7;
      logM = log(15) + 0.2*log(Time) - 0.0012*Time + rand("Normal",0,0.05);
      TEST_DAY_MILK_KG = exp(logM);
      output;
   end;
end;
keep TEST_DAY_MILK_KG Time cow_id pr;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454525#M23735</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-04-16T18:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Not responding</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454530#M23736</link>
      <description>&lt;P&gt;Ignore the 'DATA new' step. That was just to simulate some data so that I could demonstrate the&amp;nbsp;technique. Use the code that begins with the long 'divider' comment /*************************************/&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 18:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-Not-responding/m-p/454530#M23736</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-04-16T18:24:37Z</dc:date>
    </item>
  </channel>
</rss>

