xKDR / Survey.jl

Analysis of complex surveys
https://xkdr.github.io/Survey.jl/
GNU General Public License v3.0
50 stars 19 forks source link

New data structures to support multiple replicate methods. #297

Closed codetalker7 closed 1 year ago

codetalker7 commented 1 year ago

This PR introduces a "replicate type" for every ReplicateDesign object. The purpose is mainly to help with multiple dispatch on difference replicate methods.

We have introduced a new abstract type called InferenceMethod, which will be a supertype for all inference types. For now, the package only supports two inference methods, which we've encoded by the BootstrapReplicates and JackknifeReplicates structs.

Relevant changes have been made to the ReplicateDesign struct to incorporate the new structure.

Also, the mean, total and quantile functions have now been written using the generic variance function. Since ratio takes two columns as it's arguments, it can't be implemented using variance as of now (see #295 ).

Closes #261

codetalker7 commented 1 year ago

The main crux of the code has been added; now I'll work on the documentation and modifying the tests.

codecov-commenter commented 1 year ago

Codecov Report

Merging #297 (79b4c39) into main (0703cfc) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #297   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        13           
  Lines          242       245    +3     
=========================================
+ Hits           242       245    +3     
Impacted Files Coverage Δ
src/SurveyDesign.jl 100.00% <100.00%> (ø)
src/bootstrap.jl 100.00% <100.00%> (ø)
src/jackknife.jl 100.00% <100.00%> (ø)
src/mean.jl 100.00% <100.00%> (ø)