simple_ols: Conduct Simple Linear Regression

View source: R/operations.R

simple_olsR Documentation

Conduct Simple Linear Regression

Description

Conduct Simple Linear Regression

Usage

simple_ols(X, Y, add_intercept = FALSE)

Arguments

X

An n \times m design matrix, optionally with an intercept column present.

Y

An n-length vector or n \times 1 matrix representing the response.

add_intercept

Logical. Should an intercept column (a column of 1s) be added to X?

Details

This function finds the minimum-norm least squares solution of X^T X β = X^T Y.

Value

Vector of estimated beta coefficients.


ryan-heslin/RegLesson documentation built on Aug. 5, 2022, 9:03 p.m.