dda.vardist: Direction Dependence Analysis: Variable Distributions

View source: R/dda_vardist.r

dda.vardistR Documentation

Direction Dependence Analysis: Variable Distributions

Description

dda.vardist evaluates patterns of asymmetry of variable distributions for causally competing models (y ~ x vs. x ~ y).

print returns DDA test statistics associated with dda.vardist objects.

Usage

dda.vardist(
  formula,
  pred = NULL,
  data = list(),
  B = 200,
  boot.type = "perc",
  conf.level = 0.95
)

## S3 method for class 'dda.vardist'
print(x, ...)

Arguments

formula

Symbolic formula of the model to be tested or a lmobject.

pred

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 dda.vardist is called from).

B

Number of bootstrap samples.

boot.type

A character indicating the type of bootstrap confidence intervals. Must be one of the two specifications c("perc", "bca"). boot.type = "perc" is the default.

conf.level

Confidence level for bootstrap confidence intervals.

x

An object of class dda.vardist when using print.

...

Additional arguments to be passed to the function.

Value

An object of class dda.vardist containing the results of DDA tests of asymmetry patterns of variable distributions.

An object of class dda.vardist.

References

Wiedermann, W., & von Eye, A. (2025). Direction Dependence Analysis: Foundations and Statistical Methods. Cambridge, UK: Cambridge University Press.

See Also

cdda.vardist for a conditional version.

Examples

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.vardist(y ~ x, pred = "x", data = d, B = 50)

print(result)

dda documentation built on April 4, 2025, 12:18 a.m.