dda.resdist: Direction Dependence Analysis: Residual Distributions

View source: R/dda_resdist.r

dda.resdistR Documentation

Direction Dependence Analysis: Residual Distributions

Description

dda.resdist evaluates patterns of asymmetry of error distributions of causally competing models (y ~ x vs. x ~ y).

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

Usage

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

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

Arguments

formula

Symbolic formula of the target model to be tested or a lm object.

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

B

Number of bootstrap samples.

boot.type

A vector of character strings representing the type of bootstrap confidence intervals required. Must be one of the two values c("perc", "bca"); boot.type = "perc" is the default.

prob.trans

A logical value indicating whether a probability integral transformation should be performed prior computation of skewness and kurtosis difference tests.

conf.level

Confidence level for bootstrap confidence intervals.

x

An object of class dda.resdist when using print.

...

Additional arguments to be passed to the method.

Value

An object of class ddaresdist containing the results of DDA tests of asymmetry patterns of error distributions obtained from the causally competing models.

References

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

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.resdist(y ~ x, pred = "x", data = d,
            B = 50, conf.level = 0.90, prob.trans = TRUE)

print(result)


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