The least squares estimate of b in the model y = X b + e is found.
lsfit(x, y, wt = NULL, intercept = TRUE, tolerance = 1e-07, yname = NULL)
- a matrix whose rows correspond to cases and whose columns correspond to variables.
- the responses, possibly a matrix if you want to fit multiple left hand sides.
- an optional vector of weights for performing weighted least squares.
- whether or not an intercept term should be used.
- the tolerance to be used in the matrix decomposition.
- names to be used for the response variables.
If weights are specified then a weighted least squares is performed with the weight given to the jth case specified by the jth entry in
If any observation has a missing value in any field, that observation is removed before the analysis is carried out. This can be quite inefficient if there is a lot of missing data.
The implementation is via a modification of the LINPACK subroutines which allow for multiple left-hand sides.
A list with the following named components:
- the least squares estimates of the coefficients in the model (b as stated above).
- residuals from the fit.
- indicates whether an intercept was fitted.
- the QR decomposition of the design matrix.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Documentation reproduced from R 3.0.1. License: GPL-2.