Learn R Programming

lmeVarComp (version 1.1)

test.additivity: Testing Additivity in Nonparametric Regression

Description

test.additivity tests for additive model in nonparametric regression using mixed model representation and variance components testing.

Usage

test.additivity(x, y, type = "RLR", 
  nbasis = 10L, kernel = c("gaussian", "polynomial", "spline"),
  nsim = 5000L, seed = 130623L)

Arguments

x

design matrix. Each column should be scaled to have range within [0,1].

y

response vector.

type

RLR for restricted likelihood ratio test and generalized F-test

nbasis

number of basis functions in additive modeling.

kernel

reproducing kernel for non-additive modeling.

nsim

number of simulations from the null distribution.

seed

a seed to be set before simulating from the null distribution.

Value

A vector of test statistic and p-value.

References

Zhang, Y., Staicu, A.-M., and Maity, A. (2016). Testing for additivity in non-parametric regression. Canadian Journal of Statistics, 44: 445-462. 10.1002/cjs.11295

See Also

rlr.test

Examples

Run this code
# NOT RUN {
set.seed(20L)
x <- matrix(runif(200L), 100L, 2L)
y <- 4 * x[, 1L] * x[, 2L] + rnorm(100L)
test.additivity(x, y)
# }

Run the code above in your browser using DataLab