Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierlabayle committed Jan 31, 2024
1 parent 31fa3ef commit 1f6db9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/counterfactual_mean_based/estimates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ Performs a T test on the EICEstimate.
HypothesisTests.OneSampleTTest(est::EICEstimate, Ψ₀=0) =
OneSampleTTest(est.estimate, est.std, est.n, Ψ₀)

"""
significance_test(estimate::EICEstimate, Ψ₀=0)
Performs a TTest
"""
significance_test(estimate::EICEstimate, Ψ₀=0) = OneSampleTTest(estimate, Ψ₀)

Base.show(io::IO, mime::MIME"text/plain", est::Union{EICEstimate, ComposedEstimand}) =

Check warning on line 107 in src/counterfactual_mean_based/estimates.jl

View check run for this annotation

Codecov / codecov/patch

src/counterfactual_mean_based/estimates.jl#L107

Added line #L107 was not covered by tests
Expand Down
5 changes: 5 additions & 0 deletions src/estimates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ function HypothesisTests.OneSampleZTest(estimate::ComposedEstimate, Ψ₀=0)
return OneSampleZTest(estimate.estimate[1], sqrt(estimate.cov[1]), estimate.n, Ψ₀)
end

"""
significance_test(estimate::ComposedEstimate, Ψ₀=zeros(size(estimate.estimate, 1)))
Performs a TTest if the estimate is one dimensional and a HotellingT2Test otherwise.
"""
function significance_test(estimate::ComposedEstimate, Ψ₀=zeros(size(estimate.estimate, 1)))
if length(estimate.estimate) == 1
Ψ₀ = Ψ₀ isa AbstractArray ? first(Ψ₀) : Ψ₀
Expand Down

0 comments on commit 1f6db9e

Please sign in to comment.