fp.power: Provides Fractional Polynomials as Accessible Function

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/fpfunctions.r

Description

Provides fractional polynomials as accessible function.

Usage

1
 fp.power(z, a, b = NULL)  

Arguments

z

a scalar or vector of positive numerical values.

a

first power.

b

optional second power.

Details

The function returns fp(a) of z (and optionally fp(b) of z).

Value

A matrix with one or two columns (if a second power b was specified), and number of rows equal to the length of z. The columns are sorted by descending power.

Author(s)

Georg Heinze

References

Royston P and Altman D (1994). Regression Using Fractional Polynomials of Continuous Covariates: Parsimonious Parametric Modelling. J R STAT SOC C-APPL 43, 429-467.

Royston P and Sauerbrei W (2008). Multivariable Model-Building. A Pragmatic Approach to Regression Analysis Based on Fractional Polynomials for Modelling Continuous Variables. Wiley, Chichester, UK.

See Also

coxphw

Examples

1
2
3
4
fp.power(z = c(1, 4, 6), a = 1)
fp.power(z = c(1, 4, 6), a = 0.5)
fp.power(z = c(1, 4, 6), a = 0.5, b = 0.5)
fp.power(z = c(1, 4, 6), a = 0, b = 2)

Example output

Loading required package: survival
  fp(1)
1     1
4     4
6     6
  fp(0.5)
1 1.00000
4 2.00000
6 2.44949
  fp(0.5) fp(R0.5)
1 1.00000 0.000000
4 2.00000 2.772589
6 2.44949 4.388896
  fp(2)    fp(0)
1     1 0.000000
4    16 1.386294
6    36 1.791759

coxphw documentation built on July 8, 2020, 6:52 p.m.