This function is computing a sub-matrix used in stratifiedcube.
Usage
findB(X, strata)
Value
A list of two components. The sub-matrix of X and the corresponding disjunctive matrix.
If we use the function cbind to combine the two matrices, the resulting matrix has only one more row than the number of columns.
Arguments
X
A matrix of size (\(N\) x \(p\)) of auxiliary variables on which the sample must be balanced.
strata
A vector of integers that specifies the stratification.
The function finds the smallest matrix B such that it contains only one more row than the number of columns.
It consecutively adds the right number of rows depending on the number of categories that is added.