perform the Delgado and Manteiga (2001) test of the hypothesis H0: E[Y|X,Z] = E[Y|X]

DMTest(Y, X, Z, size = 0.05, B = 100, a = NA,
  ckertype = "gaussian", stat = "CvM")

Arguments

Y

n-dim. vector containing the observations on the outcome

X

matrix with n rows containing the observations on the scalar or vector X

Z

matrix with n rows containing the observations on the scalar or vector Z

size

scalar between 0 and 1, denoting the nominal size of the test (default: 0.05)

B

integer denoting the number of bootstrap samples to be used (default: 100)

a

vector of bandwidths, of the same dimension as there are columns in X, if unspecified, then the bandwidths are determined by cross-validation from nonparametric regression of Y on X

ckertype

character string denoting the kernel function to be used, as in np package (default: "gaussian")

stat

character string denoting the type of test statistic to be computed: Cramer-von-Mises ("CvM", default) or Kolmogorov-Smirnov ("KS")

Value

a list containing the following elements: 'teststat' value of the test statistic, 'cv' bootstrap critical value, 'rej' a 1-0 indicator for whether the test rejects or not, 'pval' p-value, 'a' the bandwidth(s)

Examples

Y <- rnorm(100) X <- rnorm(100) Z <- rnorm(100) DMTest(Y, X, Z, size=0.05, B=100, a=NA, ckertype="gaussian", stat="CvM")
#> Multistart 1 of 1 | Multistart 1 of 1 | Multistart 1 of 1 | Multistart 1 of 1 / Multistart 1 of 1 | Multistart 1 of 1 |
#> $teststat #> [1] 6.190071e-18 #> #> $cv #> 95% #> 2.763174e-17 #> #> $rej #> 95% #> FALSE #> #> $pval #> [1] 0.8 #> #> $a #> [1] 46552204 #>