linreg.sor.Rd
This function implements linear regression by solving the normal equations. It constructs matrices X'X and X'Y and solves for beta in X'X*beta=X'Y using the iterative SOR solver of system of linear equations.
linreg.sor(Y, X)
Y | vector of outcome variable |
---|---|
X | matrix of covariates |
coefs vector of coefficients
linreg.sor(women$height,women$weight)#> $coefs #> [1] 25.7246016 0.2872409 #>