Skip to main content

Estimation of the Peak in Quadratic Regression

 Problem:  You are running a standard quadratic (polynomial) regression analysis, and are specifically interested in the X and Y values at the peak.  If you use standard regression software, typically there will be no option that allows the peak to be estimated, with standard errors.

Example:  You are studying Growth as a function of Age.  Of particular interest is when maximum Growth occurs, and at what Age.

SAS code to generate artificial data, and run the analysis is:

data one;
do Age=1 to 20;
Growth=95 + 2.7*Age - .3*Age*Age + 5*rannor(22);
end;
proc nlin plots=fit;
parms int=2 lin=1 quad=1;
model Growth = int + lin*Age + quad*Age*Age;
estimate 'Age at peak' -lin/(2*quad);
estimate 'Growth at peak' int + lin*(-lin/(2*quad)) + quad*(-lin/(2*quad))*(-lin/(2*quad));
run;


The standard quadratic regression model with intercept, linear and quadratic slopes, is coded into Proc NLIN which has the ability to estimate any function of the parameters.  The peak estimates are obtained using standard calculus, set the first derivative to zero to estimate Age at peak, then put that estimate into the quadratic regression equation to estimate Growth.
Output from the example is copied below, and you can visually verify that the peak estimates match the fitted curve.  Without using a statistically based process like this, you will not have standard errors or associated confidence intervals, which definitely help assess the confidence you should have in the estimated values.  Here we conclude that maximum growth occurs at 5.4 years, and maximum growth is 97.1 mm.


Additional Estimates
Label Estimate Standard
Error
DF t Value Approx
Pr > |t|
Alpha Approximate Confidence
Limits
Age at peak 5.4310 0.7727 17 7.03 <.0001 0.05 3.8007 7.0613
Growth at peak 97.1044 1.7731 17 54.76 <.0001 0.05 93.3634 100.8

Comments

Popular posts from this blog

Factorial ANOVA with control treatment not integrated into the factorial

Factorial treatment designs are popular, due to advantages of research on multiple treatment factors and how they interact.  But if the design includes a control treatment that is not part of the factorial, problems occur in estimation of least squares means.  A typical example is shown here, with 2 fertilizer and 3 irrigation treatments, giving 6 factorial treatment combinations, plus a control that is defined by a 3rd level of fertilizer, and a 4th level of irrigation: Fert1:Irrig2               Fert2:Irrig1             Fert1:Irrig1 Fert2:Irrig3               Fert1:Irrig3             Fert2:Irrig2           Control Other situations might have the control sharing a level of one of the factors, for example the control might be defined as Fert2:Irrig4.  But this still causes problems with estim...

Getting higher quality default graphs in SAS

Objective : I am running a statistical analysis in SAS, and the default ODS graphics look good, but I need them to be publication quality. SAS can automatically create some nice graphs, and has greatly increased the availability of graphs within procedures.  If you like what you see, you might copy graphs directly from the SAS output window, or possibly you save graphs and output to a pdf or other external file format.  But this output will be low quality, generally 75 dpi.  Instead, add the following statements to write graphics directly to files, allowing control of format and quality. ods graphics on /       width=7in       imagefmt=tiff       imagemap=off       imagename="MyPlot"       border=off; ods listing file="Body.rtf" style=journal gpath="."  dpi=600; Once these statements have been submitted, all graphs created by subsequent procedures will be written  to files na...