Nonlinear Regression

Nonlinear regression uses a specific nonlinear relationship to predict a continuous variable from continuous or categorical variables. The form of the nonlinear relationship is usually derived from application-specific theoretical models.

To use nonlinear regression, the user specifies the form of the model in S-PLUS syntax and provides starting values for the parameter estimates.

To perform nonlinear regression

Choose Statistics __image\arrow5.gif Regression __image\arrow5.gif Nonlinear. The dialog shown below appears.

Model page

__image\nlnreg1.gif

In the Nonlinear Regression dialog, the Model page has the following options:

Data

Data Set

Select a data set from the dropdown list or type the name of a data set. You can also type into the Data Set edit field any expression that evaluates to a data set.

Model

Nonlinear Formula

Enter an expression in the S-Plus language specifying the nonlinear regression model.

Parameters (name=value)

Enter a comma-separated list of the parameters in the formula that are to be estimated along with their initial values, each given in the form name=value.

Save Model Object

In the Save As field, enter the name for the object in which to save the results of the analysis. If an object with this name already exists, its contents are overwritten. The model object can be used in later functions such as plotting.

Options page

Use the Options page, shown above, to control the way in which the nonlinear least squares regression is carried out.

__image\nlnreg2.gif

In the Nonlinear Regression dialog, the Options page has the following options:

Optimization Parameters

Maximum Iteration

Enter a numeric value specifying the maximum number of iterations to perform for the maximum likelihood estimation procedure.

Convergence Tolerance

Enter a positive number used as the tolerance for the convergence criterion in the algorithm.

Min. Scale for Step Shrinkage

Enter the minimum factor by which to shrink the default step size in an attempt to decrease the sum of squares. The default value appears in the field.

Print Iteration Trace

Select to print a summary of each iteration.

Use Partial Linear Algorithm

Select to use the Golub-Pereyra algorithm for partially linear least-squares models.

Results page

On the Results page, choose the type of printed results and how you would like the results of the analysis saved. To select or clear an option, click the check box.

__image\nlnreg3.gif

In the Nonlinear Regression dialog, the Results page has the following options:

Printed Results

Short Output for Nonlinear Regression

Produce a short summary of the nonlinear fit.

Long Output for Nonlinear Regression

Produce a detailed summary of the nonlinear fit.

Saved Results

Save In

Enter the name of a data set in which a part of the analysis, such as fitted values and residuals, predictions, confidence intervals, or standard errors, is saved.

Fitted Values

Save the fitted values from the model in the object specified in Save In.

Working Residuals

Store the working residuals in the object specified in Save In. The working residuals are the response minus the fitted value.

Predict page

__image\nlnreg4.gif

In the Nonlinear Regression dialog, the Predict page has the following options:

New Data

Enter the name of a matrix or data set to use for computing predictions. It must contain the same names as the terms in the right side of the formula for the model. If omitted, the original data are used for computing predictions.

Save

Save In

Enter the name of a data set in which a part of the analysis, such as fitted values and residuals, predictions, confidence intervals, or standard errors, is saved.

Predictions

Select this to save predictions to the data set specified in Save In.

Confidence Intervals

Store lower and upper confidence limits in the object specified in Save In.

Standard Errors

Store the pointwise standard errors for the predictions in the object specified in Save In.

Options

Confidence Level

Enter the confidence level to use when computing confidence intervals. This value should be less than 1 and greater than 0.

S-Plus language functions related to Nonlinear Least Squares Regression

nls, print.nls, predict.nls, summary.nls

Other related S-Plus language functions

ms, nlminb, nlregb