These take data rather than a formula, following cor and
summary: there is no response and no model here. A data frame, a
matrix, or loose vectors are all accepted, and non-numeric columns are
dropped.
Details
tda_dstat reports each variable's minimum, maximum, mean,
standard deviation (denominator \(n - 1\), or the weight total
minus one under case weights) and sum. tda_corr and
tda_cov are the ordinary product-moment correlation and the
\(n - 1\)-denominator covariance – cor() and cov()
– extended to case weights when a cwt command is active
(manual, section 6.2.6). All of them compute over every case given,
including any -5 standing in for an NA – see
?tdaR on missing values.
See also
Other descriptive statistics:
tda_brr(),
tda_cov(),
tda_freq(),
tda_independence(),
tda_ineq(),
tda_loglin(),
tda_quant(),
tda_rcorr(),
tda_segr(),
tda_subm()
Examples
set.seed(1)
d <- data.frame(x = round(rnorm(40, 10, 3), 1))
d$y <- round(2 + 0.8 * d$x + rnorm(40, sd = 2), 1)
tda_dstat(d)
#> Call: tda_dstat(d)
#>
#> Cases: 40
#>
#> Variable Minimum Maximum Mean Std.Dev. Sum
#> x 3.4 14.8 10.2825 2.661394 411.3
#> y 2.5 17.0 10.4700 3.123295 418.8
tda_corr(d$x, d$y)
#> Call: tda_corr(d$x, d$y)
#>
#> Cases: 40
#>
#> d$x d$y
#> d$x 1.0000000 0.8181522
#> d$y 0.8181522 1.0000000