Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Rcim

Mark the Baseline of Row and Column on a Matrix data


Description

Rearrange the rows and columns of the input so that the first row and first column are baseline. This function is for rank-zero row-column interaction models (RCIMs; i.e., general main effects models).

Usage

Rcim(mat, rbaseline = 1, cbaseline = 1)

Arguments

mat

Matrix, of dimension r by c. It is best that it is labelled with row and column names.

rbaseline, cbaseline

Numeric (row number of the matrix mat) or character (matching a row name of mat) that the user wants as the row baseline or reference level. Similarly cbaseline for the column.

Details

This is a data preprocessing function for rcim. For rank-zero row-column interaction models this function establishes the baseline (or reference) levels of the matrix response with respect to the row and columns—these become the new first row and column.

Value

Matrix of the same dimension as the input, with rbaseline and cbaseline specifying the first rows and columns. The default is no change in mat.

Note

This function is similar to moffset; see moffset for information about the differences. If numeric, the arguments rbaseline and cbaseline differ from arguments roffset and coffset in moffset by 1 (when elements of the matrix agree).

Author(s)

Alfian F. Hadi and T. W. Yee.

See Also

Examples

(alcoff.e <- moffset(alcoff, roffset = "6", postfix = "*"))
(aa <- Rcim(alcoff,    rbaseline = "11", cbaseline = "Sun"))
(bb <- moffset(alcoff,             "11",             "Sun", postfix = "*"))
aa - bb  # Note the difference!

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.