fracpol {dosresmeta}R Documentation

Fractional Polynomials

Description

Two-order fractional polynomials transformation for continuous covariates.

Usage

fracpol(x, p = c(1, 1), shift, scale, scaling = TRUE)

Arguments

x

a numeric vector.

p

a vector of length 2 with the powers of x to be included.

shift

optional scalar representing the shift, if scaling = TRUE. If not specified it is se internally equal to 0.

scale

optional scalar representing the scale, if scaling = TRUE. If not specified it is se internally equal to 1.

scaling

a logical indicating if the measurements are scaled prior to model fitting.

Details

The fracpol is based on the FP function in the mboost package. See help(FP) for more details.

Value

A matrix including the trasformations corresponding to the input values.

Author(s)

Alessio Crippa, alessio.crippa@ki.se

References

Royston, Patrick, and Douglas G. Altman. "Regression using fractional polynomials of continuous covariates: parsimonious parametric modelling." Applied Statistics (1994): 429-467.

See Also

mboost, rcs.eval

Examples

## Load data and run the model
data("alcohol_cvd")

with(alcohol_cvd, fracpol(dose, p = c(.5, .5)))

model <- dosresmeta(formula = logrr ~ fracpol(dose, p = c(.5, .5)), type = type, id = id,
                    se = se, cases = cases, n = n, data = alcohol_cvd) 
                    
## Test for significance of the overall dose-response association
waldtest(b = coef(model), Sigma = vcov(model), Terms = 1:nrow(vcov(model)))


[Package dosresmeta version 2.0.1 Index]