xKDR / Survey.jl

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

Only show unique values of strata #224

Open ayushpatnaikgit opened 1 year ago

ayushpatnaikgit commented 1 year ago

In the show method, instead of showing all the strata, I could be better to just show the unique values of the vector.

julia> dstrat = SurveyDesign(apistrat; strata=:stype, weights=:pw)
SurveyDesign:
data: 200×46 DataFrame
strata: stype
    [E, E, E  …  H]
cluster: none
popsize: [6190.0, 6190.0, 6190.0  …  6190.0]
sampsize: [200, 200, 200  …  200]
weights: [44.2, 44.2, 44.2  …  15.1]
probs: [0.0226, 0.0226, 0.0226  …  0.0662]

Would change to

julia> dstrat = SurveyDesign(apistrat; strata=:stype, weights=:pw)
SurveyDesign:
data: 200×46 DataFrame
strata: stype
    [E, M, H]
cluster: none
popsize: [6190.0, 6190.0, 6190.0  …  6190.0]
sampsize: [200, 200, 200  …  200]
weights: [44.2, 44.2, 44.2  …  15.1]
probs: [0.0226, 0.0226, 0.0226  …  0.0662]