linreg | R Documentation |
function for calculating the linear regression
linreg(df)
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. |
A dataframe comprising of your the estimated values of the regression weights if the input data does not suffer from multicollinearity
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.