adw96 / DivNet

diversity estimation under ecological networks
83 stars 18 forks source link

DivNet error bars #59

Closed mooreryan closed 3 years ago

mooreryan commented 4 years ago

I had a question regarding how to describe error bars in DivNet figures.

Here are the relevant lines of code:

Variance is the var function:

  output_list[["shannon-variance"]]  <- list_of_fitted_models %>% 
    lapply(function(x) sapply(x$shannon, function(x) x$estimate)) %>%
    simplify2array %>%
    apply(1, var, na.rm = TRUE)

error is square root of variance, (so standard deviation)

https://github.com/adw96/DivNet/blob/160daaf21d3ba49d46c2f987c798ce32e6cb8fe8/R/divnet_main.R#L156

and the interval is twice the SD in both directions:

https://github.com/adw96/DivNet/blob/160daaf21d3ba49d46c2f987c798ce32e6cb8fe8/R/divnet_main.R#L157

So if I were to describe the error bars in a manuscript, what would be the best way? Something like: "error bars represent four standard deviations" or "error bars represent two standard deviations from the mean" or something else?

adw96 commented 3 years ago

Hi @mooreryan ! What a summer, yeesh. Sorry for not getting back to you sooner. I would use one of the following: