I try to use the expss
packages for survey data analysis, but the result of standard errors, variances and confidence intervals differ of the survey
package result.
In survey
:
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
In expss
:
apiclus1 %>% tab_cells(api99) %>%
tab_rows(stype) %>% tab_weight(pw) %>%
tab_stat_fun(w_mean,w_se) %>% tab_pivot()
| | | | | #Total |
| ----- | -- | ----- | ------ | ------ |
| stype | E | api99 | mean | 607.8 |
| | | | se | 1.6 |
| | H | api99 | mean | 595.7 |
| | | | se | 4.7 |
| | M | api99 | mean | 608.6 |
| | | | se | 3.7 |
How can i use the functions of survey
package within expss
?