get_selected_variable_names: Extract Names of Selected Variables from an 'mfp2' Model

View source: R/mfp2.R

get_selected_variable_namesR Documentation

Extract Names of Selected Variables from an mfp2 Model

Description

Returns the names of predictors retained in the final model after MFP selection, as recorded in the selected column of object$fp_terms. Usually a selected variable has at least one fractional-polynomial power that is not NA. The exception is a spike-at-zero term for which only the binary indicator for x = 0 is retained: it is selected although all of its powers are NA. Factors are reported by their variable name, not by their contrast columns.

Usage

get_selected_variable_names(object)

Arguments

object

A fitted mfp2() object.

Value

Character vector of selected predictor names, ordered according to the xorder used in the mfp2() call.

See Also

mfp2(), print.mfp2()

Examples

# Gaussian model
data("prostate")
x <- as.matrix(prostate[, 2:8])
y <- as.numeric(prostate$lpsa)
fit <- mfp2(x, y, verbose = FALSE)
get_selected_variable_names(fit)


mfp2 documentation built on Nov. 14, 2026, 1:06 a.m.