add missing-tolerant adjust method#117
Conversation
|
Thanks for this! I have just one concern, that was already pointed out in #108 by @juliangehring. The behaviour here should depend a lot on how the Otherwise, it is not. For example, iirc some eQTL software only computes p-values that are smaller than In any case, I do not mind having this PR as the default, but I think it should be made explicit to users. |
|
That's a very good point I had not considered. It could, in theory, have a kwarg of a Bool to specify the handling of |
|
@nignatiadis the committed change suggests a method accounting for the scenarios your describe: julia> a = [0.1, 0.2, missing, 0.4] ;
julia> adjust(a, Holm())
4-element Array{Union{Missing, Float64},1}:
0.30000000000000004
0.4
missing
0.4
julia> adjust(a, Holm(), include_missing = false) # verbose version of default kwarg
4-element Array{Union{Missing, Float64},1}:
0.30000000000000004
0.4
missing
0.4
julia> adjust(a, Holm(), include_missing = true)
4-element Array{Float64,1}:
0.4
0.6000000000000001
1.0
0.8 |
This PR addresses issue #108 of including a method ignorant of
missingvalues in a vector of P values. The reason this method is necessary/useful is that when using split-apply-combine methods for categorical data grouping whenmissingvalues are present, situations may arise where one of the grouped vectors contains only missing values and thus the resulting P value would bemissingas well.The introduced method to
adjustcreates a copy of the Pvalue vector, performs the correctionmethodon all the non-missing Pvalues, and overwrites the original nonmissing Pvalues in the copied vector, returning the modified copy with all themissingvalues preserved in their original locations.This method should leave the original unaffected: