The authors said they used “ci means” in Stata on the 0/1 variables (test - / test +) for the 3330 participants, and they don’t know how the weights were used. I think I know, thanks to help from @achouldechova, @DonskerClass, @j_kalla, @StatStas, and Jas Sekhon.
“ci means” is designed for a different purpose: a confidence interval for the population mean from a normal sample. In Stata lingo, it accepts only “aweight” or “fweight,” per the manual page here: https://www.stata.com/manuals/rci.pdf 
Using either of these is telling Stata that a data point with a large weight is summarizing a large number of independent observations: https://www.stata.com/manuals/u11.pdf#u11.1.6weight But that isn't what the authors’ weights represent.
From those inputs, Stata would think there were roughly 94 participants in the data set who independently tested positive — and badly underestimate the variance, since there were really just 50. Not Stata’s fault: it was misinformed by what is effectively a data entry error.
For stats nerds: I think this was a roundabout calculation of a Wald interval for a binomial proportion estimate of 2.81% with n = 3330, matching the [2.24%, 3.37%] interval of Table 2. Thanks @goodmanmetrics for pointing out this suspicious coincidence.
Stata has commands like svy that can help with poststratification (stats term for what the authors were trying to do), but ci means isn’t meant for that purpose.
I asked the authors to confirm if they used aweight or fweight, or if I’ve misunderstood anything about what command they used. They declined to say but offered kind words of appreciation for my critical feedback.
They also haven't answered how they did the “cluster adjustment” or whether their LA County press release was based on the same calculation. They say they don’t have bandwidth to answer questions like these now. Fair enough, I do understand they're fielding hundreds of emails.
In sum, the preprint's error bars are a meaningless product of flubbed calculations on top of misused software. They haven't been corrected and can't be without the raw data. No one knows where the error bars in the LAC press release came from, but I'm not inclined to trust them.
Again, to my knowledge, the only mathematically defensible analyses to date — offered by external statisticians — find that the data in the preprint are too noisy to conclude anything interesting about prevalence in Santa Clara County.
I'm still academically curious to see how a good analysis of the full data will turn out, if one ever materializes, but any data analysis may be a pointless exercise from the start, given other issues that have come to light about the data. A couple new-ish ones below:
@jjcherian points out that the authors seem to have used the wrong numbers for the test's false positive rate, ignoring the false positive rate for IgM https://twitter.com/jjcherian/status/1252716924812828676
The preprint only mentions the lower IgG false positive rate, even though they call a participant seropositive if the test kit is positive for *either* IgG or IgM. Total false positives in the specs could be as high as 5/371 (confidence interval [0.4%, 3.1%])
If we change 369/371 to 366/371, then by my calculations the author's delta method confidence interval for prevalence (based off their "cluster-adjusted interval" for q) becomes [-0.4%, 3.6%].
@DanielJHemel gives further information about the false positive rate: https://twitter.com/DanielJHemel/status/1252598622455119873
At this point there seem to be converging strains of evidence that the study can't tell us much about COVID-19 prevalence. Fortunately there are other seroprevalence studies coming out soon which I hope will shed better light.
I sincerely appreciate the heroic efforts of so many dedicated scientists who are working very fast to answer critical questions. It's much harder to design a flawless study and analysis than to criticize it as I'm doing here.
Having done some applied work myself I know how hard it is. Some mistakes are inevitable even given best efforts to be careful. That makes transparency of methods, code, and (where possible) data all the more important.
You can follow @wfithian.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: