
Last chance! 50% off unlimited learning
Sale ends in
A hierarchy with
unbalance_hierarchy(agg_mat, more_info = FALSE, sparse = TRUE)
A list containing four
elements (more_info = TRUE
):
The aggregation matrix of the unbalanced hierarchy.
The input matrix.
The identification number of the duplicated variables (row numbers of
the aggregation matrix agg_mat
).
The identification number of each variable in the balanced hierarchy. It may contains duplicated values.
A (
If TRUE
, it returns only the aggregation matrix
of the unbalanced hierarchy. Default is FALSE
.
Option to return sparse matrices (default is TRUE
).
Utilities:
FoReco2matrix()
,
aggts()
,
balance_hierarchy()
,
commat()
,
csprojmat()
,
cstools()
,
ctprojmat()
,
cttools()
,
df2aggmat()
,
lcmat()
,
recoinfo()
,
res2matrix()
,
shrink_estim()
,
teprojmat()
,
tetools()
# Balanced -> Unbalanced
# T T
# |-------| |-------|
# A B A |
# |---| | |---| |
# AA AB BA AA AB BA
A <- matrix(c(1, 1, 1,
1, 1, 0,
0, 0, 1), 3, byrow = TRUE)
obj <- unbalance_hierarchy(agg_mat = A)
obj
Run the code above in your browser using DataLab