Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When passing both weights and popsize #314

Open
ayushpatnaikgit opened this issue Aug 17, 2023 · 0 comments
Open

When passing both weights and popsize #314

ayushpatnaikgit opened this issue Aug 17, 2023 · 0 comments

Comments

@ayushpatnaikgit
Copy link
Member

ayushpatnaikgit commented Aug 17, 2023

julia> dclus1 = SurveyDesign(apiclus1; weights=:pw, clusters=:dnum, popsize=:fpc)
SurveyDesign:
data: 183×45 DataFrame
strata: none
cluster: dnum
    [637, 637, 637    448]
popsize: [757, 757, 757    757]
sampsize: [15, 15, 15    15]
weights: [50.4667, 50.4667, 50.4667    50.4667]
allprobs: [0.0198, 0.0198, 0.0198    0.0198]
> dclus1 = svydesign(id=~dnum, data = apiclus1, weight = ~pw, fpc = ~fpc)

> dclus1$allprob

            pw
1   0.02954472
2   0.02954472
3   0.02954472
4   0.02954472
5   0.02954472
6   0.02954472
7   0.02954472
8   0.02954472
9   0.02954472
...

Notice the difference in allprobs

We are prefering popsize, while R prefers weights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant