linreg-class: Do you want to make a linear regression?

Description Fields Methods Examples

Description

This function make a "Reference Class" with class=linreg for a linjer regression

Fields

formula

The formula for the model

data

A object of class data.frame

Methods

coef()

Give you the coef values as a numeric vector

plot()

Printing out two graps of residuals and standardized residuals vs. fitted values.

pred()

Give you the predicted values as a numeric vector

print()

Give you a nice view of the calculation

resid()

Give you the residuals as a numeric vector

summary()

Give you a nice summary of the calculation

Examples

1
2
3
4
5
6
7
data(iris)
linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)$print()
linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)$pred()
linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)$summary()
linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)$resid()
linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)$coef()
linreg$new(Petal.Length~Sepal.Width+Sepal.Length, data=iris)$plot()

herwineric/Lab4_Albin_Eric documentation built on May 9, 2019, 5:24 p.m.