Skip to contents

Construct a sum-to-zero contrast between two logical expressions.

Usage

pair_contrast(A, B, name, where = NULL)

Arguments

A

A formula representing the first logical expression in the contrast.

B

A formula representing the second logical expression in the contrast.

name

A character string specifying the name of the contrast (mandatory).

where

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

Value

A pair_contrast_spec object containing the sum-to-zero contrast between the two logical expressions.

Examples

# A hypothetical experiment with a factor 'category' that takes on values of 'face' and 'scene'
pair_contrast(~ category == "face", ~ category == "scene", name="face_scene")
#> $A
#> ~category == "face"
#> <environment: 0x7f8f62ace760>
#> 
#> $B
#> ~category == "scene"
#> <environment: 0x7f8f62ace760>
#> 
#> $where
#> NULL
#> 
#> $name
#> [1] "face_scene"
#> 
#> attr(,"class")
#> [1] "pair_contrast_spec" "contrast_spec"      "list"