Learn R Programming

grplasso (version 0.4-7)

predict.grplasso: Predict Method for grplasso Objects

Description

Obtains predictions from a grplasso object.

Usage

# S3 method for grplasso
predict(object, newdata, type = c("link", "response"),
        na.action = na.pass, ...)

Arguments

object

a grplasso object

newdata

data.frame or design matrix of new observations

type

the type of prediction. type = "link" is on the scale of linear predictors, whereas type = "response" is on the scale of the response variable, i.e. type = "response" applies the inverse link function to the linear predictors.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

...

other options to be passed to the predict function.

Value

A matrix whose columns correspond to the different values of the penalty parameter lambda of the grplasso object.

See Also

grplasso

Examples

Run this code
# NOT RUN {
data(splice)

contr <- rep(list("contr.sum"), ncol(splice) - 1)
names(contr) <- names(splice)[-1]

fit <- grplasso(y ~ ., data = splice, model = LogReg(), lambda = 10,
                contrasts = contr, standardize = TRUE)

pred <- predict(fit)
pred.resp <- predict(fit, type = "response")

## The following points should lie on the sigmoid curve
plot(pred, pred.resp)
# }

Run the code above in your browser using DataLab