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

getResponse(formula, data)

Arguments

formula

Model formula

data

Dataframe

Value

Vector of response

Examples

data(pasi) data(pasi) getResponse(pasi.ch ~ dose, data=pasi)
#> [1] 73.6 94.4 88.8 84.3 94.0 100.0 100.0 100.0 28.4 100.0 92.6 100.0 #> [13] 65.2 95.1 98.0 97.9 71.0 73.6 100.0 61.1 0.7 58.2 76.6 75.8 #> [25] 96.6 100.0 94.4 31.7 90.5 100.0 96.6 93.6 90.4 88.1 94.7 64.3 #> [37] 98.0 98.3 21.4 51.4 47.7 96.0 -16.7 93.3 11.1 69.3 98.8 0.0 #> [49] 71.6 28.8 97.1 91.0 84.2 45.9 69.8 3.7 34.0 -42.5 0.0 70.4 #> [61] 0.0 82.3 65.7 31.8 91.1 0.0 43.2 -39.4 98.6 -3.7 16.4 -4.3
library(survival) data(ovarian) ovarian$subgroups <- as.factor(10*ovarian$ecog.ps+ovarian$rx) surv <- getResponse(Surv(futime,fustat)~rx, data=ovarian) print(surv)
#> [1] 59 115 156 421+ 431 448+ 464 475 477+ 563 638 744+ #> [13] 769+ 770+ 803+ 855+ 1040+ 1106+ 1129+ 1206+ 1227+ 268 329 353 #> [25] 365 377+
class(surv)
#> [1] "Surv"