Data and objective
I have count data from two groups, A and B, from across multiple samples. I want to estimate the average ratio of A to B across all samples, along with a confidence interval.
Issues
I'm not sure which formula to use. I'm using the normal approximation, but the confidence interval overlaps zero, but that can't be right because a negative ratio is unrealistic.
$$ CI = \bar{x} \pm z \frac{\sigma}{\sqrt{n}} $$
From that, I have: mean = 0.175, lower = -0.0884, upper = 0.438
Question
How can I bound the confidence interval to non-negative values?
Further details
A glimpse of the data:
sample countB countA A_to_B
...
42 42 1 1 1.0
43 43 2 0 0.0
44 44 2 0 0.0
45 45 2 0 0.0
46 46 2 0 0.0
47 47 2 0 0.0
48 48 2 0 0.0
49 49 2 0 0.0
50 50 2 0 0.0
51 51 1 0 0.0
52 52 2 1 0.5
53 53 2 1 0.5
...
The full data for reproducibility:
"sample","countB","countA","A_to_B"
1,2,0,0
2,2,0,0
3,2,0,0
4,6,0,0
5,3,0,0
6,33,0,0
7,50,0,0
8,45,0,0
9,2,0,0
10,1,0,0
11,1,0,0
12,2,1,0.5
13,1,0,0
14,1,8,8
15,2,0,0
16,3,0,0
17,3,0,0
18,1,0,0
19,5,0,0
20,2,0,0
21,12,0,0
22,8,0,0
23,8,0,0
24,7,0,0
25,5,0,0
26,6,0,0
27,5,0,0
28,2,0,0
29,2,0,0
30,2,0,0
31,3,0,0
32,3,0,0
33,3,0,0
34,5,0,0
35,5,0,0
36,1,0,0
37,3,0,0
38,2,0,0
39,9,0,0
40,1,0,0
41,1,0,0
42,1,1,1
43,2,0,0
44,2,0,0
45,2,0,0
46,2,0,0
47,2,0,0
48,2,0,0
49,2,0,0
50,2,0,0
51,1,0,0
52,2,1,0.5
53,2,1,0.5
54,6,0,0
55,6,0,0
56,4,0,0
57,20,0,0
58,9,0,0
59,6,0,0
60,3,0,0

