linreg: function for calculating the linear regression

View source: R/linreg.R

linregR Documentation

function for calculating the linear regression

Description

function for calculating the linear regression

Usage

linreg(df)

Arguments

df

input a dataframe with more than two columns. The last column is always presumed to be the column of the independent variables in the perictor equation while the the others are presumed to be the dependent variables.

Value

A dataframe comprising of your the estimated values of the regression weights if the input data does not suffer from multicollinearity

Examples

linreg(reg_data1)
[,1]
[1,] 2.950339
[2,] 5.052787
[3,] 0.999999
[4,] 9.599983
(The reg_data1 dataset is available with the "StatsChitran" package)

linreg(reg_data2)
NULL
(The reg_data2 dataset is available with "StatsChitran" package. The function returns NULL in case
is an issue with multicollinearity in the input dataset)

Chitran1987/StatsChitran documentation built on Feb. 23, 2025, 8:30 p.m.