I have GPS collar data on a species of gazelle throughout different seasons and want to model the effect of seasonal climatic changes on their movement patterns (e.g. daily distance moved, and monthly home range sizes) using the lme4 package in R.
There are different amounts of data for each individual as some of them died early. For example, one individual could have data for 90 days whereas another has data for 450 days. Range = 11 – 459 days. The collars take a GPS fix every hour, so for every day there are max 24 locations, but sometime the collar can malfunction and there could be a few missing. I also have temperature data from the collars for each GPS location and time.
(1) If I calculate the average temperature for the day and the average distance moved for the day for each individual, how can I model the effect of average temperature on the daily movement patterns of the animals using a mixed effects model in lme4?
Example (fake) data would look like this:
#DAILY MOVEMENT EXAMPLE
move <- structure(list(ID = c("A", "B", "C", "D", "E", "F", "G", "H",
"I", "J"), `01.01.2000` = c(1L, 2L, 1L, 3L, 2L, 1L, 4L, 1L, 2L,
2L), `02.01.2000` = c(2L, 3L, 2L, 1L, 4L, 3L, 2L, 3L, 4L, 5L),
`03.01.2000` = c(2L, 3L, 3L, 2L, 3L, 3L, 5L, 1L, 5L, 5L),
`04.01.2000` = c(3L, 4L, 3L, 3L, 4L, 4L, 4L, 3L, 2L, 5L),
`05.01.2000` = c(5L, 4L, 6L, 4L, 5L, 4L, 6L, 5L, 6L, 4L),
`06.01.2000` = c(7L, 5L, 7L, 6L, 5L, 7L, 6L, 5L, 7L, 5L),
`07.01.2000` = c(8L, 6L, 7L, 6L, 9L, 7L, 6L, 7L, 6L, 8L),
`08.01.2000` = c(9L, 8L, 7L, 9L, 9L, 7L, 8L, 9L, 7L, 9L),
`09.01.2000` = c(10L, 11L, 14L, 13L, 12L, 10L, 13L, 15L,
13L, 16L), `10.01.2000` = c(12L, 10L, 14L, 12L, 15L, 13L,
12L, 16L, 15L, 15L), `11.01.2000` = c(11L, 12L, 13L, 15L,
14L, 16L, 14L, 12L, 14L, 10L), `12.01.2000` = c(9L, 8L, 7L,
9L, 9L, 7L, 8L, 9L, 7L, 9L), `13.01.2000` = c(8L, 6L, 7L,
6L, 9L, 7L, 6L, 7L, 6L, 8L), `14.01.2000` = c(7L, 5L, 7L,
6L, 5L, 7L, 6L, 5L, 7L, 5L), `15.01.2000` = c(5L, 4L, 6L,
4L, 5L, 4L, 6L, 5L, 6L, 4L), `16.01.2000` = c(3L, 4L, 3L,
3L, 4L, 4L, 4L, 3L, 2L, 5L), `17.01.2000` = c(2L, 3L, 3L,
2L, 3L, 3L, 5L, 1L, 5L, 5L), `18.01.2000` = c(2L, 3L, 2L,
1L, 4L, 3L, 2L, 3L, 4L, 2L), `19.01.2000` = c(1L, 2L, 1L,
3L, 2L, 1L, 4L, 1L, 2L, 2L), `20.01.2000` = c(2L, 1L, 2L,
1L, 1L, 3L, 1L, 2L, 1L, 1L)), class = "data.frame", row.names = c(NA,
-10L))
#DAILY TEMP EXAMPLE
temp <- structure(list(ID = c("A", "B", "C", "D", "E", "F", "G", "H",
"I", "J"), `01.01.2000` = c(46L, 47L, 46L, 48L, 47L, 46L, 49L,
46L, 47L, 47L), `02.01.2000` = c(42L, 43L, 42L, 41L, 44L, 43L,
42L, 43L, 44L, 45L), `03.01.2000` = c(44L, 45L, 45L, 44L, 45L,
45L, 47L, 43L, 47L, 47L), `04.01.2000` = c(41L, 42L, 41L, 41L,
42L, 42L, 42L, 41L, 40L, 43L), `05.01.2000` = c(42L, 41L, 43L,
41L, 42L, 41L, 43L, 42L, 43L, 41L), `06.01.2000` = c(37L, 35L,
37L, 36L, 35L, 37L, 36L, 35L, 37L, 35L), `07.01.2000` = c(33L,
31L, 32L, 31L, 34L, 32L, 31L, 32L, 31L, 33L), `08.01.2000` = c(33L,
32L, 31L, 33L, 33L, 31L, 32L, 33L, 31L, 33L), `09.01.2000` = c(31L,
32L, 35L, 34L, 33L, 31L, 34L, 36L, 34L, 37L), `10.01.2000` = c(30L,
28L, 32L, 30L, 33L, 31L, 30L, 34L, 33L, 33L), `11.01.2000` = c(28L,
29L, 30L, 32L, 31L, 33L, 31L, 29L, 31L, 27L), `12.01.2000` = c(33L,
32L, 31L, 33L, 33L, 31L, 32L, 33L, 31L, 33L), `13.01.2000` = c(33L,
31L, 32L, 31L, 34L, 32L, 31L, 32L, 31L, 33L), `14.01.2000` = c(35L,
33L, 35L, 34L, 33L, 35L, 34L, 33L, 35L, 33L), `15.01.2000` = c(35L,
34L, 36L, 34L, 35L, 34L, 36L, 35L, 36L, 34L), `16.01.2000` = c(35L,
36L, 35L, 35L, 36L, 36L, 36L, 35L, 34L, 37L), `17.01.2000` = c(35L,
36L, 36L, 35L, 36L, 36L, 38L, 34L, 38L, 38L), `18.01.2000` = c(40L,
41L, 40L, 39L, 42L, 41L, 40L, 41L, 42L, 40L), `19.01.2000` = c(41L,
42L, 41L, 43L, 42L, 41L, 44L, 41L, 42L, 42L), `20.01.2000` = c(44L,
43L, 44L, 43L, 43L, 45L, 43L, 44L, 43L, 43L)), class = "data.frame", row.names = c(NA,
-10L))
(2) If I calculate the home range size for each season (here only winter and summer), how can I calculate the effect of season on the home range size using a mixed effects model in lme4?
hre <- structure(list(ID = c("A", "A", "A", "B", "B", "C", "C", "C",
"D", "D", "D", "E", "F", "F", "G", "H", "I", "I", "I", "J"),
Season = c("Summer23", "Winter23", "Summer24", "Summer23",
"Winter23", "Summer23", "Winter23", "Summer24", "Summer23",
"Winter23", "Summer24", "Summer23", "Summer23", "Winter23",
"Summer24", "Summer24", "Summer23", "Winter23", "Summer24",
"Summer24"), Home.Range.Estimate = c(400L, 300L, 600L, 350L,
200L, 450L, 250L, 550L, 600L, 200L, 500L, 550L, 450L, 250L,
650L, 500L, 500L, 100L, 750L, 550L)), class = "data.frame", row.names = c(NA,
-20L))