linear.mod: A function to run linear regression

Description Usage Arguments Value Examples

View source: R/linear.mod.R

Description

This function runs linear regression model treating the response as continuous

Usage

1
linear.mod(dat, intercept = TRUE)

Arguments

dat

n*(p+1) data frame with the covariates and the response vector

intercept

logical. whether to include the intercept or not. default is TRUE

Value

A list of

betahat

A vector of beta estimates from the linear regression model.

yhat

A vector of estimated response using the beta estimates from the model.

Examples

1
2
3
4
5
data(red_train)
rbeta = c('volatile.acidity', 'total.sulfur.dioxide','pH','alcohol','sulphates')
dat = red_train[,which(names(red_train)%in% c(rbeta,'quality'))]
linfit = linear.mod(dat, intercept=TRUE)
beta = linfit$betahat

group-wine/sommelieR documentation built on May 21, 2019, 1:43 p.m.