pcm {comets} | R Documentation |
Projected covariance measure test for conditional mean independence
Description
Projected covariance measure test for conditional mean independence
Usage
pcm(
Y,
X,
Z,
rep = 1,
est_vhat = TRUE,
reg_YonXZ = "rf",
reg_YonZ = "rf",
reg_YhatonZ = "rf",
reg_VonXZ = "rf",
reg_RonZ = "rf",
args_YonXZ = NULL,
args_YonZ = NULL,
args_YhatonZ = list(mtry = identity),
args_VonXZ = list(mtry = identity),
args_RonZ = list(mtry = identity),
frac = 0.5,
coin = FALSE,
cointrol = NULL,
...
)
Arguments
Y |
Vector of response values. Can be supplied as a numeric vector or a single column matrix. |
X |
Matrix or data.frame of covariates. |
Z |
Matrix or data.frame of covariates. |
rep |
Number of repetitions with which to repeat the PCM test |
est_vhat |
Logical; whether to estimate the variance functional |
reg_YonXZ |
Character string or function specifying the regression
for Y on X and Z, default is |
reg_YonZ |
Character string or function specifying the regression
for Y on Z, default is |
reg_YhatonZ |
Character string or function specifying the regression
for the predicted values of |
reg_VonXZ |
Character string or function specifying the regression
for estimating the conditional variance of Y given X and Z, default
is |
reg_RonZ |
Character string or function specifying the regression
for the estimated transformation of Y, X, and Z on Z, default is
|
args_YonXZ |
Arguments passed to |
args_YonZ |
Arguments passed to |
args_YhatonZ |
Arguments passed to |
args_VonXZ |
Arguments passed to |
args_RonZ |
Arguments passed to |
frac |
Relative size of train split. |
coin |
Logical; whether or not to use the |
cointrol |
List; further arguments passed to
|
... |
Additional arguments currently ignored. |
Details
The projected covariance measure test tests whether the conditional mean of Y given X and Z is independent of X.
Value
Object of class 'pcm
' and 'htest
' with the following
components:
statistic |
The value of the test statistic. |
p.value |
The p-value for the |
parameter |
In case X is multidimensional, this is the degrees of freedom used for the chi-squared test. |
hypothesis |
Null hypothesis of conditional mean independence. |
null.value |
Null hypothesis of conditional mean independence. |
method |
The string |
data.name |
A character string giving the name(s) of the data. |
check.data |
A |
References
Lundborg, A. R., Kim, I., Shah, R. D., & Samworth, R. J. (2022). The Projected Covariance Measure for assumption-lean variable significance testing. arXiv preprint. doi:10.48550/arXiv.2211.02039
Examples
n <- 150
X <- matrix(rnorm(2 * n), ncol = 2)
colnames(X) <- c("X1", "X2")
Z <- matrix(rnorm(2 * n), ncol = 2)
colnames(Z) <- c("Z1", "Z2")
Y <- X[, 2]^2 + Z[, 2] + rnorm(n)
(pcm1 <- pcm(Y, X, Z))