flatten: Convert a structured coefficient set to a vector

Description Usage Arguments Details

View source: R/generics.R

Description

mphcrm stores coefficients in a list, not in a vector. This is because they should be treated differently according to whether they are probabilities, proportional hazards, or coefficients for factor levels or ordinary covariates. flatten extracts them as a named vector. unflatten puts them back in structured form.

Usage

1
2
3
4
5
6
7
flatten(x, exclude = attr(x, "exclude"))

unflatten(
  flesh,
  skeleton = attr(flesh, "skeleton"),
  exclude = attr(flesh, "exclude")
)

Arguments

x

parameter set as typically found in opt[[1]]\$par, where opt is returned from mphcrm.

exclude

For internal use

flesh

vector of class "relistable", as returned from flatten.

skeleton

For internal use

Details

flatten/unflatten is just a thinly disguised unlist/relist, but uses slightly more readable names.


durmod documentation built on March 31, 2020, 5:23 p.m.