ridgereg: Title

Description Usage Arguments Value Examples

View source: R/ridgereg.R

Description

The function ridgereg takes a formula object, a data.frame and a penalty parameter lambda as arguments, and returns a ridgereg object as an S3 class. It performs ordinary least squares or QR decomposition to calculate different statistics.

Usage

1
ridgereg(formula, data, lambda = 0, QR = FALSE)

Arguments

formula

a formula, like y~x

data

a data frame

lambda

an integer specifying the regularization penalty

QR

use QR decomposition if TRUE, else OLS

Value

A ridgereg class object

Examples

1
2
3
4
5
6
7
8
#' data(mtcars)

# Fitting a ridge regression model using OLS
model_ols <- ridgereg(formula = mpg ~ wt + cyl, data = mtcars, lambda = 1, QR = FALSE)
model_ols 

model_qr  <- ridgereg(formula = mpg ~ wt + cyl, data = mtcars, lambda = 1, QR = TRUE)
model_qr 

hankOlofs/LinReg documentation built on Oct. 26, 2020, 12:17 p.m.