Learn R Programming

MachineShop (version 2.0.0)

response: Extract Response Variable

Description

Extract the response variable from an object.

Usage

response(object, ...)

# S3 method for MLModelFit response(object, newdata = NULL, ...)

# S3 method for ModelFrame response(object, newdata = NULL, ...)

# S3 method for recipe response(object, newdata = NULL, ...)

Arguments

object

model fit result, ModelFrame, or recipe.

...

arguments passed to other methods.

newdata

data frame from which to extract the response variable values if given; otherwise, object is used.

Examples

Run this code
# NOT RUN {
## Survival response example
library(survival)
library(MASS)

mf <- ModelFrame(Surv(time, status != 2) ~ sex + age + year + thickness + ulcer,
                 data = Melanoma)
response(mf)

# }

Run the code above in your browser using DataLab