Learn R Programming

CTP (version 3.0.1)

getResponse: Auxiliary function

Description

Getting the response vector out of an object of class 'formula'

Usage

getResponse(formula, data)

Arguments

formula

Model formula

data

Dataframe

Value

Vector of response

Examples

Run this code
# NOT RUN {
data(pasi)

data(pasi)
getResponse(pasi.ch ~ dose, data=pasi)

library(survival)
data(ovarian)
ovarian$subgroups <- as.factor(10*ovarian$ecog.ps+ovarian$rx)

surv <- getResponse(Surv(futime,fustat)~rx, data=ovarian)
print(surv)
class(surv)
# }

Run the code above in your browser using DataLab