fp: Fractional polynomial regression with one independent...

View source: R/fp.R

Fractional polynomial regression with one independent variableR Documentation

Fractional polynomial regression with one independent variable.

Description

Fractional polynomial regression with one independent variable.

Usage

fp(y, x, aa, di = NULL, type = "normal", full = FALSE, seb = FALSE, 
tol = 1e-07, maxiters = 100) 

Arguments

y

The dependent variable, a numerical vector.

x

A vector, the independent variable.

aa

A vector with two values indicating the range of the optimal value of \alpha to search within.

di

This is valid only for the Weibull regression. A vector with 1s and 0s indicating the censored value. The value of 1 means uncesored value, whereas the value of 0 means censored value.

type

The type of regression model: "normal", "logistic", "poisson", "spml" (SPML regression), "gamma", "normlog", "weibull", "negbin".

full

If this is FALSE, the coefficients and the deviance will be returned only. If this is TRUE, more information is returned.

seb

Do you want the standard error of the estimates to be returned? TRUE or FALSE.

tol

The tolerance value to terminate the Newton-Raphson algorithm.

maxiters

The max number of iterations that can take place in each regression.

Details

The independent variable is power transformed and this function searches for the optimal power.

Value

A list including:

a

The power that yields the optimal fit.

mod

The model with the independent variable power transformed.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Royston P. and Altman D. G. (1994). Regression using fractional polynomials of continuous covariates: parsimonious parametric modelling. Journal of the Royal Statistical Society: Series C (Applied Statistics), 43(3): 429-453.

See Also

logistic_only, poisson_only

Examples

y <- rnorm(100)
x <- abs( rnorm(100) )
mod <- fp(y, x, c(-2, 2) )

Rfast2 documentation built on Aug. 8, 2023, 1:11 a.m.