| CI | R Documentation |
Computes univariate and multivariate confidence intervals for variables in a dataset.
CI(data, sigma = NA, conf = 0.95, type = "T")
data |
Data used to compute the confidence intervals. |
sigma |
Variance–covariance matrix; otherwise the CI will be based on the sample variance (default sigma = NA). |
conf |
Confidence level of the CI (default conf = 95%). |
type |
Type of interval: 'T' for Hotelling’s \(T^2\) or 'B' for Bonferroni. |
CIu |
Univariate confidence interval with confidence level 'conf'. |
CIm |
Multivariate confidence interval with confidence level 'conf'. |
Paulo Cesar Ossani
Ferreira, D. F. EstatistCIa Multivariada. 2a ed. revisada e ampliada. Lavras: Editora UFLA, 2011. 676 p.
Rencher, A. C. Methods of multivariate analysis. 2th. ed. New York: J.Wiley, 2002. 708 p.. 708 p.
Plot.CI
data(iris) # data set
# Interval with unknown population variance
res <- CI(data = iris[,1:4], sigma = NA, conf = 0.95, type = 'T')
# res <- CI(data = iris[,1:4], sigma = NA, conf = 0.95, type = 'B')
res$ciu # Univariate interval
res$cim # Multivariate interval
# Interval with known population variance
sig <- matrix(c(5.286, 0.942, 1.274, 4.516, # Example of known variance matrix
0.942, 3.690, 0.730, 1.122,
1.274, 0.730, 7.116, 1.296,
4.516, 1.122, 1.296, 4.581),
nrow = 4, byrow = TRUE)
# res <- CI(data = iris[,1:4], sigma = sig, conf = 0.95, type = 'T')
res <- CI(data = iris[,1:4], sigma = sig, conf = 0.95, type = 'B')
res$ciu # Univariate interval
res$cim # Multivariate interval
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.