Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

contr.FrF2

Contrasts for orthogonal Fractional Factorial 2-level designs


Description

Contrasts for orthogonal Fractional Factorial 2-level designs

Usage

contr.FrF2(n, contrasts=TRUE)

Arguments

n

power of 2; number of levels of the factor for which contrasts are to be generated

contrasts

must always be TRUE; option needed for function model.matrix to work properly

Details

This function mainly supports -1/+1 contrasts for 2-level factors. It does also work if the number of levels is a power of 2. For more than four levels, the levels of the factor must be in an appropriate order in order to guarantee that the columns of the model matrix for an FrF2-derived structure are orthogonal.

Value

The function returns orthogonal contrasts for factors with number of levels a power of 2. All contrast columns consist of -1 and +1 entries (half of each). If factors in orthogonal arrays with 2-level factors are assigned these contrasts, the columns of the model matrix for the main effects model are orthogonal to each other and to the column for the intercept.

Note

This package is currently under intensive development. Substantial changes are to be expected in the near future.

Author(s)

Ulrike Groemping

See Also

Examples

## assign contr.FrF2 contrasts to a factor
status <- as.factor(rep(c("current","new"),4))
contrasts(status) <- contr.FrF2(2)
contrasts(status)

DoE.base

Full Factorials, Orthogonal Arrays and Base Utilities for DoE Packages

v1.1-6
GPL (>= 2)
Authors
Ulrike Groemping [aut, cre], Boyko Amarov [ctb], Hongquan Xu [ctb]
Initial release
2021-02-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.