Check if a Model Matrix is Full Rank
is_fullrank.Rd
This function checks whether a model matrix is full rank, which is essential for certain statistical analyses. It computes the eigenvalues of the crossproduct of the model matrix and determines if the first eigenvalue is positive and if the ratio of the last eigenvalue to the first is within a defined tolerance.
Arguments
- metadata
The metadata used to create the model matrix.
- formula
The formula used to specify the model matrix.
Examples
metadata <- data.frame(x = rnorm(10), y = rnorm(10))
formula <- y ~ x
is_fullrank(metadata, formula)
#> [1] TRUE