| Title: | Corrected Welch-Satterthwaite Degrees of Freedom |
|---|---|
| Description: | Calculates corrected Welch-Satterthwaite effective degrees of freedom for weighted sums of independent variance components. Provides corrected-default one-sample, paired, and two-sample t-tests, together with the classical Welch-Satterthwaite calculation for explicit comparison. |
| Authors: | Matthias von Davier [aut, cre] |
| Maintainer: | Matthias von Davier <[email protected]> |
| License: | CC0 |
| Version: | 0.1.0 |
| Built: | 2026-11-24 15:26:11 UTC |
| Source: | https://github.com/cran/correctedWS |
Corrected Welch-Satterthwaite effective degrees of freedom for weighted sums of independent variance components, with corrected-default t-test utilities.
The package implements the corrected estimator described in von Davier (2026): the denominator uses nu + 2 and the result subtracts 2. The classical calculation remains available through ws_classical() and method = "classical".
Performs one-sample, paired, pooled two-sample, or unequal-variance two-sample t-tests. The corrected Welch-Satterthwaite calculation is the default for the unequal-variance two-sample case.
corrected_t_test(x, y = NULL, alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, var.equal = FALSE, conf.level = 0.95, method = c("corrected", "classical"))corrected_t_test(x, y = NULL, alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, var.equal = FALSE, conf.level = 0.95, method = c("corrected", "classical"))
x |
Numeric vector of observations. |
y |
Optional numeric vector for a two-sample or paired test. |
alternative |
Alternative hypothesis: |
mu |
Null mean or null difference in means. |
paired |
Logical; perform a paired test when |
var.equal |
Logical; use the pooled-variance test for an independent two-sample test. |
conf.level |
Confidence level for the interval. |
method |
|
An object of class "htest".
corrected_t_test(1:10, y = 2:11) corrected_t_test(1:10, y = 2:11, method = "classical")corrected_t_test(1:10, y = 2:11) corrected_t_test(1:10, y = 2:11, method = "classical")
Calculates corrected effective degrees of freedom for a weighted sum of independent variance components.
cws(s2, nu, w = rep(1, length(s2)))cws(s2, nu, w = rep(1, length(s2)))
s2 |
Numeric vector of estimated variance components. |
nu |
Numeric vector of component degrees of freedom. |
w |
Numeric vector of positive weights. |
A single numeric corrected effective degrees of freedom, or NA_real_ when the denominator is zero.
cws(c(2, 3), c(10, 20)) cws(c(2, 3), c(10, 20), c(1, 2))cws(c(2, 3), c(10, 20)) cws(c(2, 3), c(10, 20), c(1, 2))
Convenience wrapper for the corrected Welch-Satterthwaite calculation with two variance components.
cws2(s2_1, s2_2, nu_1, nu_2, w1 = 1, w2 = 1)cws2(s2_1, s2_2, nu_1, nu_2, w1 = 1, w2 = 1)
s2_1 |
First estimated variance component. |
s2_2 |
Second estimated variance component. |
nu_1 |
Degrees of freedom for the first component. |
nu_2 |
Degrees of freedom for the second component. |
w1 |
Positive first-component weight. |
w2 |
Positive second-component weight. |
A single numeric corrected effective degrees of freedom.
cws2(2, 3, 10, 20) cws2(4, 9, 5, 8, w1 = 2, w2 = 3)cws2(2, 3, 10, 20) cws2(4, 9, 5, 8, w1 = 2, w2 = 3)
Calculates the classical Welch-Satterthwaite effective degrees of freedom for explicit comparison with the corrected estimator.
ws_classical(s2, nu, w = rep(1, length(s2)))ws_classical(s2, nu, w = rep(1, length(s2)))
s2 |
Numeric vector of estimated variance components. |
nu |
Numeric vector of component degrees of freedom. |
w |
Numeric vector of positive weights. |
A single numeric classical Welch-Satterthwaite effective degrees of freedom.
ws_classical(c(1, 1), c(1, 2))ws_classical(c(1, 1), c(1, 2))