matchcovariate: Match coefficient names to covariate indices

View source: R/helper.R

matchcovariateR Documentation

Match coefficient names to covariate indices

Description

Matches model coefficient names (including interactions) to original covariate indices from the model call. Handles centered variables and interaction terms. Returns a numeric encoding for sorting.

Usage

matchcovariate(betanames, ucall)

Arguments

betanames

Vector of coefficient names from model

ucall

Vector of unique covariate names from model call

Details

Changes:

  • Feb 21, 2019: Changed from charmatch to grepl for more reliable matching

  • Dec 14, 2020: Added space removal to support centered variables

Value

Numeric vector of encoded covariate indices, or -1 if matching fails


reportRmd documentation built on March 20, 2026, 5:06 p.m.