Survey.jl
Survey.jl copied to clipboard
Enhancing, testing and documenting Horvitz-Thompson total/mean for `singledesign`
We had implemented ht_svytotal
and HT_HartleyRaoVarApprox
in the ht.jl
file
- 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 specifycluster =
orstrata =
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 ofSurveyDesign
into aHTSurveyDesign
object. This would be a crude approximation of complex designs, but it would be good starting point for the package -
ht_svymean
is still work in progress, as we havent been able to figure out the scaling factor correctly between variance ofht_svytotal
given byHT_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) - We need to test and document all the above
@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?
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/
I am working on this right now
It is not feasible to complete this right now. Will look into it later