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

Mistake in `apiclus1` example in documentation. #282

Closed codetalker7 closed 1 year ago

codetalker7 commented 1 year ago

In the docstring for the SurveyDesign struct, there is an example using the apiclus1 dataset.

julia> apiclus1 = load_data("apiclus1");

julia> dclus1 = SurveyDesign(apiclus1; clusters=:dnum, strata=:stype, weights=:pw)
SurveyDesign:
data: 183×43 DataFrame
strata: stype
    [H, E, E  …  E]
cluster: dnum
    [637, 637, 637  …  448]
popsize: [507.7049, 507.7049, 507.7049  …  507.7049]
sampsize: [15, 15, 15  …  15]
weights: [33.847, 33.847, 33.847  …  33.847]
allprobs: [0.0295, 0.0295, 0.0295  …  0.0295]

This is incorrect, since apiclus1 is not stratified (and only clustered).

ayushpatnaikgit commented 1 year ago

Remove the stype argument. Check if a similar mistake has been made elsewhere.