lspline: Create Linear Splines

Description Usage Arguments Value Author(s) Examples

Description

Creates linear splines, mostly for use in regression.

Usage

1
2
3
lspline(x, knots, lbl=NULL, 
        parameterization="absolute", version=FALSE)
lsplineD(x, knots, lbl=NULL, version=FALSE)

Arguments

x

variable used to create the linear splines.

knots

vector of knots to create the splines.

lbl

a label for the splines.

parameterization

defaults to"absolute", and provides splines based on the absolute slope between knots. If "change", provides splines based on the change from knot to knot. If lsplineD is called, "change" is entered by default.

version

if TRUE, returns the version of the function and nothing else.

Value

A matrix containing the linear splines.

Author(s)

Scott S. Emerson, M.D., Ph.D., Andrew J. Spieker, Brian D. Williamson

Examples

1
2
3
4
5
6
7
8
# Reading in a dataset
mri <- read.table("http://www.emersonstatistics.com/datasets/mri.txt", header=TRUE)
attach(mri)
# Create a spline based on absolute
lspline(ldl, c(70, 100, 130, 160))

# Create a spline based on change
lsplineD(ldl, c(70, 100, 130, 160))

uwIntroStats documentation built on May 2, 2019, 4:34 a.m.