根据svytable的文档,如果使用na.rm = TRUE选项,则在计算加权频数时会排除NA值。示例如下:
library(survey) data(api) dclus1<-svydesign(id=~dnum,sampling=~pw,data=apiclus1) svytable(~stype,design=dclus1,na.rm=TRUE)
以上代码中,na.rm = TRUE参数设置为排除NA值。如果设置为默认参数na.rm = FALSE,则不会排除NA值。