Skip to content

Commit 27e6dc6

Browse files
committed
Add a function for extracting a test statistic
This is added to StatsAPI rather than to HypothesisTests since StatsAPI also houses `HypothesisTest`, `pvalue`, and other relevant functionality. Defining this function will bring a resolution to the 7-year-old issue JuliaStats/HypothesisTests.jl#79, which has received a number of duplicates over the years, suggesting that it would be of general interest.
1 parent 64d7d28 commit 27e6dc6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/StatsAPI.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ function pairwise! end
3737
3838
Abstract supertype for all statistical hypothesis tests.
3939
Subtypes must implement [`pvalue`](@ref) at a minimum and may also
40-
implement functions such as [`confint`](@ref), [`nobs`](@ref), and
41-
[`dof`](@ref) as appropriate.
40+
implement functions such as [`teststatistic`](@ref), [`confint`](@ref),
41+
[`nobs`](@ref), and [`dof`](@ref) as appropriate.
4242
"""
4343
abstract type HypothesisTest end
4444

@@ -49,4 +49,11 @@ Compute the p-value for a given significance test.
4949
"""
5050
function pvalue end
5151

52+
"""
53+
teststatistic(test)
54+
55+
Return the test statistic for a given hypothesis test.
56+
"""
57+
function teststatistic end
58+
5259
end # module

0 commit comments

Comments
 (0)