Skip to contents

Create a polynomial contrast evaluated over a set of (orderable) factor levels.

Usage

poly_contrast(A, name, where = NULL, degree = 1, value_map = NULL)

Arguments

A

A formula describing the contrast.

name

A character string representing the name of the contrast.

where

An optional formula defining the subset over which the contrast is computed.

degree

An integer representing the degree of the polynomial (default: 1).

value_map

An optional list that maps between levels of a factor and a numeric value.

Value

A list containing the polynomial contrast specification.

Examples

pcon <- poly_contrast(~ time, name="poly_time_3", degree=3)