BPBM_Matrix {CoDaLoMic} | R Documentation |
Obtains the matrix of covariates of the BPBM
Description
This function writes the matrix of covariates of the BPBM.
Usage
BPBM_Matrix(rows.position, PB, Tt)
Arguments
rows.position |
Vector. Vector with the number of the rows where the SPBal are in the matrix PB. We write first the row in which the balance with higher variance is placed, then the row in which the balance with second higher variance is placed... |
PB |
Matrix. Each line os the matrix PB contains the values of one principal balance at all time points. |
Tt |
Number of time points available. |
Details
In an example with two SPBal and three time points, the covariates are written in the following order:
1 | 1 | 1 |
SPBal_{1,t-1} | SPBal_{1,t-2} | SPBal_{1,t-3} |
SPBal_{2,t-1} | SPBal_{2,t-2} | SPBal_{2,t-3} |
Value
Returns a matrix with the covariates of the model.
References
Creus-MartÃ, I., Moya, A., Santonja, F. J. (2022). Bayesian hierarchical compositional models for analysing longitudinal abundance data from microbiome studies. Complexity, 2022.
Examples
matt=matrix(c(1:12),3,4)
rows.position=c(2,3)
BPBM_Matrix(rows.position,matt,4)