Confidence intervals for proportions (prevalence) I have some data on a sample of $n=1776$ hospitals. For each hospital there is a total number of patients (patients), and a number of patients diagnosed with a particular condition (diagnosed). Do I take the mean of this proportion,diagnosed/patients, for all hospitals in the sample, $\hat{\mu}$, and calculate a 95% confidence interval as $\hat{\mu} \pm 1.96\sigma / \sqrt{n}$ or as $\hat{\mu} \pm 1.96  \sqrt{\hat{\mu}(1-\hat{\mu})/n}$ ? Or.... ?
Update
[Following comments from whuber]. Additionally, the data are broken down into 2 age groups (young and old) and 3 risk scores. That is, all 1776 hospitals have total numbers of patients as follows:
               younger patients       older patients             

Low risk            A                      D

Medium risk         B                      E

High risk           C                      F

...and similarly for the numbers of patients with the condition. 
So, for each combination of age group and risk score, I would like to estimate the mean prevalence and a confidence interval for it.
Here is some summary of the data
Risk   age    mean   sd      n
1      u50    0.37   0.19    1776
2      u50    0.49   0.25    1776
3      u50    0.54   0.26    1776
1      o50    0.45   0.36    1776
2      o50    0.52   0.42    1776
3      o50    0.67   0.41    1776

 A: Joe,
Check to see if (sample size)*(proportion diagnosed) >= 5 for each hospital or group of hospitals by age/risk score. If so, then the normal dbn closely approximates the binomial dbn and the 95% CI = p_hat +/- 1.96*(p_hat*(1-p_hat)/n)^0.5 formula may be used. 
For a better approximation, use the Wilson score interval (see http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval).
Robert
A: You could try a nonparametric bootstrap approach. For example
require(boot)
the.means = function(dt, i) {mean(dt[i])}
boot.obj <- boot(data=mydata, statistic=the.means , R=10000) 
quantile(boot.obj$t, c(.025,.975))

You can repeat this for each of your 6 subsets of data.
A: Updated Regression Approach
Here's a way that might work. You can "expand" your data to patient level, so each row corresponds to a patient, who is either diagnosed or not. It might look like this:

hospital   age   risk   diagnosed
             1     1      0   1
             1     0      1   0
             1     1      2   1

Then you estimate a binary model, such as a probit, where your dependent variables are dummies for the risk-age group interactions. You may also want to cluster on the hospital. Then you can calculate the predictive margins for each risk-age dummy.
This will not work
You can hack this in a regression context by simple linear model of $\log(y)$ on a constant, and exponentiating the coefficients and CIs. This will give you geometric mean and its CI, which is appropriate mean to use since you are dealing with rates. Since all your $\mu$s are greater than zero, taking logs won't cost you any data.
Here's an example in Stata:
. sysuse auto,clear
(1978 Automobile Data)

. generate logprice=log(price)

. regress logprice, eform(GM)

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  0,    73) =    0.00
       Model |           0     0           .           Prob > F      =       .
    Residual |  11.2235331    73  .153747029           R-squared     =  0.0000
-------------+------------------------------           Adj R-squared =  0.0000
       Total |  11.2235331    73  .153747029           Root MSE      =  .39211

------------------------------------------------------------------------------
    logprice |         GM   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |   5656.907   257.8496   189.56   0.000     5165.664    6194.866
------------------------------------------------------------------------------

. means price

    Variable |    Type        Obs        Mean       [95% Conf. Interval]
-------------+----------------------------------------------------------
       price | Arithmetic      74    6165.257        5481.914     6848.6 
             |  Geometric      74    5656.907        5165.664   6194.865 
             |   Harmonic      74    5296.672        4928.901    5723.75 
------------------------------------------------------------------------

Note that the geometric mean matches the regression output very nicely. I learned about this from Roger Newson's Stata Tip #1.
