knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(linear.regression)

Package Built By:

Usage

The [linear.regression] package is an attempt at a limited reconstruction of the [lm] package.

We define a model using the same notation that we would use for [lm]

data("iris")
linr = linreg(Petal.Length ~ Species + Sepal.Width, data = iris)

For a quick overview of our model (both the function call and the estimated coefficients) we can use the print(model) command:

print(linr)

If we only want a quick glance at the estimated coefficients, coef(model) works just as well:

coef(linr)

For a more in-depth summary of our model we use the summary(model) function:

summary(linr)

we can get our predicted (i.e. fitted) values with pred(model)

head(pred(linr), n=3)

plot(model) returns the "Residuals vs Fitted" as well as the "Scale-Location" plots:

plot(linr)


dsn00b/linear_regression documentation built on Nov. 9, 2021, 11:39 p.m.