myLM: Linear Model Function

Description Usage Arguments Value Examples

View source: R/myLM.R

Description

This function calculates the regression coefficients for linear regression as well as standard errors

Usage

1
myLM(X, Y, intercept = TRUE)

Arguments

X

an n x p matrix of explanatory variables

Y

an n dimensional vector of responses

intercept

Boolean for whether an intercept term should be included, default is true

Value

Returns the OLS betas along with their respective standard errors

Examples

1
2
3
4
set.seed(12083)
X <- matrix(rnorm(100), 50, 2)
Y <- matrix(3 * X[,1] + 2 * X[,2] + rnorm(50))
myLM(X, Y)

stacyste/RegressionPkg documentation built on Nov. 24, 2019, 5:12 p.m.