uwIntroStats (version 0.0.7)

lspline: Create Linear Splines

Description

Creates linear splines, mostly for use in regression.

Usage

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.

Examples

Run this code
# NOT RUN {
# 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))
# }

Run the code above in your browser using DataCamp Workspace