Learn R Programming

HiGarrote (version 2.0.0)

predict.HiGarrote: Make Predictions from a "HiGarrote" Object

Description

This function makes predictions from a linear model constructed using the important effects selected by HiGarrote.

Usage

# S3 method for HiGarrote
predict(object, new_D, ...)

Value

The function returns a list with:

new_U

A model matrix of new_D.

prediction_nng

Predictions for new_D. The coefficients of the predictive equation are based on nonnegative garrote estimates.

prediction_lm

Predictions for new_D. The coefficients of the predictive equation are estimated via ordinary least squares.

Arguments

object

An HiGarrote object.

new_D

A new design matrix where predictions are to be made.

...

Additional arguments passed to `predict`. Not used in this function.

Examples

Run this code
# Cast fatigue experiment
data(cast_fatigue)
X <- cast_fatigue[1:10,1:7]
y <- cast_fatigue[1:10,8]
fit_Hi <- HiGarrote::HiGarrote(X, y)

# make predictions
new_D <- cast_fatigue[11:12,1:7]
pred_Hi <- predict(fit_Hi, new_D)

Run the code above in your browser using DataLab