DMTest | R Documentation |
perform the Delgado and Manteiga (2001) test of the hypothesis of conditional mean independence (E[Y|X,Z] = E[Y|X]) or conditional independence (Y is independent of Z given X)
DMTest( Y, X, Z, size = 0.05, B = 100, a = NA, ckertype = "gaussian", stat = "CvM", indep = FALSE )
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") |
indep |
logical; FALSE means that conditional mean independence is tested, otherwise conditional independence |
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)
Y <- rnorm(100) X <- rnorm(100) Z <- rnorm(100) DMTest(Y, X, Z, size=0.05, B=100, a=NA, ckertype="gaussian", stat="CvM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.