order_variables: Helper to order variables for mfp2 algorithm

View source: R/fit_mfp.R

order_variablesR Documentation

Helper to order variables for mfp2 algorithm

Description

To be used in fit_mfp().

Usage

order_variables(xorder = "ascending", x = NULL, ...)

order_variables_by_significance(
  xorder,
  x,
  y,
  family,
  weights,
  offset,
  strata,
  method,
  control,
  nocenter
)

Arguments

xorder

a string determining the order of entry of the covariates into the model-selection algorithm. The default is ascending, which enters them by ascending p-values, or decreasing order of significance in a multiple regression (i.e. most significant first). descending places them in reverse significance order, whereas original respects the original order in x.

x

a design matrix of dimension n * p where n is the number of observations and p the number of predictors including intercept for glms, or excluding intercept for Cox models.

...

passed to order_variables_by_significance.

y

a vector of responses for glms, or a Surv object generated using the survival::Surv() function for Cox models.

family

a character string naming a family function supported by glm() or "cox" for Cox models.

weights, offset

parameters for both glm and Cox models, see either stats::glm() or survival::coxph() depending on family.

strata, method, control, nocenter

Cox model specific parameters, see survival::coxph().

Value

A vector of the variable names in x, ordered according to xorder.

Functions

  • order_variables_by_significance(): Order by significance in regression model. The number of columns of x should be greater than 1 for Cox models.


mfp2 documentation built on Nov. 15, 2023, 1:06 a.m.