uwIntroStats (version 0.0.7)

polynomial: Create Polynomials

Description

Creates polynomial variables.

Usage

polynomial(x,degree=2,center=mean(x,na.rm=T), version=F)

Arguments

x

variable used to create the polynomials.

degree

the maximum degree polynomial to be returned. Polynomials of degree <= degree will be returned.

center

the value to center the polynomials at.

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 polynomial on ldl
  polynomial(ldl, degree=3)
# }

Run the code above in your browser using DataCamp Workspace