| dda.indep | R Documentation | 
dda.indep computes DDA test statistics to
evaluate 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 class 'dda.indep'
print(x, ...)
| formula | Symbolic formula of the model to be tested or a  | 
| pred | A character indicating the variable name of the predictor which serves as the outcome in the alternative model. | 
| data | An optional data frame containing the variables in the model (by default variables are taken from the environment which  | 
| nlfun | Either a numeric value or a function of .Primitive type used for non-linear correlation tests. When  | 
| hetero | A logical value indicating whether separate homoscedasticity tests (i.e., standard and robust Breusch-Pagan tests) should be computed. | 
| hsic.method | A character indicating the inference method for the Hilbert-Schmidt Independence Criterion (HSIC). Must be one of the four specifications  | 
| diff | 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. | 
| B | Number of permutations for separate dCor tests and number of resamples if  | 
| boot.type | A vector of character strings representing the type of bootstrap confidence intervals. Must be one of the two specifications  | 
| conf.level | Confidence level for bootstrap confidence intervals. | 
| parallelize | A logical value indicating whether bootstrapping is performed on multiple cores. Only used if  | 
| cores | A numeric value indicating the number of cores. Only used if  | 
| x | An object of class  | 
| ... | Additional arguments to be passed to the function. | 
An object of class dda.indep containing the results of DDA independence tests.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.