Skip to content

Commit 0e032e6

Browse files
Merge pull request #84 from juliangehring/weight-methods
Unify methods for weighted Stouffer combination
2 parents a8c0062 + 95248a5 commit 0e032e6

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/combinations.jl

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ function combine(pValues::AbstractVector{T}, method::M)::T where {T<:AbstractFlo
44
combine(PValues(pValues), method)
55
end
66

7-
function combine(pValues::AbstractVector{T}, weights::Weights, method::M)::T where {T<:AbstractFloat, M<:PValueCombination}
8-
combine(PValues(pValues), weights, method)
9-
end
10-
11-
function combine(pValues::AbstractVector{T}, weights::AbstractVector{R}, method::M)::T where {T<:AbstractFloat, R<:Real, M<:PValueCombination}
12-
combine(PValues(pValues), weights, method)
13-
end
14-
157

168
## Fisher combination ##
179

@@ -71,7 +63,7 @@ function combine(pValues::PValues{T}, method::StoufferCombination)::T where T<:A
7163
return p
7264
end
7365

74-
function combine(pValues::PValues{T}, weights::Vector{T}, method::StoufferCombination)::T where T<:AbstractFloat
66+
function combine(pValues::PValues{T}, weights::AbstractVector{R}, method::StoufferCombination)::T where {T<:AbstractFloat, R<:Real}
7567
n = length(pValues)
7668
if n == 1
7769
return pValues[1]
@@ -85,8 +77,8 @@ function combine(pValues::PValues{T}, weights::Vector{T}, method::StoufferCombin
8577
return p
8678
end
8779

88-
function combine(pValues::PValues{T}, weights::Weights, method::StoufferCombination)::T where T<:AbstractFloat
89-
combine(pValues, values(weights), method)
80+
function combine(pValues::AbstractVector{T}, weights::AbstractVector{R}, method::StoufferCombination)::T where {T<:AbstractFloat, R<:Real}
81+
combine(PValues(pValues), weights, method)
9082
end
9183

9284

0 commit comments

Comments
 (0)