linear_model: Fit a linear model

Description Usage Arguments Value Examples

View source: R/linear-model.R

Description

This is a function to approximately reproduce the coefficients in the linear model object that can be created by 'lm()'. The method being used to compute the OLS estimates is QR decomposition.

Usage

1
linear_model(formula.input, data.input, contrasts.input = NULL)

Arguments

formula.input

a formula with the legal format.

data.input

a dataframe provided by the user.

contrasts.input

a list of contrasts of interest (default=NULL).

Value

a list including the OLS estimates, simulating what will be produced by 'lm()'.

Examples

1
2
3
data(iris)
fit <- linear_model(Sepal.Length ~ ., iris)
fit$coefficients

BillyTian/bis557 documentation built on Dec. 19, 2020, 7:30 a.m.