| Title: | Max-Type Test for Marginal Correlation with Bootstrap |
|---|---|
| Description: | Test the marginal correlation between a scalar response variable with a vector of explanatory variables using the max-type test with bootstrap. The test is based on the max-type statistic and its asymptotic distribution under the null hypothesis of no marginal correlation. The bootstrap procedure is used to approximate the null distribution of the test statistic. The package provides a function for performing the test. For more technical details, refer to Zhang and Laber (2014) <doi:10.1080/01621459.2015.1106403>. |
| Authors: | Canyi Chen [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-0673-5812>) |
| Maintainer: | Canyi Chen <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.1 |
| Built: | 2026-05-19 08:33:30 UTC |
| Source: | https://github.com/canyi-chen/marginalmaxtest |
Test for marginal effects of predictors on a scalar response
marginal.test(x, y, B = 199L, method = "adaptive")marginal.test(x, y, B = 199L, method = "adaptive")
x |
A numeric matrix of predictors |
y |
A numeric vector of responses |
B |
Number of bootstrap samples (default 199) |
method |
Method for p-value calculation: "max", "sum", or "adaptive" |
A list containing the p-value and computation time
This function is based on the C implementation by Zhang and Laber (2014) https://doi.org/10.1080/01621459.2015.1106403.
# Generate sample data set.seed(47) n <- 200 p <- 10 x <- matrix(rnorm(n*p), n, p) y <- 0.25*x[,1] + rnorm(n) # Run the test marginal.test(x, y, B = 200, method = "adaptive") marginal.test(x, y, B = 200, method = "max") marginal.test(x, y, B = 200, method = "sum")# Generate sample data set.seed(47) n <- 200 p <- 10 x <- matrix(rnorm(n*p), n, p) y <- 0.25*x[,1] + rnorm(n) # Run the test marginal.test(x, y, B = 200, method = "adaptive") marginal.test(x, y, B = 200, method = "max") marginal.test(x, y, B = 200, method = "sum")