my apologies if this is in the wrong place. There are similar questions on here, by I'm really confused about what is appropriate for my data.
My goal is to present average population densities of various species per habitat type, with confidence intervals (data collected from literature review). The data below are a sample, but I have about 150 species with 6+ habitats each, with very varied sample sizes (from 350+ to <10) and distributions (most are heavily skewed right, but some are scattered all over the place....!).
The analysis has to be quick and repeatable, so I need to use the same approach for all species. After researching the options, it seems presenting a median would be best?
For the confidence intervals, I've come across an approach using the Median Absolute Value, but the constant in this is dependent on the distribution - so not repeatable for all samples. I've also read about bootstrapping for the CI's.
So, my questions are:
Is the median the most robust (best??) average where data are not necessarily normal?
If so, what is the best way to estimate CI's for a median?
Is there a simple way of calculating CI's that is robust to different distributions (i.e. repeatable for different species / habitats) or is this asking too much??
Are there any existing functions for this in R?
I'm sure there are lots of ways to present these data, but I can't seem to find a standard accepted approach - if there isn't one I just need to do something justifiable i guess!
Ests <- "Habitat Estimate
1 Woodland 4.8
2 Woodland 2.7
3 Woodland 0.6
4 Woodland 0
5 Woodland 0.9
6 Woodland 1
7 Woodland 8
8 Woodland 3
9 Woodland 2.1
10 Woodland 1.1
11 Woodland 0
12 Woodland 0
13 Woodland 0
14 Woodland 0
15 Woodland 8
16 Woodland 5
17 Woodland 1
18 Woodland 2
19 Woodland 1.2
19 Woodland 0.9
19 Woodland 4
19 Woodland 3
19 Woodland 0.3
20 Grassland 3
21 Grassland 2
22 Grassland 7
23 Grassland 9
24 Grassland 17
25 Grassland 25
26 Grassland 0
27 Grassland 4
28 Grassland 16
29 Grassland 17
30 Grassland 37
31 Grassland 17
32 Grassland 8
33 Grassland 8
34 Grassland 15
35 Grassland 22
36 Grassland 15
37 Grassland 20
38 Grassland 14"
.
Data <- read.table(text=Ests, header = TRUE)
ggplot(Data, aes(x=Estimate)) +
geom_histogram(binwidth=.5, colour="black", fill="white") +
facet_grid(Habitat ~ .)
EDIT - I've had a go at bootstrapping using boot.ci in R. There are 4 options (normal, basic, percentile and bias-corrected). Maindonald & Braun's "Data Analysis and Graphics Using R: An Example-Based Approach" suggests that narrower CI's for the bias-corrected method than the percentile means that more resamples - I've tried up to 10,000 but it doesn't make much difference. Does this mean the sample is too small??
The bias-corrected method seems most popular, but I'm guessing that depends on the data, I'm not sure which I should use?
Also, a final problem is that the data should be bound at zero (can't have negative pop densities), and some of the CI's are coming back as negative - can I simply report these as zero, or is that a terribly unacceptable thing to do??
Thanks very much for any help offered.