# R - Confidence intervals for proportion of zero in a stratified random sample

I'm putting together prevalence estimates and CIs for the results of a stratified SRS survey, for which I've already computed weights. The strata are 5 different regions, each observed over time, and the outcome is binary. Currently I'm putting together a pooled estimate and state-level estimates for each sampling frame using:

for (w in unique(df$$window)) { dfw = df[dfwindow == w, ] wsvy = svydesign(ids=dfwpsu, strata=dfwregion, weights=dfwpweight, data=dfw, fpc=dfw$$N_window)
pooled_prop = svyciprop(~I(y > 0), wsvy, level=0.95)
state_prop = svyby(~I(y > 0), ~region, design=wsvy, svyciprop, vartype="ci", level=0.95) %>% mutate_if(is.numeric, round, digits=4)
print(w)
print(round(as.vector(pooled_prop), digits=4))
print(round(attr(pooled_prop, "ci"), digits=4))
print(state_prop)
}


This is all well and good, except that for a handful of sample frames, there were regions with 0 instances of the outcome variable (i.e. the observed proportion = 0). So a point estimate of 0 is fine here, but I want to also have reasonable confidence intervals, which are apparently not possible using svyciprop

Does anyone know a method in R for producing confidence intervals for surveys when the observed proportion is 0 or 1?

In general, the problem is that it's hard to bound the design effect at all when all the observed values are zero (which is why svyciprop doesn't).
When you only have stratified element sampling and no clustering it should be possible, though it's still not easy. Suppose, for example, that there are non-zero values in the population, but only in one stratum. Suppose that sample size in that stratum is $$n_1$$ from a population $$N_1$$. The rule of three says a good upper confidence limit on the proportion $$p_1$$ in that stratum is $$3/n_1$$, which translates to $$(N_1/N)(3/n_1)$$ in the population, or $$(3/N)(N_1/n_1)$$.