View source: R/preprocessing.R
find_scale_factor | R Documentation |
Function that calculates an integer used to scale predictor
find_scale_factor(x)
x |
a numeric vector already shifted to positive values (see
#' @examples x = 1:1000 find_scale_factor(x) |
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.
An integer that can be used to scale x
to a reasonable range. For binary
variables 1 is returned.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.