The \(n - 1\)-denominator covariance matrix, as stats::cov()
computes it, extended to case weights when a cwt command is
active. tda_corr is its correlation counterpart.
Value
An object carrying matrix, the covariance matrix with
the variables' names on both dimensions.
See also
Other descriptive statistics:
tda_brr(),
tda_dstat(),
tda_freq(),
tda_independence(),
tda_ineq(),
tda_loglin(),
tda_quant(),
tda_rcorr(),
tda_segr(),
tda_subm()
Examples
set.seed(26)
d <- data.frame(x = rnorm(40), y = rnorm(40))
d$y <- d$y + 0.6 * d$x
tda_cov(d)$matrix
#> x y
#> x 1.2041370 0.7894007
#> y 0.7894007 1.5212078
cov(d) # matches
#> x y
#> x 1.2041370 0.7894007
#> y 0.7894007 1.5212078