linreg-class: A Reference Class for linear regression

Description Fields Methods

Description

This linear regression reference class will compute the coefficients, residuals, predicted values, standard errors for both the coefficients and the residuals, t-values and p-values, and the degrees of freedom of a model matrix based on the provided formula and data set.

Fields

formula

A formula object

data

A data set

Methods

coef()

Returns the coefficients.

initialize(formula, data)

The constructor will return an object of class linreg.

plot()

Plots two graphs; residuals vs fitted values, and scale-location.

pred()

Returns the predicted values.

print()

Prints how the function was called and the coefficients.

resid()

Returns the residuals.

summary()

Prints a summary of the model.


amemem/lab4package documentation built on Dec. 19, 2021, 1:39 a.m.