coding_function: General coding matrix for factors

View source: R/coding_function.R

coding_functionR Documentation

General coding matrix for factors

Description

This function creates functions (closures) that implement a flexible coding matrix for a factor.

Usage

coding_function(
  x,
  levs = levels(as.factor(x)),
  intercept = rbind(c(1, rep(0, length(levs) - 1))),
  constraints = NULL,
  estimates = diag(length(levs))[-1, , drop = FALSE],
  tolerance = 1e-16,
  debug = FALSE
)

Details

The coding function can be designed with specified constraints and specified estimated model parameters.

The coding function can also be used to generate portions of hypothesis matrices to estimate interpretable functions of parameters.


gmonette/gnew documentation built on July 9, 2022, 12:57 p.m.