Learn R Programming

mfp2 (version 1.1.1)

coef.mfp2: Extract Coefficients from an mfp2 Model

Description

Returns coefficients from a fitted mfp2() model. This is a method for the generic stats::coef() function.

Usage

# S3 method for mfp2
coef(object, ...)

Value

A named numeric vector for scalar-response models. For multinomial models, a matrix with one row per non-reference outcome and one column per fitted term; powers are common across rows but coefficients are outcome specific.

Arguments

object

A fitted mfp2() object.

...

Not used.

See Also

mfp2(), summary.mfp2(), predict.mfp2()

Examples

Run this code
data("prostate")
fit <- mfp2(
  lpsa ~ fp(age) + fp(cavol) + fp(weight) + svi,
  data = prostate,
  verbose = FALSE
)
coef(fit)

Run the code above in your browser using DataLab