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

Fitting Linear Models

linreg is used to fit linear models. It can be used to carry out regression, variance and analysis of covariance.

Usage

 linreg(formula, data)

Arguments

formula : an object of class formula (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under ‘Details’.

data : a vector specifying a subset of observations to be used in the fitting process.

Value

An object of class linreg is a list containing at least the following components:

reg_coef : a named vector of coefficients

residuals : the residuals, that is response minus fitted values.

fitted_val : the fitted mean values.

degree_of_freedom : test

residul_variance : test

variance_reg_coef : test

t_value : test

p_value : test

References

R packages by Hadley Wickham

Examples

item <- linreg(formula = Petal.Length~Species, data = iris)
item$print()
item$summary()


abkw/lab04 documentation built on Oct. 31, 2019, 1:55 a.m.