fit_null_step: Function to fit null model excluding variable of interest

View source: R/mfp_step.R

fit_null_stepR Documentation

Function to fit null model excluding variable of interest

Description

"Null" model here refers to a model which does not include the variable of interest xi. For parameter definitions, see find_best_fp_step(). All parameters captured by ... are passed on to fit_model().

Usage

fit_null_step(x, xi, y, powers_current, powers, acdx, ...)

Arguments

x

an input matrix of dimensions nobs x nvars. Does not contain intercept, but columns are already expanded into dummy variables as necessary. Data are assumed to be shifted and scaled.

xi

a character string indicating the name of the current variable of interest, for which the best fractional polynomial transformation is to be estimated in the current step.

y

a vector for the response variable or a Surv object.

powers_current

a list of length equal to the number of variables, indicating the fp powers to be used in the current step for all variables (except xi).

powers

a named list of numeric values that sets the permitted FP powers for each covariate.

acdx

a logical vector of length nvars indicating continuous variables to undergo the approximate cumulative distribution (ACD) transformation.

...

passed to fit_model().

Value

A list with two entries:

  • powers: fp power(s) of xi in fitted model - in this case NA.

  • metrics: a matrix with performance indices for fitted model.


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