Skip to content

Commit

Permalink
updates to case study 2
Browse files Browse the repository at this point in the history
  • Loading branch information
doserjef committed Aug 1, 2023
1 parent 7ccbc7d commit 6c7660b
Show file tree
Hide file tree
Showing 12 changed files with 59,599 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ str(data.list)
# (6): week.cov: indicator for week of sampling.
# (7): site.cov: site id.
# (8): county.cov: county id.
# (9): survey.cov: the total number of surveys performed for the
# given combination of year, week, spatial location. Note
# this is actually equal to number of surveys - 1, such
# that a value of 0 corresponds to surveys with one
# survey (aka the intercept is expected count for one survey).
# (9): survey.cov: the log of the total number of surveys performed for the
# given combination of year, week, spatial location.
# Note that the object on GitHub has an identical format, except there is
# no column for oh.ind (since the Ohio data is not included).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ data.df <- data.frame(counts = c(t(data.list$y)),
covs.df)
data.df %>%
group_by(sp, data.set) %>%
summarize(average = mean(counts, na.rm = TRUE)) %>%
summarize(average = mean(counts, na.rm = TRUE),
sd = sd(counts, na.rm = TRUE)) %>%
arrange(sp, data.set) %>%
print(n = nrow(.))

Expand Down
7 changes: 2 additions & 5 deletions case-study-2-butterfly/code/stan-code/main-stan.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ str(data.list)
# (6): week.cov: indicator for week of sampling.
# (7): site.cov: site id.
# (8): county.cov: county id.
# (9): survey.cov: the total number of surveys performed for the
# given combination of year, week, spatial location. Note
# this is actually equal to number of surveys - 1, such
# that a value of 0 corresponds to surveys with one
# survey (aka the intercept is expected count for one survey).
# (9): survey.cov: the log of the total number of surveys performed for the
# given combination of year, week, spatial location.

# Format data in list for stan --------------------------------------------
sp.names <- dimnames(data.list$y)[[1]]
Expand Down
3 changes: 2 additions & 1 deletion case-study-2-butterfly/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Contains some of the data used for the butterfly case study. Note this directory

1. `BflyNames.csv`: contains information on butterfly common names, latin names, and codes.
2. `DayWeek.csv`: contains information for linking different days of the year to specific weeks of the year.
3. `spAbundance-data-github.csv`: contains the butterfly counts and covariate data for three of the five data sources used in the analysis: Illinois Butterfly Monitoring Network, Iowa Butterfly Survey Network, and Michigan Butterfly Network. These data are formatted for use when fitting the model in `spAbundance`.
3. `spAbundance-data-github.rda`: contains the butterfly counts and covariate data for three of the five data sources used in the analysis: Illinois Butterfly Monitoring Network, Iowa Butterfly Survey Network, and Michigan Butterfly Network. These data are formatted for use when fitting the model in `spAbundance`.
4. `butterfly-data-github.csv`: contains the same data as `spAbundance-data-github.rda`, but in CSV format.
59,591 changes: 59,591 additions & 0 deletions case-study-2-butterfly/data/butterfly-data-github.csv

Large diffs are not rendered by default.

Binary file modified case-study-2-butterfly/data/spAbundance-data-github.rda
Binary file not shown.
Binary file modified case-study-2-butterfly/results/beta-comm-samples-1-chain.rda
Binary file not shown.
Binary file modified case-study-2-butterfly/results/beta-comm-samples-2-chain.rda
Binary file not shown.
Binary file modified case-study-2-butterfly/results/beta-comm-samples-3-chain.rda
Binary file not shown.
Binary file modified case-study-2-butterfly/results/beta-samples-1-chain.rda
Binary file not shown.
Binary file modified case-study-2-butterfly/results/beta-samples-2-chain.rda
Binary file not shown.
Binary file modified case-study-2-butterfly/results/beta-samples-3-chain.rda
Binary file not shown.

0 comments on commit 6c7660b

Please sign in to comment.