I want to know how you generate estimates of standard error without using survey design for the given examples.
library(survey)
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
example 1
(total_enroll_mean=svymean(~enroll,by=~stype,design= dstrat, na.rm=TRUE))
mean SE
enroll 595.28 18.509
example 2
(total_enroll_total=svytotal(~enroll,by=~stype,design= dstrat, na.rm=TRUE))
total SE
enroll 3687178 114642
example 3
(stype_enroll_mean=svyby(~enroll,by=~stype,design= dstrat, na.rm=TRUE,svymean))
stype enroll se
E 416.78 16.41740
H 1320.70 91.70781
M 832.48 54.52157
example 4
(stype_enroll_total=svyby(~enroll,by=~stype,design= dstrat, na.rm=TRUE,svytotal)
stype enroll se
E 1842584.3 72581.33
H 997128.5 69239.40
M 847464.7 55502.96
So basically I want to generate the standard errors for all 4 examples manually in R instead of using the survey package or srvyr package or any other survey related package. The standard errors that are generated manually for svymean and svytotal should match the standard errors generated by using the survey package in all examples given above.