2

I want to check the results of my lme-model for temporal autocorrelation. The data can be downloaded here (password: Variogram_2023). It contains the sampling date, group and extracted residuals from the model (E1). These residuals derived from an irregularly spaced time series, where there are multiple observations from the same sampling date.

I tried to test for temporal autocorrelation using gstat::variogram, where sampling date is first converted to julian date and then used as the x-coordinate, while the y-coordinate is the mean residual value. I have repeated this by group.

I'm not really sure how to interpret these results, or whether I've done this correctly, so any suggestions about how to go about this will be much appreciated.

df_vario <- df %>%  
  mutate(jday = julian(.$date, origin = min(.$date)) + 1,
         jday = as.numeric(jday)) %>% 
  select(E1, jday, group) %>% 
  group_by(age_class) %>% 
  mutate(ones = mean(E1))

sp::coordinates(df_vario) <- c("jday", "ones")

v1 <- gstat::variogram(E1 ~ jday + ones,
                       data = df_vario[df_vario$group == "r1",]) %>% 
                       mutate(group = "r1")
v2 <- gstat::variogram(E1 ~ jday + ones,
                       data = df_vario[df_vario$group == "r2",]) %>% 
                       mutate(group = "r2")
v3 <- gstat::variogram(E1 ~ jday + ones,
                       data = df_vario[df_vario$group == "r3",]) %>% 
                       mutate(group = "r3")
mrg <- rbind(v1, v2, v3)

mrg %>% 
  ggplot() +
    geom_point(aes(x = dist, y = gamma)) +
    geom_smooth(aes(x = dist, y = gamma),
                se = FALSE,
                method = "loess") +
    facet_wrap(~group, scales = "free_y") +
    labs(x = "Julian Day", y = "Semi-variogram")

ariogram

M.Teich
  • 575
  • 5
  • 22
  • 2
    Questions about interpretation of statistical output should be posed to Cross Validated, not Stack Overflow. You have not asked a specific programming question, so you may not get useful answers here. – Mikael Jagan Apr 03 '23 at 18:37
  • @MikaelJagan Good point, but I assume there is no easy way to migrate the question to Cross Validated? – M.Teich Apr 05 '23 at 12:27
  • I'm not sure. Normal users can only vote to close and migrate outside of the bounty period. – Mikael Jagan Apr 05 '23 at 16:03

0 Answers0