Dear R-Users, I was using survey for the past years and now I am experiencing some problems with scripts that was working in the past.
We are working with big data bases so I can't put all variables that I will use in the svydesign. Script working: > data(api) > dclus1<-svydesign(id=apiclus1$dnum, weights=apiclus1$pw, fpc=apiclus1$fpc) > svyby(apiclus1$api99,apiclus1$stype, dclus1, svymean) by V1 se E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 > svyby(apiclus1$api99,~apiclus1$stype, dclus1, svymean) apiclus1$stype V1 se E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 > dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) > svyby(~api99, ~stype, dclus1, svymean) stype api99 se.api99 E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 > sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] grDevices datasets splines graphics stats tcltk utils methods base other attached packages: [1] gdata_2.8.2 survey_3.26 foreign_0.8-42 SOAR_0.99-8 svSocket_0.9-51 TinnR_1.0.3 R2HTML_2.2 [8] Hmisc_3.8-3 survival_2.36-2 loaded via a namespace (and not attached): [1] cluster_1.14.1 grid_2.12.1 gtools_2.6.2 lattice_0.19-33 svMisc_0.9-63 tools_2.12.1 script not working: > data(api) > > dclus1<-svydesign(id=apiclus1$dnum, weights=apiclus1$pw, fpc=apiclus1$fpc) > svyby(apiclus1$api99,apiclus1$stype, dclus1, svymean) Erro em svyby.default(apiclus1$api99, apiclus1$stype, dclus1, svymean) : objeto 'byfactor' não encontrado > svyby(apiclus1$api99,~apiclus1$stype, dclus1, svymean) Erro em svyby.default(apiclus1$api99, ~apiclus1$stype, dclus1, svymean) : objeto 'byfactor' não encontrado > > dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) > svyby(~api99, ~stype, dclus1, svymean) stype api99 se E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 > sessionInfo() R version 3.0.3 (2014-03-06) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] survey_3.29-5 loaded via a namespace (and not attached): [1] tools_3.0.3 > [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.