Learn R Programming

sasLM (version 1.0.1)

lfit: Linear Fit

Description

Fits a least squares linear model.

Usage

lfit(x, y, eps=1e-8)

Value

coefficients

beta coefficients

g2

g2 inverse

rank

rank of the model matrix

DFr

degrees of freedom for the residual

SSE

sum of squares error

SST

sum of squares total

DFr2

degrees of freedom of the residual for the beta coefficient

Arguments

x

a result of ModelMatrix

y

a column vector of the response (dependent) variable

eps

A value less than this is considered zero.

Author

Kyun-Seop Bae k@acr.kr

Details

A minimal version of the least squares fit of a linear model

See Also

ModelMatrix

Examples

Run this code
  f1 = uptake ~ Type*Treatment + conc
  x = ModelMatrix(f1, CO2)
  y = model.frame(f1, CO2)[,1]
  lfit(x, y)

Run the code above in your browser using DataLab