Displaying 1 result from an estimated 1 matches for "subwrap3".
Did you mean:
subwrap1
2007 Nov 09
2
wrapper for coxph with a subset argument
...estdf, "sex == 'F'")
# Neither of the above use the coxph subset argument
# If I try using that, I get stuck with expressions,
# I've tried many
# different things in the subset argument, but none
# seem to do the trick. Is using this argument in a
# program even advisable?
subwrap3 <- function(x, sb) {
coxph(Surv(times,event)~trt, data = x,
subset = eval(substitute(sb), x))
}
subwrap3(testdf, sex == 'F') #does not work
# Using a string, this works, however.
subwrap4 <- function(x, sb) {
coxph(Surv(times,event)~trt, data = x, subset = eval(parse(text=...