Learn R Programming

poseticDataAnalysis (version 1.0.0)

LexMRP: MRP matrix computation over the set of lexicographic linear extensions.

Description

Considering the component-wise poset built stating from \(k\) ordinal variables, computes MRP matrix by analyzing all poset lexicographic linear extensions.

Usage

LexMRP(nvar, deg)

Value

the MRP matrix computed over the set of lexicographic linear extensions.

Arguments

nvar

positive integer specifying the number \(k\) of ordinal variables.

deg

parameter specifying the number of degrees of each variable. If all \(k\) variables have the same number \(m\) of degrees, it can be:

  1. the positive integer \(m\). In this case variable degree labels are supposed to be the integers \(0<1<...<m\) and columns and rows of the computed MRP matrix are named accordingly to this;

  2. a character vector of length \(m\) specifying the variable degree labels (in this case columns and rows of the computed MRP matrix are named accordingly to deg).

If the \(k\) variables have different number \((m_1,...,m_k)\) of degrees, it can be:

  1. a length-\(k\) positive integers vector specifying the values of \(m_1,...,m_k\). In this case variable degree labels for the \(j\)-th variable are supposed to be the integers \(0<1<...<m_j\) and columns and rows of the computed MRP matrix are named accordingly to this;

  2. a list of \(k\) character vectors. The \(j\)-th list element is a character vector of length \(m_j\) specifying the degree labels for the \(j\)-th variable (in this case columns and rows of the computed MRP matrix are named accordingly to deg).

Examples

Run this code

#variables with common number of degrees
# default labels for variable degrees
nvar <- 3
deg  <- 4
lMRP <- LexMRP(nvar=nvar, deg=deg)

#user supplied variable degree labels
nvar <- 3
deg  <- c("a","b","c","d")
lMRP <- LexMRP(nvar=nvar, deg=deg)


#variables with different numbers of degrees
# default labels for variable degrees
nvar <- 3
deg  <- c(4,2,3)
lMRP <- LexMRP(nvar=nvar, deg=deg)

#user supplied variable degree labels
nvar <- 3
deg  <- list(c("a","b","c","d"),c("0","1"),c("x","y","z"))
lMRP <- LexMRP(nvar=nvar, deg=deg)

Run the code above in your browser using DataLab