Learn R Programming

bnlearn (version 2.6)

ci.test: Independence and Conditional Independence Tests

Description

Perform either an independence test or a conditional independence test.

Usage

## S3 method for class 'character':
ci.test(x, y = NULL, z = NULL, data, test = NULL,
  B = NULL, debug = FALSE, ...)
## S3 method for class 'data.frame':
ci.test(x, test = NULL, B = NULL, debug = FALSE, ...)
## S3 method for class 'numeric':
ci.test(x, y = NULL, z = NULL, test = NULL,
  B = NULL, debug = FALSE, ...)
## S3 method for class 'factor':
ci.test(x, y = NULL, z = NULL, test = NULL,
  B = NULL, debug = FALSE, ...)
## S3 method for class 'default':
ci.test(x, ...)

Arguments

Value

  • An object of class htest containing the following components:
  • statisticthe value the test statistic.
  • parameterthe degrees of freedom of the approximate chi-squared or t distribution of the test statistic, NA if the p-value is computed by Monte Carlo simulation.
  • p.valuethe p-value for the test.
  • methoda character string indicating the type of test performed, and whether Monte Carlo simulation or continuity correction was used.
  • data.namea character string giving the name(s) of the data.
  • null.valuethe value of the test statistic under the null hypothesis, always 0.
  • alternativea character string describing the alternative hypothesis

References

Edwards DI (2000). Introduction to Graphical Modelling. Springer, 2nd edition.

Legendre P (2000). "Comparison of Permutation Methods for the Partial Correlation and Partial Mantel Tests". Journal of Statistical Computation and Simulation, 67, 37-73.

Hausser J, Strimmer K (2009). "Entropy inference and the James-Stein estimator, with application to nonlinear gene association networks". Statistical Applications in Genetics and Molecular Biology, 10, 1469-1484.

Ledoit O, Wolf M (2003). "Improved Estimation of the Covariance Matrix of Stock Returns with an Application to Portfolio Selection". Journal of Empirical Finance, 10, 603-621.

See Also

choose.direction, arc.strength.

Examples

Run this code
data(gaussian.test)
data(learning.test)

# using a data frame and column labels.
ci.test(x = "F" , y = "B", z = c("C", "D"), data = gaussian.test)
#
#	 Pearson's Linear Correlation
#
# data:  F ~ B | C + D
# cor = -0.1275, df = 4996, p-value < 2.2e-16
# alternative hypothesis: true value is not equal to 0

# using a data frame.
ci.test(gaussian.test)
#
#	 Pearson's Linear Correlation
#
# data:  A ~ B | C + D + E + F + G
# cor = -0.5654, df = 4993, p-value < 2.2e-16
# alternative hypothesis: true value is not equal to 0

# using factor objects.
attach(learning.test)
ci.test(x = F , y = B, z = data.frame(C, D))
#
# 	Mutual Information (discrete)
#
# data:  F ~ B | data.frame(C, D)
# mi = 25.2664, df = 18, p-value = 0.1178
# alternative hypothesis: true value is greater than 0

Run the code above in your browser using DataLab