simple_ols: simple_ols

Description Usage Arguments Value Examples

View source: R/simple_ols.R

Description

Compute the OLS linear regression for a given X and y. This is the most simple case of ordinary least square. In fact, this function will not perform any error checking because it's used as a internal function of least_square.

Usage

1
simple_ols(X, y)

Arguments

X

input X, it should be a matrix.

y

input y, this is the respond variable.

Value

it will return coefficient of beta, but it won't compute anything other than beta, such as R^2.

Examples

1
simple_ols(matrix(c(1,3,7,4,6,3),3,2), c(3,1,2))

keyuchen886/OLSregression documentation built on Jan. 1, 2021, 7:17 a.m.