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)
} 

Try the PANICr package in your browser

Any scripts or data that you put into this service are public.

PANICr documentation built on May 2, 2019, 4:40 a.m.