BookmarkSubscribeRSS Feed
Calcite | Level 5

I am in need to calculate the initial and final NLLS of ai, bi, ci. With this I have the initial estimates of ai, bi, ci. I aware that the following equations would help to calculate the initial and final NLLS . However, I am struggling to write the SAS code through PROC NLIN. I would be much thankful, if anyone may help to write the SAS Code PROC NLIN. 


Equation : yi = ai exp(-bi(x-ci)^2)


yi = 0.31, ai = 37, bi=3900.19, ci=0.314, x=0.291


The PROC NLILN documentation contains a Getting Started example as well as more compilcated examples. To use the procedure your data set should contain MULTIPLE pairs of the (x, y) data values. A typical usage is as follows:

proc nlin data=Have;
   parms a=37 b=3900 c=0.3;
   model y = a*exp(-b*(x-c)**2);

However, I will point out that you can solve this problem by using PROC GENMOD (or even PROC REG). If you take the log of both sides, your model becomes

log(Y) = log(a) - b*(x-c)**2

which (if you reparametrize) is equivalent to a quadratic model for log(Y):

log(Y) = B0 + B1*x + B2*x**2

Which approach is better depends on an assumption about how the errors are distributed.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 in conversation