linear_reg: Basic linear regression

Description Usage Arguments Value Examples

View source: R/linear_regression.R

Description

Basic linear regression

Usage

1
linear_reg(y, x)

Arguments

y

a vector of outcomes

x

a matrix of covariates

Value

a matrix of the corresponding betas

Examples

1
2
3
4
5
6
x1 <- mtcars$disp
x2 <- mtcars$hp
x <- cbind(x1, x2)
y <- mtcars$mpg
lm(mpg ~ disp + hp, data = mtcars)
linear_reg(y, x)

nt-williams/knowledge documentation built on Jan. 26, 2020, 1:08 a.m.