find_shift_factor {mfp2}R Documentation

Function that calculates a value used to shift predictor

Description

Function that calculates a value used to shift predictor

Usage

find_shift_factor(x)

Arguments

x

a numeric vector.

Details

For details on why shifting is necessary see the corresponding section in the documentation of mfp2().

This function implements the formula in Section 4.7 of Royston and Sauerbrei (2008).

Value

A numeric value that can be used to shift x to positive values. If all values are positive, or if x is binary then 0 is returned.

References

Royston, P., and Sauerbrei, W., 2008. Multivariable Model - Building: A Pragmatic Approach to Regression Anaylsis based on Fractional Polynomials for Modelling Continuous Variables. John Wiley & Sons.

Examples

x = 1:1000
find_shift_factor(x)


[Package mfp2 version 1.0.0 Index]