```Date: Thu, 17 Jul 2003 13:47:23 GMT Reply-To: julierog@ix.netcom.com Sender: "SAS(r) Discussion" From: Roger Lustig Subject: Re: Use SAS to evaluate equation Content-Type: text/plain; charset=us-ascii; format=flowed Rick: If you've had two or three weeks of calculus, you can do that with pencil and paper--or perhaps a few punches of your calculator. At the maximum, the slope of the curve is zero. The slope of the curve is the derivative--which, in this case, is a quadratic equation: b + 2cx + 3dx**2. Set that to zero and solve, using the quadratic formula. It should give you the two values of X for which the derivative is zero, i.e., a local max or min exists. The sign of parameter D will tell you which one is which. Best, Roger Lustig Rick wrote: > Howdy - > > I've just run a PROC REG, and have the constants for a cubic equation. > > Example: a + bx + cx**2 +dx**3 > > I have a dataset called REG where a,b,c,and d are defined. Now I want > to evaluate the equation to find the MAX point in the curve. > > The obvious way to do this is to create a new dataset, calculate a > number of points, then do a PROC MEANS to find the max.... TONS of > work, especially if I want accuracy... > > Is there some easier way to do this??? > > On my calculator I can do something like this: > MAX(a + bx +cx**2 + dx**3), -.5, .5 > parm[equation],[min range, max range] > > Thanks, > > -Rick ```

Back to: Top of message | Previous page | Main SAS-L page