find_scale_factor {mfp2} | R Documentation |
Function that calculates an integer used to scale predictor
Description
Function that calculates an integer used to scale predictor
Usage
find_scale_factor(x)
Arguments
x |
a numeric vector already shifted to positive values (see
#' @examples x = 1:1000 find_scale_factor(x) |
Details
For details on why scaling is useful see the corresponding section in the
documentation of mfp2()
.
The determination of the scaling factor is independent (i.e. not affected by) shifts in the input data, as it only depends on the range of the input data.
Note that the estimation of powers is unaffected by scaling, the same powers are found for scaled input data. In extreme cases scaling is necessary to preserve accuracy, see Royston and Sauerbrei (2008). This formula uses the scaling formula from Section 4.11.1 of Royston and Sauerbrei (2008). Further information can also be found in the Stata manual for mfp at https://www.stata.com/manuals/rfp.pdf.
Value
An integer that can be used to scale x
to a reasonable range. For binary
variables 1 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.