commfish / seak_sablefish

NSEI sablefish stock assessment
8 stars 5 forks source link

mean cpue #47

Open ben-williams opened 4 years ago

ben-williams commented 4 years ago

https://github.com/commfish/seak_sablefish/blob/f7bd2e40eb60552dd6131da15e529b35a6e8644c/r/llsurvey_cpue.R#L119

note that there is a difference between mean cpue for a stat area and stat area cpue e.g., Not sure if this really matters for how you are approaching things - but thought I would mention it.

pivot_longer(cols = c("sablefish", "halibut", "idiot", "shortraker", 
                         "rougheye", "skates", "sleeper_shark"),
               names_to = "hook_accounting",
               values_to = "n") %>%
  mutate(set_cpue = n / set_hooks) %>% 
  # Calculate cpue by stat area
  group_by(year, Stat, hook_accounting) %>% 
  mutate(stat_cpue = sum(n) / sum(set_hooks)) 
#mutate(stat_cpue = mean(set_cpue))
`
jysullivan commented 4 years ago

@ben-williams yes, agreed.

I'm also a little confused about my annual mean results for non-sablefish species. I'm guessing the mean is getting dragged to zero but I'm not confident about that and think for these a "presence only" cpue for the annual mean might be more interesting but haven't figured out how to code that.

image