polynomial: Create Polynomials

Description Usage Arguments Value Author(s) Examples

View source: R/polynomial.R

Description

Creates polynomial variables.

Usage

1
  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.

Author(s)

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

Examples

1
2
3
4
5
  # 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)

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