coreytcallaghan / bird_diversity_MoB

working draft of analysis for a paper currently under review
1 stars 0 forks source link

collapsing bootstrapping results #18

Closed coreytcallaghan closed 3 years ago

coreytcallaghan commented 3 years ago

@dmcglinn sorry to bother you mate.

I'm still not sure how the best way to collapse the bootstrapping results is.

Currently, I'm very very simply doing:

image

But I guess this means that because it is random sampling, a given value of ghm could be sampled in one random sample only and so the mean would be a function of 1 value (thoeretically). Idk how often this happens, but it is possible. In other instances (say a well visited hotspot) a checklist (and therefore associated ghm value) could be sampled almost every time so it would then be the mean across 100 bootstrap samples.

So I'm not sure exactly how to collapse the bootstrap samples!

Could do what I've done above, but round it to every 0.01 values (2 decimal places) and then take the mean (which would help alleviate the 'exact values' not matching...

Or, could fit a lm and predict 100 values based on that fit.... BUT I can't conceptualize if this would influence our linear vs nonlinear decision later on.

Anyway, kind of stuck, so any thoughts/insights would be appreciated. The super hacky script that is summarizing the bootstrapping results is here: https://github.com/coreytcallaghan/bird_diversity_MoB/blob/main/R/assess_bootstrapping_raw_data_results.R

coreytcallaghan commented 3 years ago

Okay - done with this now. The relevant code is:

summary <- temp_dat %>%
    mutate(ghm=round(ghm, digits=2)) %>%
    group_by(scale, index, grid_size, checklists_per_grid, ghm) %>%
    summarize(mean_value=mean(value)) %>%
    mutate(BCR_CODE=BCR_number)