computeDMStat | R Documentation |
compute Delgado and Manteiga (2001) test statistic for testing the hypothesis H0: E[Y|X,Z] = E[Y|X]
computeDMStat(Y, X, Z, a = NA, ckertype = "gaussian", stat = "CvM")
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") |
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)
Y <- rnorm(100) X <- rnorm(100) Z <- rnorm(100) computeDMStat(Y, X, Z, a=NA, ckertype="gaussian", stat="CvM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.