Mass-univariate inference for contrasts in a linear model
Source:R/bootstrapCalibration.R
lm_test.Rd
Compute the marginal t-statistics for a set of contrasts and their (two-sided) p-value.
Usage
lm_test(Y, X, C, alternative = c("two.sided", "less", "greater"))
Arguments
- Y
A data matrix of size $n$ observations (in row) and $D$ features in columns
- X
A design matrix of size $n$ observations (in row) and $p$ variables (in columns)
- C
A contrast matrix of size $L$ tested contrasts (in row) and $p$ columns corresponding to the parameters to be tested
- alternative
A character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "greater" or "less".
Value
A list with elements:
- epsilon_est
A \(n \times D\) matrix of residuals
- stat_test
A \(L \times D\) matrix of test statistics
- p.value
A \(L \times D\) matrix of p-values
- beta_est
A \(n \times D\) matrix of parameter estimates
Details
Based on a python implementation available in the pyperm
package: https://github.com/sjdavenport/pyperm/