anchor_regression {AnchorRegression}R Documentation

anchor_regression

Description

Perform an Anchor Regression as described in Rothenhäusler et al.2020

Usage

anchor_regression(x, anchor, gamma, target_variable, lambda = "CV")

Arguments

x

is a dataframe containing the matrix x containing the independent variables

anchor

is a dataframe containing the matrix anchor containing the anchor variable

gamma

is the regularization parameter for the Anchor Regression

target_variable

is the target variable name contained in the x dataframe

lambda

indicates the lambda that is used in the Anchor Regression. 'CV' is used if it should be estimated by cross validation on the full subset.

Value

A list with coefficient values and a list with the respective names overview_print. Additionally the transformed data as x and y plus the fixed lambda coefficient.

Examples

x <- as.data.frame(matrix(data = rnorm(1000),nrow = 100,ncol = 10))
anchor <- as.data.frame(matrix(data = rnorm(200),nrow = 100,ncol = 2))
colnames(anchor) <- c('X1','X2')
gamma <- 2
target_variable <- 'V2'
anchor_regression(x, anchor, gamma, target_variable)

[Package AnchorRegression version 0.1.3 Index]