Survey.jl icon indicating copy to clipboard operation
Survey.jl copied to clipboard

Enhancing, testing and documenting Horvitz-Thompson total/mean for `singledesign`

Open smishr opened this issue 2 years ago • 4 comments

We had implemented ht_svytotal and HT_HartleyRaoVarApprox in the ht.jl file

  1. Since HT total is design agnostic weighted total, and you only need weighting info to calculate the total/mean, it should work with the currently implemented SurveyDesign object, giving correct totals for any design, without the need to specify cluster = or strata = argument. I think we should test the function and compare with some complex designs from R. If this is indeed the case, then we could encaspulate the relavant parts of SurveyDesign into a HTSurveyDesign object. This would be a crude approximation of complex designs, but it would be good starting point for the package
  2. ht_svymean is still work in progress, as we havent been able to figure out the scaling factor correctly between variance of ht_svytotal given by HT_HartleyRaoVarApprox. I think having a look through the Sarndal textbook will find us the relation between variances for Hartley Rao total and means (it is not as simple as 1/N^2)
  3. We need to test and document all the above

smishr avatar Nov 14 '22 06:11 smishr

@ayushpatnaikgit @iuliadmtru I think this does give correct total for any arbitrary design, should we look to complete and cleanup this for 0.2.0 release or look into later in December?

smishr avatar Nov 29 '22 17:11 smishr

This should be integrated into singledesign branch with the new general survey design.

Idea is to be similar to the single variance function in R, that can calculate the variance for any arbitrary design. See for details and Hartley Rao approx https://www.practicalsignificance.com/posts/understanding-the-survey-packages-recursive-algorithm/

smishr avatar Jan 04 '23 06:01 smishr

I am working on this right now

smishr avatar Jan 04 '23 06:01 smishr

It is not feasible to complete this right now. Will look into it later

smishr avatar Jan 15 '23 09:01 smishr