myLinearRegression: myLinearRegression

Description Usage Arguments Value Examples

View source: R/myLinearRegression.R

Description

This function builds a linear regression model and returns the coefficients and their p-values. However, it provides the option to only regress using a certain set of rows within a dataset. This makes it very useful for passing your test/train splits or crossvalidation splits into the model. It also returns a scatterplot matrix if you have fewer than five independent variables. Created by Alex Moore.

Usage

1

Arguments

y

The dependent variable as a vector

x

The independent variables as a matrix

sub

The index of rows/observations you'll use for building the model

Value

A dataframe with the coefficients and p-values for the model

A scatterplot matrix if you have less than 5 independent variables.

Examples

1
myLinearRegression(mtcars$mpg, mtcars[ , 2:4], 1:20)

alexMoore190/myLinearPackage documentation built on Dec. 31, 2020, 7:41 p.m.