Learn R Programming

ProxReg (version 1.1.2)

ridge: Ridge regression

Description

ridge function estimates the coefficients for a linear model using Ridge regression.

Usage

ridge(data,y,x,lambda)

Value

a matrix with the coefficients for each lambda

Arguments

data

name of the dataset

y

name of dependent variables

x

name of independent variable

lambda

a numeric value or a numeric vector to penalize the squared residual

Examples

Run this code
ridge(mtcars,"hp",c("mpg","qsec","disp"),c(0.01,0.1))

Run the code above in your browser using DataLab