contrastable1.0.2 package

Consistent Contrast Coding for Factors

as.unordered

Convert to unordered factor

backward_difference_code

Backward difference code

cumulative_split_code

Cumulative split contrasts

decompose_contrasts

Decompose contrasts into new columns

dot-add_namespace

Lookup namespace of contrast scheme function

dot-bundle_params

Extract parameters from dots

dot-cols_where

Get columns where

dot-convert_to_factors

Convert non factors to factors

dot-expand_formulas

Expand contrast formulas

dot-get_dimnames

Get dimnames of contrasts from factor

dot-get_from_params

Retrieve value from param list

dot-get_reference_level

Get reference level of contrast matrix

dot-get_reference_levels

Get reference levels from a (possibly set) list of contrasts

dot-get_reserved_operator

Check for reserved operators

dot-get_scheme_labels

Get contrast scheme labels for glimpse table

dot-glimpse_default_factors

Glimpse default factors

dot-is_polynomial_scheme

Check if a scheme is a polynomial scheme

dot-is_reserved_operator

Check if node is a contrast-manipulation operator

dot-is_valid_contrmat

Check if valid contrast

dot-make_parameters

Make parameters for contrast code call

dot-make_placeholder_glimpse

Make glimpse for 1-level factors

dot-msg_if_coerced_to_factors

Alert user when factor coercion happens

dot-msg_if_ordered_reset

Alert user when setting ordered factors

dot-msg_if_remaining_factors

Alert user if there are more factors

dot-plus_to_c

Handle + in formula LHS

dot-postprocess_matrix

Postprocess contrast matrices

dot-process_code_by

Process code_by

dot-process_contrasts

Pass arguments to contrast code

dot-process_factor_col

Process factor column

dot-reset_comparison_labels

Reset comparison labels of matrix to defaults

dot-set_intercept

Set intercept for contrast matrix

dot-set_param

Process and set parameter

dot-split_if_language

Split contrast function using parens

dot-switch_reference_if_needed

Check if reference switching is necessary

dot-switch_reference_level

Switch reference level in contrast matrix

dot-warn_if_mismatched_contrasts

Diagnose glimpse issues and send warnings

dot-warn_if_nondefault

Warn user if nondefault contrasts are set

dot-warn_if_onelevel

Warn if one level factor

enlist_contrasts

List of contrast matrices

find_same_col

Find column with same non-positive values

forward_difference_code

Forward difference code

glimpse_contrasts

Glimpse contrasts in dataframe

helmert_code

Helmert code

interpret_intercept

Interpret intercept from contrasts

is_centered

Check for orthogonality

is_orthogonal

Check for orthogonality

is.unordered

Check for unordered factor

orth_polynomial_code

Orthogonal Polynomial code

raw_polynomial_code

Raw Polynomial code

reverse_helmert_code

Reverse Helmert code

scaled_sum_code

Scaled sum coding

set_contrasts

Set contrasts to dataframe

sum_code

Sum code

treatment_code

Treatment code

use_contrasts.AsIs

AsIs method for use_contrasts

use_contrasts.default

Default method for use_contrasts

use_contrasts.function

Function method for use_contrasts

use_contrasts.hypr

Use a hypr object for contrasts

use_contrasts.matrix

Matrix method for use_contrasts

use_contrasts.name

Symbol method for use_contrasts

use_contrasts

Contrast code factors

Quickly set and summarize contrasts for factors prior to regression analyses. Intended comparisons, baseline conditions, and intercepts can be explicitly set and documented without the user needing to directly manipulate matrices. Reviews and introductions for contrast coding are available in Brehm and Alday (2022)<doi:10.1016/j.jml.2022.104334> and Schad et al. (2020)<doi:10.1016/j.jml.2019.104038>.

  • Maintainer: Thomas Sostarics
  • License: MIT + file LICENSE
  • Last published: 2024-10-01