| zero_na_conditional_obasis | R Documentation |
Compute orthonormal ilr bases adapted to patterns of missing values and structural zeros.
zero_na_conditional_obasis(X)
X |
A numeric matrix or data frame with observations in rows and parts in columns. |
Each row of 'X' is treated as one observation. For each observation, parts are split into three ordered blocks:
missing values ('NA'),
zeros,
strictly positive values.
The resulting basis is constructed so that:
the first coordinates describe the internal structure of the 'NA' block,
the next coordinate contrasts the 'NA' block with the positive block,
the following coordinates describe the internal structure of the zero block,
the next coordinate contrasts the zero block with the positive block,
the remaining coordinates describe the internal structure of the positive block.
A three-dimensional array of dimension '(D - 1, D, nrow(X))', where 'D' is the number of parts. Each slice contains one orthonormal ilr basis.
X <- rbind(
c(1, NA, 0, 2),
c(NA, 3, 0, 4),
c(1, 2, 3, 4)
)
zero_na_conditional_obasis(X)
Xdf <- data.frame(
a = c(1, NA, 1),
b = c(NA, 3, 2),
c = c(0, 0, 3),
d = c(2, 4, 4)
)
zero_na_conditional_obasis(Xdf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.