Learn R Programming

mmrm (version 0.3.16)

h_first_term_containing_categ: Identify the First Term in a Model to Contain a Categorical Variable

Description

This returns the column name of the leftmost column of factors containing a nonzero value in a row corresponding to a categorical variable.

Usage

h_first_term_containing_categ(factors, categorical)

Value

A string: one of the column names of factors. If none of the columns contain a categorical variable, NULL is returned.

Arguments

factors

(matrix)
the factors attribute of a terms.object, which is a matrix of 0s, 1s, and 2s.

categorical

(character)
a vector of the categorical variables in the model whose terms.object is factors.