CALM is an R package for creating and interpreting contrast codes for linear models. It is an extension of the built-in contrast specifications in R and inspired by Venables's codingMatrices package, but it includes codes not available in other packages. In addition to providing contrast specifications, it includes functions for directly converting hypothesized differences (contrasts) into linear model codes (and vice versa).
This package is not currently on CRAN, but can be installed and loaded using these R commands
if (!require(remotes)) install.packages("remotes")
remotes::install_github("cwendorf/CALM")
library(CALM)
If you do not wish a full install, the latest functions can be made available using these R commands:
source("http://raw.githubusercontent.com/cwendorf/CALM/main/source-CALM.R")
CALM can take existing coding patterns and decode them to determine the hypotheses being tested.
- Extracting Regression Codes - Examples of extracting from traditional regression codes
- Extracting Base Codes - Examples of extracting from R Base contrast codes
CALM can take a set of linear contrasts to be tested and produce coding schemes.
- Producing Common Codes - Examples of producing commonly specified contrast codes
- Producing Custom Codes - Examples of producing custom contrast codes
CALM can be used in conjunction with R's analytical strategies (like the Linear Model) to test hypotheses for real data problems.
- Using Common Codes - Examples using the package's built-in contrast codes
- Using Custom Codes - Examples using custom contrast codes
- GitHub Issues: https://github.com/cwendorf/CALM/issues
- Author Email: cwendorf@uwsp.edu
- Author Homepage: https://github.com/cwendorf
Wendorf, C.A. (2021). CALM: Contrast Algorithms for Linear Models [R Package]. https://github.com/cwendorf/CALM