dda.indep evaluates asymmetries of predictor-error independence of
causally competing models (y ~ x vs. x ~ y).
print returns DDA test statistics associated with dda.indep objects.
dda.indep(
formula,
pred = NULL,
data = list(),
nlfun = NULL,
hetero = FALSE,
hsic.method = "gamma",
diff = FALSE,
B = 200,
boot.type = "perc",
conf.level = 0.95,
parallelize = FALSE,
cores = 1
)# S3 method for dda.indep
print(x, ...)
An object of class dda.indep containing the results of
independence tests of Direction Dependence Analysis.
Symbolic formula of the model to be tested or a lm object.
A character indicating the variable name of the predictor which serves as the outcome in the alternative model.
An optional data frame containing the variables in the model (by default variables are taken from the environment which dda.indep is called from).
Either a numeric value or a function of .Primitive type used for non-linear correlation tests. When nlfun is numeric the value is used in a power transformation.
A logical value indicating whether separate homoscedasticity tests (i.e., standard and robust Breusch-Pagan tests) should be computed.
A character indicating the inference method for the Hilbert-Schmidt Independence Criterion (HSIC). Must be one of the four specifications c("gamma", "eigenvalue", "bootstrap", "permutation"). hsic.method = "gamma"is the default.
A logical value indicating whether differences in HSIC, Distance Correlation (dCor), and MI values should be computed. Bootstrap confidence intervals are computed using B bootstrap samples.
Number of permutations for separate dCor tests and number of resamples if hsic.method = c("bootstrap", "permutation") or diff = TRUE.
A vector of character strings representing the type of bootstrap confidence intervals. Must be one of the two specifications c("perc", "bca").boot.type = "perc" is the default.
Confidence level for bootstrap confidence intervals.
A logical value indicating whether bootstrapping is performed on multiple cores. Only used if diff = TRUE.
A numeric value indicating the number of cores. Only used if parallelize = TRUE.
An object of class dda.indep when using print.
Additional arguments to be passed to the function.
Wiedermann, W., & von Eye, A. (2025). Direction Dependence Analysis: Foundations and Statistical Methods. Cambridge, UK: Cambridge University Press.
cdda.indep for a conditional version.
set.seed(123)
n <- 500
x <- rchisq(n, df = 4) - 4
e <- rchisq(n, df = 3) - 3
y <- 0.5 * x + e
d <- data.frame(x, y)
result <- dda.indep(y ~ x, pred = "x", data = d, parallelize = TRUE, cores = 2,
nlfun = 2, B = 50, hetero = TRUE, diff = TRUE)
print(result)
Run the code above in your browser using DataLab