linear_model: fit a linear model

View source: R/linear_model.r

linear_modelR Documentation

fit a linear model

Description

This is a function taking a formula, a dataframe and an optional list of contrast for factor variables, and fit a linear model and return the coefficients of the model.

Usage

linear_model(formula, df, contrasts = NULL)

Arguments

formula

an object of class "formula": describing the model to be fitted.

df

a dataframe that containing all the variables in the model.

contrasts

an optional list of contrasts for factor variables.

Examples

data(iris)
form <- Sepal.Length ~ Sepal.Width
gradient_descent(formula = form,df = iris)

carolineying/bis557 documentation built on April 17, 2023, 4 a.m.