How to calculate the confidence interval for a combination of a proportion and continuous data I want to calculate the 95% confidence interval for a combination of binary data and continuous data.
Lets say I want to estimate the production of a certain item from all factories of a given country. I know the size of the population (1000) and take a sample of size 50 for example.
Out of the 50, say 10 produce item A.
The 95% CI of that proportion would be 20% +- 8.3%  i.e. 11.7% - 28.3%
If the values for item A are: 100, 80, 120, 200, 150, 90, 110, 190, 180, 120
The mean would be: 134
SEM: 13.7 and 95% CI would reach from 103 - 164
My Question is now: the best guess for the population production of item A is 20% * 134 so for all 1000 factories 134 * 200 (20% of 1000) but how about the 95% CI.
Do I take the minimum of both calculations i.e. 11.7% * 1000 * 103
and the maximum of both i.e.: 28.3% * 1000 * 164
It feels like I would include the maximum uncertainty and making the 95% CI to wide. But if I only use the mean proportion for both i.e. 20% * 1000 * 103 for min and 20% *1000 * 164 for max I feel like missing the second source of variance.
Doing 11.7% * 134 (mean production of A) * 1000 till 28.3% * 134 * 1000 doesnt seem to be right either.
Any thoughts?
 A: One option would be to ignore the proportion part and just enter a value of 0 for the 40 that do not produce the item, then use the methods for the continuous values.  If you are hesitant about whether your sample size is large enough for the Central Limit Theorem, or other assumptions then you could simulate from a known population and apply this to compute your confidence interval, repeat a bunch of times, and see how many of the confidence intervals contain the true value.
Another approach would be to simulate based on your assumptions and compute the interval based on that.  If you are willing to assume that producing (yes/no) and value of the product (if produced) are independent, then you can generate a proportion based on the binomial and a mean based on the normal and estimates of the distribution of the mean, then multiply those, repeat a bunch of times and compute the confidence interval from the simulations.  If you are not comfortable with the independence assumption then you would need to generate the values representing the relationship you think is there.
