ajdamico / convey

variance of distribution measures estimation of survey data
GNU General Public License v3.0
17 stars 7 forks source link

svywattsdec na.rm=TRUE zeroes out SE #396

Closed ajdamico closed 1 year ago

ajdamico commented 1 year ago
library(convey)
library(survey)
library(laeken)
data(eusilc) ; names( eusilc ) <- tolower( names( eusilc ) )

des_eusilc <- svydesign( ids = ~rb030 , strata = ~db040 ,  weights = ~rb050 , data = eusilc )
des_eusilc <- convey_prep( des_eusilc )

des_eusilc_positive <- subset( des_eusilc , eqincome > 0 )

# seems OK
svywattsdec(~eqincome, des_eusilc_positive ,  abs_thresh=10000)

# prints zeroes in SE despite only changing the na.rm=T parameter
( result <- svywattsdec(~eqincome, des_eusilc_positive ,  abs_thresh=10000,na.rm=TRUE) )

SE( result ) == 0
ajdamico commented 1 year ago

fixed by https://github.com/ajdamico/convey/pull/398