R/myols.r

#'@title Beta Coefficients for standard OLS
#'
#'@description Returns the Beta values for an Ordinary Least Squares.
#'
#'@usage myols(x,y)
#'
#'@param x A matrix of dependent variables.
#'
#'@param y A vector that is used as the independent variable.
#'
#'@export
myols <- function(x, y) {
    
    bhat <- qr.solve(crossprod(x)) %*% t(x) %*% y
    return(bhat)
} 
Stevo15025/PANICr documentation built on May 9, 2019, 3:08 p.m.