fit_OLS: Ordinary Least Squares

Description Usage Arguments Value Examples

View source: R/OrdinaryLeastSquares.R

Description

This function allows an user to fit a linear regression model using Ordinary Least Squares. For the function to work, the requirements for OLS need to be satisfied (i.e. design matrix has to be full rank etc.). A complete tutorial is provided as a vignette that can be accessed using “'vignette(package = "tureen625)““

Usage

1
fit_OLS(design_X, Y)

Arguments

design_X

the design matrix for the regression model. Must be matrix type

Y

the target variable for the regression model. Must be vector type

Value

Returns a list that contains several features of the linear regression model that is fit (see the provided Vignette for more details)

'param_estimate': a vector of the parameter estimates for the regression model

'residuals': a vector of the residuals for the regression model

'sigma_Sq' : the variance (sigma squared) associated with the regression model

'var_Mat' : the covariance-variance matrix of the beta estimates associated with the regression model

'param_StdErrors' : the std. errors associated with the parameter estimates for the regression model

'conf_int' : the 95 percent confidence intervals for the parameter estimates

'results' : a dataframe that organizes the parameter estimates, std. erros, and confidence intervals

Examples

1
2
3
4
5
6
matrix_object = cbind(1,rnorm(3,0,1)) # 3 x 2 matrix
vector_object = rnorm(3,0,1) # 3 x 1 vector

my_fit <- fit_OLS(design_X = matrix_object, Y = vector_object)

my_fit2 <- fit_OLS(matrix_object, vector_object)

tahmeed14/tureen625 documentation built on Dec. 2, 2019, 4:52 p.m.