linreg-class: A Reference Class to represent the regression model.

Description Arguments Fields Methods See Also Examples

Description

A Reference Class to represent the regression model.

Arguments

formula

A formula indicating the dependent and independent variables.

data

The data set from which values of observations are extracted based on the formula specification, for building the regression model.

Fields

formula

A character object representing the formula.

data

A string representing the name of the data set implemented to build the model.

Coeffficients

A named numeric vector representing the regressin coefficients of the model parameters.

Fitted_Values

A matrix containing the predicted values of the model.

Residuals

A matrix consisting the residual values of the models.

Standard_Residuals

a matrix containing the standardized residuals.

Sqrt_Standard_Residuals

A matrix including sqrt of the standardized residuals.

degrees_of_freedom

A numeric representing the degrees of freedom.

Residual_Variance

A matrix consisting the variance of the residuals.

Coefficients_Variance

A numeric vector representing the variances of the coefficients.

t_value

A numeric vector representing the t-value.

p-value

A numeric vector representing the p-value.

Methods

coef()

Returns the coefficients.

initialize(formula, data)

Initializing Function. A function to create a multiple linear regression model.

plot()

Plots two different plots. The fiitted values vs the residuals, and the fiitted values vs square root of standardized residuals.

pred()

Returns a the predicted values.

print()

Prints out the coefficients and coefficient names, in addition to the call of the function.

resid()

Returns a vector of residual values.

summary()

Returns the coefficients with their standard error, t-value and p-value as well as the estimate of standard error and the degrees of freedom in the model.

See Also

[https://en.wikipedia.org/wiki/Linear_regression]

Examples

1
2
linreg_mod <- linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)
 

mpirmoradiyan/lab4a documentation built on Nov. 4, 2019, 7:31 p.m.