Updates the right-hand side of the `formula`

and re-fits the `mpr`

model.

1 2 |

`object` |
an object of class “ |

`new` |
either a one-sided |

`comp` |
a numeric vector indicating the regression component(s) to be updated (only needed when |

`...` |
additional arguments to be passed to the updated |

There are two ways in whcih the `update.mpr`

function can be used. The first specificies which
component(s) will be updated
(via the `comp`

argument) along with the update to be applied via `new`

which must then be a one-sided
`formula`

. The second approach specifies both the components in question and the updates to be applied
through `new`

which is a `list`

of one-sided `formula`

objects (in this case `comp`

is ignored). See “Examples” below.

In the `new`

formula (or list of formulae) . means “what is already there”.

The fitted, updated `mpr`

object.

Kevin Burke.

`mpr`

, `addterm`

, `dropterm`

, `stepmpr`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ```
# Veterans' administration lung cancer data
data(veteran, package="survival")
head(veteran)
# Weibull MPR treatment model
mod1 <- mpr(Surv(time, status) ~ list(~ trt, ~ trt), data=veteran,
family="Weibull")
# remove trt from first component
update(mod1, ~ . - trt, comp=1)
update(mod1, list(~ . - trt, ~ .))
# remove trt from both components
update(mod1, ~ . - trt, comp=1:2)
update(mod1, list(~ . - trt, ~ . - trt))
# add celltype to second component
update(mod1, ~ . + celltype, comp=2)
update(mod1, list(~ . , ~ . + celltype))
# simultaneously remove trt from first component and add celltype to second
# component. This is only possible using the approach where "new" is a list.
update(mod1, list(~ . - trt, ~ . + celltype))
# can also update other things, e.g. "family"
update(mod1, ~ ., family="Gompertz")
update(mod1, ~ . + celltype, family="Loglogistic")
mod2 <- update(mod1, ~ ., family="Burr") # change to Burr model
mod2
update(mod2, ~ . + celltype, comp=2:3) # add celltype to components 2 and 3
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.