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

WIP: SingleStageSurveyDesign for one cluster, one strata and one weights #155

Merged
merged 4 commits into from
Jan 22, 2023

Conversation

smishr
Copy link
Contributor

@smishr smishr commented Dec 20, 2022

  • Add class for single-stage approximation of multistage sampling
  • Works with cluster strata and weights
  • Can optionally provide probs instead of weights with different constructor
  • Testing for the above, show method

Closes #152 once correctly implemented.

@smishr smishr added the enhancement New feature or request label Dec 20, 2022
@smishr smishr self-assigned this Dec 20, 2022
@smishr smishr changed the title WIP: SingleStageSurveyDesign WIP: SingleStageSurveyDesign for one cluster, one strata and one weights Dec 20, 2022
@smishr
Copy link
Contributor Author

smishr commented Dec 20, 2022

Currently sampsize and cluster variables are different to the analogous design in R, when tested with NHANES and YRBS datasets.

data(yrbs)
yrbs_design <- svydesign(id=~psu, weight=~weight, strata=~stratum, data=yrbs)
data(nhanes)
dnhanes <- svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTMEC2YR, nest=TRUE, data=nhanes)

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2022

Codecov Report

Merging #155 (515eb24) into AnalyticSolution (264dcf2) will decrease coverage by 3.44%.
The diff coverage is 35.00%.

@@                 Coverage Diff                  @@
##           AnalyticSolution     #155      +/-   ##
====================================================
- Coverage             74.46%   71.02%   -3.44%     
====================================================
  Files                    13       13              
  Lines                   419      459      +40     
====================================================
+ Hits                    312      326      +14     
- Misses                  107      133      +26     
Impacted Files Coverage Δ
src/show.jl 0.00% <0.00%> (ø)
src/SurveyDesign.jl 85.08% <60.86%> (-3.53%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@iuliadmtru
Copy link
Contributor

#152 is now closed because it became outdated in the singledesign branch. Should this PR be closed as well?

@smishr
Copy link
Contributor Author

smishr commented Jan 11, 2023

i think some of the features of this PR can be merged with AnalyticalSolution branch

@smishr smishr changed the base branch from main to AnalyticSolution January 13, 2023 14:31
@smishr smishr marked this pull request as ready for review January 22, 2023 05:38
@smishr smishr merged commit 721f5c5 into xKDR:AnalyticSolution Jan 22, 2023
@smishr smishr deleted the two_stage branch January 22, 2023 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TwoStage stratified structure with one cluster and one strata
3 participants