Solved – Computing confidence intervals for count data

confidence interval

I have a representative sample token on area of 60 mq (squared meter) of a territory of 54077 mq. This sample contains the number of little plants that there are for each mq. The sample is defined in R as:

s=c(13,7,10,4,28,0,10,0,0,0,0,0,0,0,0,0,6,
    0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,1,2,2,0,
    2,3,3,3,1,3,12,33,1,31,0,1,21,0,3,1,8,
    0,1,1,6,0,2,0)

The sum of s is 227.

To compute the CI of s I used a t.test (also it is not a normal distribution: it is not that my problem).

t.test(s)
t = 3.9606, df = 59, p-value = 0.0002039
mean of s =  3.783333 - 95 % confidence interval:  1.871905 - 5.694762

My question is:

Can I assume that the CI of number of plant in the entire territory is between
$1.871905\times 227\times (54077/60) – 5.694762\times 227\times (54077/60)$?

I think NO because the count is very simplified but I hope YES.

Best Answer

As Hans Engler suggested, a bootstrap should work well for these data. You can use the boot or bootstrap packages directly, but it’s much easier to use the simpleboot package:

s = c(13,7,10,4,28,0,10,0,0,0,0,0,0,0,0,0,6,
      0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,1,2,2,0,
      2,3,3,3,1,3,12,33,1,31,0,1,21,0,3,1,8,
      0,1,1,6,0,2,0)

library(simpleboot)
b = one.boot(s, mean, R=10^4)
boot.ci(b, type="perc")

The output is:

BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 10000 bootstrap replicates

CALL : 
boot.ci(boot.out = b, type = "perc")

Intervals : 
Level     Percentile     
95%   ( 2.10,  5.85 )  
Calculations and Intervals on Original Scale

As you can see (and as one might have expected), the confidence interval is not very different from the confidence interval from the t-test (1.87–5.69).