marginal.test {MarginalMaxTest}R Documentation

Test for marginal effects of predictors on a scalar response

Description

Test for marginal effects of predictors on a scalar response

Usage

marginal.test(x, y, B = 199L, method = "adaptive")

Arguments

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"

Value

A list containing the p-value and computation time

Note

This function is based on the C implementation by Zhang and Laber (2014) doi:10.1080/01621459.2015.1106403.

Examples

# 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")

[Package MarginalMaxTest version 1.0.1 Index]