The least squares estimate of ** b** in the model

*y = X b + e*

is found.

1 2 |

`x` |
a matrix whose rows correspond to cases and whose columns correspond to variables. |

`y` |
the responses, possibly a matrix if you want to fit multiple left hand sides. |

`wt` |
an optional vector of weights for performing weighted least squares. |

`intercept` |
whether or not an intercept term should be used. |

`tolerance` |
the tolerance to be used in the matrix decomposition. |

`yname` |
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 *j*th case specified by the *j*th
entry in `wt`

.

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:

`coef` |
the least squares estimates of the coefficients in
the model ( |

`residuals` |
residuals from the fit. |

`intercept` |
indicates whether an intercept was fitted. |

`qr` |
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.

`lm`

which usually is preferable;
`ls.print`

, `ls.diag`

.

1 2 3 |

What can we improve?

As an Amazon Associate I earn from qualifying purchases.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.

Close