fracpoly: fracpoly

Description Usage Arguments Value Author(s) Examples

Description

fracpoly fits the best fitting fractional polynomial of degree 1 and 2.

Usage

1
fracpoly(y = y, x = x, covar = NULL, family = "gaussian")

Arguments

y

outcome.

x

exposure.

covar

data.frame with covariates.

family

the glm family (options: gaussian and binomial).

Value

List of best fitting polynomials of degrees 1 and 2 as well as associated statistics.

power_d1

power of the best-fitting fractional polynomial of degree 1

fp1

model of the best-fitting fractional polynomial of degree 1

power_d2

powers of the best-fitting fractional polynomial of degree 2

fp2

model of the best-fitting fractional polynomial of degree 2

p_d1

p-value testing the best-fitting fractional polynomial of degree 1 against the linear model

p_d2

p-value testing the best-fitting fractional polynomial of degree 2 against the best-fitting fractional polynomial of degree 2

xmin

miniumum value of the exposure

xmax

maximum value of the exposure

family

family used in the analysis

Author(s)

James R Staley <[email protected]>

Examples

1
2
3
4
5
6
7
8
9
### Data
y <- rnorm(5000)
x <- rnorm(5000,10,1)
c1 <- rbinom(5000,1,0.5)
c2 <- rnorm(5000)
covar <- data.frame(c1=c1, c2=c2)

### Analyses
res <- fracpoly(y=y, x=x, covar=covar, family="gaussian")

jrs95/mvshape documentation built on June 5, 2019, 2:54 p.m.