forked from bbecker1000/eSeal_Silas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectNotes
65 lines (49 loc) · 3.84 KB
/
ProjectNotes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Next steps for eSeal Data Analysis
1. Plot Data through time for each age class and for each site. ALSO plot total for all sites.
2. For COWS, use the largest count of the year and correct for count (date adjusted) using the data in appendix of Condit et al 2021.
3. For all other age classes, just use largest count of year.
## New 2021-06-01
1. EPUP should be grouped with PUP.
2. please make the plots as we discussed, but we will likely only do statistical analysis on:
- COWS
- PUPS combined with WEANERS on the same day for a maximum annual count.
3. Note that YEAR is tricky since the surveys often start in december of the previous year and continue through the winter of the current year.
4. So surveys from December should be included with JAN, FEB, MARCH, APRIL, etc. of the current year.
## 2021-06-09
Silas has coded plotting functions.
Next steps:
1. Think about population trend analyses for the tree sites and population as whole.
A. FIRST BASIC
i. Simple linear regression on log(counts) for cows and pups/weaners at the three sites and as a whole.
ii. Could also do generalized linear model with counts as poisson distributed.
B. THEN ADVANCED
i. Use either the ATSAR package or the MARSS package to build multivariate state-space models of the three sites to get population trajectories
ii. ATSAR: https://nwfsc-timeseries.github.io/atsa-labs/
chapters 7, 8, 13,
## 2021-06-24
1. Silas and Sarah Codde have worked out most issues with counts
2. Create plots that are well laid out
3. TRENDS Focus on Cows and can also do pups.
A. FIRST BASIC for exploratory analyses. Silas - We may not use these as final models so don't try to get perfect results/code,
just run to see what we get and to get familiar with the approaches and building the models.
I anticipate just spending ~1 week on this and then we'll move foward with the ADVANCED techniques (MARSS and ATSAR) I mentioned above
i. Simple linear regression on log(counts) for cows and pups/weaners at the three sites and as a whole.
a. use the lm function in R to build linear models for each. Year is independent variable, mean counts are dependent variable.
b. I suspect these models will not fit well.
ii. Could also do generalized linear mixed-model with counts as poisson (?) distributed
a. same as above but use the package 'lme4' to build models that look like this:
b. m.glmer <- glmer(Count ~ Year + (1|Site), family = poisson, data = DATA) ## this dataset shouldhave the three sites in it and allows different intercepts for sites.
c. m.glm <- glm(Count ~ Year, family = poisson, data = DATA) # also run on the entire population without variance for site.
iii. Generalized additive mixed models (NEW)
a. use the package 'gamm4' if you have trouble getting to run, also try 'mgcv' package.
b. I think the model will be something like this:
m.gamm <- gamm(Count ~ Year, random =~(1|Site), family = poisson, data = DATA)
c. can also try without breaking into sites on whole population:
m.gam <- gam(gamm(Count ~ Year, family = poisson, data = DATA)
Some general thoughts.
- If the poisson distributions are problematic, you can try 'negative.binomial(1)',
or even logging the count data and running as a normal model.
- look at the package information for examples on running models
- in R can type '?function.name' to get help/examples. also look for vignettes online which are helpful
- this is just for pups+weaners and cows.
- Again, this is just a preliminary look, so don't get stuck on dead ends.