Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better docstring for VarianceTests #254

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
18 changes: 11 additions & 7 deletions src/t.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ function EqualVarianceTTest(nx::Int, ny::Int, mx::Real, my::Real, vx::Real, vy::
end

"""
EqualVarianceTTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})
EqualVarianceTTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real}, μ0::Real=0)

Perform a two-sample t-test of the null hypothesis that `x` and `y` come from distributions
with equal means and variances against the alternative hypothesis that the distributions
have different means but equal variances.
with equal variances and mean difference μ0 (defaults to 0) against the alternative hypothesis
that the distributions have equal variances and a mean difference different from μ0.
KronosTheLate marked this conversation as resolved.
Show resolved Hide resolved

See also: [`VarianceFTest`](@ref) to test whether two datasets have equal variance.

Implements: [`pvalue`](@ref), [`confint`](@ref)
"""
function EqualVarianceTTest(x::AbstractVector{T}, y::AbstractVector{S}, μ0::Real=0) where {T<:Real,S<:Real}
Expand All @@ -190,11 +192,11 @@ end
testname(::UnequalVarianceTTest) = "Two sample t-test (unequal variance)"

"""
UnequalVarianceTTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})
UnequalVarianceTTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real}, μ0::Real=0)

Perform an unequal variance two-sample t-test of the null hypothesis that `x` and `y` come
from distributions with equal means against the alternative hypothesis that the
distributions have different means.
Perform a two-sample t-test of the null hypothesis that `x` and `y` come from distributions
with different variances and mean difference μ0 (defaults to 0) against the alternative hypothesis
that the distributions have different variances and a mean difference different from μ0.

This test is sometimes known as Welch's t-test. It differs from the equal variance t-test in
that it computes the number of degrees of freedom of the test using the Welch-Satterthwaite
Expand All @@ -204,6 +206,8 @@ equation:
\\frac{(k_i s_i^2)^2}{ν_i}}
```

See also: [`VarianceFTest`](@ref) to test whether two datasets have equal variance.

Implements: [`pvalue`](@ref), [`confint`](@ref)
"""
function UnequalVarianceTTest(x::AbstractVector{T}, y::AbstractVector{S}, μ0::Real=0) where {T<:Real,S<:Real}
Expand Down
18 changes: 11 additions & 7 deletions src/z.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ testname(::EqualVarianceZTest) = "Two sample z-test (equal variance)"
population_param_of_interest(x::TwoSampleZTest) = ("Mean difference", x.μ0, x.xbar) # parameter of interest: name, value under h0, point estimate

"""
EqualVarianceZTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})
EqualVarianceZTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real}, μ0::Real=0)

Perform a two-sample z-test of the null hypothesis that `x` and `y` come from distributions
with equal means and variances against the alternative hypothesis that the distributions
have different means but equal variances.
with equal variances and mean difference μ0 (defaults to 0) against the alternative hypothesis
that the distributions have equal variances and a mean difference different from μ0.

See also: [`VarianceFTest`](@ref) to test whether two datasets have equal variance.

Implements: [`pvalue`](@ref), [`confint`](@ref)
"""
Expand Down Expand Up @@ -163,12 +165,14 @@ end
testname(::UnequalVarianceZTest) = "Two sample z-test (unequal variance)"

"""
UnequalVarianceZTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real})
UnequalVarianceZTest(x::AbstractVector{T<:Real}, y::AbstractVector{T<:Real}, μ0::Real=0)

Perform an unequal variance two-sample z-test of the null hypothesis that `x` and `y` come
from distributions with equal means against the alternative hypothesis that the
distributions have different means.
Perform a two-sample z-test of the null hypothesis that `x` and `y` come from distributions
with different variances and mean difference μ0 (defaults to 0) against the alternative hypothesis
that the distributions have different variances and a mean difference different from μ0.

See also: [`VarianceFTest`](@ref) to test whether two datasets have equal variance.

Implements: [`pvalue`](@ref), [`confint`](@ref)
"""
function UnequalVarianceZTest(x::AbstractVector{T}, y::AbstractVector{S}, μ0::Real=0) where {T<:Real,S<:Real}
Expand Down