Variance (error bars) with a binomial proportion

1. Aug 4, 2011

labrookie

I have a list of chemicals, their assay test results, and a binomial column of whether or not the assay test result was high enough to be considered a threat (anything >2g/ml). Some chemicals were tested more than once, but others were not. It is understood that it is a poor set of data, but I am trying to be as useful as I can with it. I would like to take into account the variance within the same chemical.

Portion of data:

A .04 0
B 1.2 0
C 4.6 1
D 1.1 0
D 2.3 1
E .03 0
F .27 0
G .92 0
G 3.00 1
G 2.34 1
H 1.36 0
I .80 0
J .45 0
K 1.75 0
L 2.45 1
L 2.60 1
M 5.6 1
N 1.11 0
O 3.14 1
P 0.50 0
Q 1.15 0
Q 2.01 1
R 1.50 0
S .09 0
T .12 0

I am trying to simply calculation the proportion where the binomial column is 1. That part is easy, but I am also trying to inclue standard error or some form of the variance. How can I take into account the variance within a chemical tested more than once?

2. Aug 5, 2011

Stephen Tashi

Your terminology isn't clear. Do you have a list of "chemicals" or a list of "samples of substances"? If you have a a list of "chemicals", what is being "assayed"? Wouldn't they all be 100% that chemical?

For example is "D" something like "cynanide" and are the "assay" results for "D", two tests run on two different samples of water?

3. Aug 10, 2011

labrookie

Yes, they are all different samples. The assay is for an amount of gas given off by each of them. "D" happens to be the same chemical that was sampled.

I am trying to show a proportion of the samples that are greater >2g/ml. Just showing the binomial variation may underestimate the total variation...because there is also variation when the sample chemical is tested more than once. How can I tie this variation into my proportion variation?

4. Aug 11, 2011

Stephen Tashi

It still isn't clear what real world quantity you are trying to estimate. For example, suppose I am trying to answer the nebulous question: "What is the probability that a randomly selected sample of water from my town contains dangerous levels of a chemical?". Even if I am careful to define "randomly selected" in some reasonable manner so that all sources of water are represented in proportion to the amount of water drawn from then, there is still the problem of which chemicals are selected for the the tests. I could bias the results by testing for one chemical more than another. For example, suppose the water in my town tends to be poluted by lead and I do most of my testing for radon.