Generalized Nonlinear Least Squares
Choose Statistics Generalized Least Squares
Nonlinear. The dialog shown below appears.
Model page
In the Generalized Nonlinear Least Squares 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.
Enter an S-PLUS expression that identifies the rows to use in the analysis. To use all the rows in the data set, leave this field blank.
Select this box to omit from the analysis any rows in the data set that contain missing values for any of the variables in the model.
Model
Enter an expression in the S-PLUS language specifying the nonlinear regression model. The variables used in the formula are the columns of the data set, the parameters to be estimated, and S-PLUS functions.
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
In the Generalized Nonlinear Least Squares dialog, the Options page has the following options:
The variance functions are used to model heteroscedasticity in the within-group error.
Optimization Options
Control Enter a list of control values for the estimation algorithm to replace the default values returned by the function lmeControl. Defaults to an empty list.
Correlation structures are used to model within-group correlation not captured by the random effects. These are generally associated with temporal or spatial dependencies.
Results page
In the Generalized Nonlinear Least Squares dialog, the Results page has the following options:
Printed Results
Short Output for Generalized Least Squares Regression
Display a short summary of the model fit. This includes the model formula, the regression coefficients, the residual standard error and the degrees of freedom.
Long Output for Generalized Least Squares Regression
Display a detailed summary of the model fit. This includes the model formula, the regression coefficients and their standard errors, t-statistics, and p-values, the residual standard error, the degrees of freedom, the correlation coefficients, and standardized residuals.
ANOVA Table
Display an analysis of variance table. The sums-of-squares in the table are for the terms added sequentially (Type I sums-of-squares).
Confidence Intervals
Select this to print the confidence intervals.
Saved Results
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.
Pearson Residuals
Select to save the Pearson residuals. They are a rescaled version of the working residuals. Their sums-of-squares is the chi-squared statistic.
Normalized Residuals
Select this to save the normalized residuals.
Response Residuals
Select to save the response residuals. These are the ordinary residuals (the response minus the fitted value).
Plot Page
In the Generalized Nonlinear Least Squares dialog, the Plots page has the following options:
Plots
Residuals vs Fit
Select this to display a plot of the residuals versus the fitted values.
Sqrt Abs Residuals vs Fit
Display a plot of the square root of the absolute values of the residuals versus the fitted values. This plot is useful for checking for the constant variance assumption of the model.
Response vs Fit
Display a plot of the response variable versus the fitted values. The line y = x is also drawn on the graph.
Residuals Normal QQ
Display a normal quantile-quantile plot of the residuals.
Augmented Predictions
Select this to obtain a plot of predictions versus the primary covariate, with a different panel for each value of the grouping factor.
Autocorrelation of Residuals
Select this to plot the empirical autocorrelation function for the within-group residuals from the mixed-effects model fitted.
Variogram of Residuals
Select this to plot the semi-variogram for the within-group residuals.
Specified Formula
Select this to activate the formula field thereby adding considerable flexibility to the type of plot obtained from the linear mixed-effects object.
The formula gives considerable flexibility in the type of plot specification. A conditioning expression (on the right side of a | operator) always implies that different panels are used for each group.
General Options
Group Variables A panel will be produced for each level of the variable selected here.
Include Grid Select this if you want a grid to be added to the plot.
Augmented Prediction Options
Primary Covariate Covariate to be used to generate the augmented predictions. By default, if a covariate can be extracted from the data used to generate object it will be used as primary.
Minimum lower limit for the primary covariate. Defaults to min(primary)
Maximum upper limit for the primary covariate. Defaults to max(primary)
Number of Values the number of primary covariate values at which to evaluate the predictions. Defaults to 51.
Variogram Options
The semi-variogram for the within-group residuals from an linear mixed effects model fit is calculated for pairs of residuals within the same group.
Formula Choose a variable to be used for calculating the distances between residual pairs, preceded by a "~". For example, enter "~Time" to specify a formula for the covariate Time.
Predict page
In the Generalized Nonlinear Least Squares dialog, the Predict page has the following options:
Standard Predictions
Save Predictions
Select this to save the standard predictions.
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. If an object with the name you enter does not already exist (in database 1), then it is created
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.
Augmented Predictions
Save Augmented Predictions
Select this to save the augmented predictions.
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. If an object with the name you enter does not already exist (in database 1), then it is created
Primary Covariate
Choose a covariate to be used to generate the augmented predictions. By default, if a covariate can be extracted from the data used to generate the object, it will be used as primary.
Minimum
Enter a lower limit for the primary covariate. Defaults to min(primary).
Maximum
Enter an upper limit for the primary covariate. Defaults to max(primary).
Number of Values
Enter the number of primary covariate values at which to evaluate the predictions. Defaults to 51.
S-Plus language functions related to Generalized Nonlinear Least Squares Regression
Gnls, gnlsControl, gnlsObject, corStruct, varFunc, corClasses, varClasses