lm.ridge.univariate: Ridge Regression for a single predictor variable

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function computes the ridge regression coefficients for a mdoel with a single predictor variable.

Usage

1

Arguments

x

vector of predictor observations.

y

vector of responses. The length of y must equal the length of x

lambda

vector of penalty terms. Default is lambda=0

scale

Scale x and y? Default is scale=TRUE.

Details

This function replaces the R function lm.ridge if only one predictor variable is used, as the latter function produces an error message in this case.

Value

A matrix with two columns and length(lambda) rows. In each row, the intercept (first colum) and the regression coefficient (second column) is stored.

Author(s)

Nicole Kraemer

See Also

ridge.net,ridge.cv

Examples

1
2
3
4
n<-100 # number of observations
x<-rnorm(100)
y<-rnorm(n)
ridge.object<-lm.ridge.univariate(x,y,lambda=1:10)

Example output

Loading required package: MASS
Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-10

Loading required package: ppls
Loading required package: splines
Loading required package: Epi

Attaching package: 'Epi'

The following object is masked from 'package:base':

    merge.data.frame

Loading required package: GeneNet
Loading required package: corpcor
Loading required package: longitudinal
Loading required package: fdrtool

parcor documentation built on May 1, 2019, 9:10 p.m.