computeDMStat: compute Delgado and Manteiga (2001) test statistic

View source: R/dmtest.r

computeDMStatR Documentation

compute Delgado and Manteiga (2001) test statistic

Description

compute Delgado and Manteiga (2001) test statistic for testing the hypothesis H0: E[Y|X,Z] = E[Y|X]

Usage

computeDMStat(Y, X, Z, 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

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, 'epsilonhat' the residuals from a nonparametric regression from Y on X, 'Yhat' the predicted values from a nonparametric regression of Y on X, 'a' the bandwidth(s)

Examples

Y <- rnorm(100)
X <- rnorm(100)
Z <- rnorm(100)
computeDMStat(Y, X, Z, a=NA, ckertype="gaussian", stat="CvM")

danielwilhelm/R-ME-test documentation built on June 21, 2022, 6:50 p.m.