I am having some problems with
svydesign() in R. My sample design is a 2 stage stratification.
How should my fpc2 term be constructed? I having tried including the population size within each strata. i.e.
library(survey) library(dplyr) new2=x %>% group_by(a,b) %>% summarise(Freq=n()) x=merge(x, new2, by=c("a","b")) design=svydesign(id=~1,strata=~a+b,fpc=~fpc1+fpc2,data=x) Error in popsize < sampsize : non-conformable arrays