JuliaStats / HypothesisTests.jl

Hypothesis tests for Julia
MIT License
298 stars 87 forks source link

Pretty report for tests with parameters other than standard #81

Open hckr opened 8 years ago

hckr commented 8 years ago

When I call the following example I receive a pretty report, but with confidence equal to 95% specifically (which is currently hardcoded). What if user would like to make a test with confidence 99% and still have similar report? It also isn't possible to perform a one-sided test that way.

julia> OneSampleTTest([1,2,3], 2)
One sample t-test
-----------------
Population details:
    parameter of interest:   Mean
    value under h_0:         2
    point estimate:          2.0
    95% confidence interval: (-0.48413771175033027,4.48413771175033)

Test summary:
    outcome with 95% confidence: fail to reject h_0
    two-sided p-value:           1.0 (not significant)

Details:
    number of observations:   3
    t-statistic:              0.0
    degrees of freedom:       2
    empirical standard error: 0.5773502691896258
BenjaminBorn commented 7 years ago

I had the same problem when adding one-sided Chi^2 based tests in #87. It's confusing that the report states "two-sided p-value".

julia> LjungBoxTest(y,2)
Ljung-Box autocorrelation test
------------------------------
Population details:
    parameter of interest:   not applicable
    value under h_0:         NaN
    point estimate:          NaN

Test summary:
    outcome with 95% confidence: fail to reject h_0
    two-sided p-value:           0.5203983135578232 (not significant)

Details:
    number of observations: 100
    number of lags:         2
    d-o-f correction:       0
    Q statistic:            1.3063215460285016