Closed ajdamico closed 1 year ago
library( survey ) library( convey ) library( laeken ) # collect and format data data( eusilc ) names( eusilc ) <- tolower( names( eusilc ) ) # set up survey design objects des_eusilc <- svydesign( ids = ~rb030 , strata = ~db040 , weights = ~rb050 , data = eusilc ) des_eusilc_rep <-as.svrepdesign( des_eusilc , type= "bootstrap" , replicates = 50 ) # prepare for convey des_eusilc <- convey_prep( des_eusilc ) des_eusilc_rep <- convey_prep( des_eusilc_rep ) # filter positive des_eusilc <- subset( des_eusilc , py010n > 0 | is.na( py010n ) ) des_eusilc_rep <- subset( des_eusilc_rep , py010n > 0 | is.na( py010n ) ) # returns an incorrect structure.. # the `a` object should have the same attributes as the `b` object a <- svypoormed( ~ py010n , des_eusilc ) # incorrectly gives an error svypoormed( ~ py010n , des_eusilc_rep ) # both work as expected b <- svypoormed( ~ py010n , des_eusilc , na.rm = TRUE ) svypoormed( ~ py010n , des_eusilc_rep , na.rm = TRUE ) names( a ) names( b )
fixed by https://github.com/ajdamico/convey/pull/401