BookmarkSubscribeRSS Feed
lxl65
Calcite | Level 5

dear all,

I have a question related to proc nlmixed. I am reading following SAS article:

 

https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_nlmixed_sec...

 

The original SAS code in this article is:

 

   proc nlmixed data=tree;
      parms b1=190 b2=700 b3=350 s2u=1000 s2e=60;
      num = b1+u1;
      ex  = exp(-(day-b2)/b3);
      den = 1 + ex;
model y ~ normal(num/den,s2e);
random u1 ~ normal(0,s2u) subject=tree; run;

I changed the above code to following:

 

 

   proc nlmixed data=tree;
      parms b1=190 b2=700 b3=350 s2u=1000 s2e=60;
      num = b1+u1;
      ex  = exp(-(day-b2)/b3);
      den = 1 + ex;
lh = pdf('normal', y , num/den, s2e); ll = log(lh); model y ~ general(ll);
random u1 ~ normal(0,s2u) subject=tree; run;

 

The parameter estimates of two codes are almost identical except for one parameter "s2e". The "s2e" from original code is 61.5; however  the "s2e" from modified code is only 7.8.

 

I thought the two codes should give same results. Can anyone point out what went wrong in modified code?

 

Thank you very much!

 

 

 

 

 

 

 

1 REPLY 1
Rick_SAS
SAS Super FREQ

The models are equivalent, but the code from the doc is estimating the variance whereas your code is estimating the standard deviation. Note that 61.5139 = (7.8430)**2

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1470 views
  • 0 likes
  • 2 in conversation