I apologize in advance for potentially asking a fairly obvious question as a somewhat mathematically uninclined ecologist, but I am wondering if someone could help me understand how error and confidence intervals are calculated for parameter estimates in nested models?
I have a nested dataset where species density was recorded within subsamples (transects) within different locations (plots/sites), and I need to estimate the mean species density within the region, taking into account variability at both spatial scales. To do this I set up an intercept only model with transects nested within locations, and location as random variables, which gives me an estimate of the mean density (correct?) and a confidence interval around this mean. But I would very much like to better understand how these are calculated.
I have played with different methods for estimating the "global" mean, including using the mean of the means to estimate the global mean and using either the variation among location means, or propagating the error among transects within each location to generate confidence intervals, but incorporating both these scales of variability will provide a better estimate of variance and confidence. So I am trying to understand how to best do this and how a nested model as described above incorporates both.
I greatly appreciate any input.