Rotation Direction (Tracking)

Detector Change

m.RotationDirection.DetectorChange.data <- m.RotationDirection.tracking.data
m.RotationDirection.DetectorChange.formula <- brmsformula(
  IsRotationDifferent ~ IsDetectorChangeImporved * SignalingType * ResourceSpeed + (1 | Participant),
  family = bernoulli()
  )

m.RotationDirection.DetectorChange.formula_comparison <- brmsformula(
  IsRotationDifferent ~ IsDetectorChangeImporved * SignalingType * ResourceSpeed
  )

m.RotationDirection.DetectorChange.priors <-
  prior(normal(0, 1), class = "Intercept") +
  prior(normal(0, 0.5), class = b) +
  prior(normal(0, 0.1), class = 'sd')

Model fitting

m.RotationDirection.DetectorChange.fit <- brm(
  formula = m.RotationDirection.DetectorChange.formula,
  data    = m.RotationDirection.DetectorChange.data,
  prior   = m.RotationDirection.DetectorChange.priors,
  chains  = 4,
  cores   = 4,
  seed    = 42,
  warmup = 500,
  iter    = 2000,
  file = paste0(fits_path, 'rotation_dir_detector_change_1.rds'),
  backend = "cmdstanr",
  threads = threading(100),
  control = list(adapt_delta = 0.95),
  save_pars = save_pars(all = TRUE)
  )

Model diagnostics

##  Family: bernoulli 
##   Links: mu = logit 
## Formula: IsRotationDifferent ~ IsDetectorChangeImporved * SignalingType * ResourceSpeed + (1 | Participant) 
##    Data: m.RotationDirection.DetectorChange.data (Number of observations: 208861) 
##   Draws: 4 chains, each with iter = 2000; warmup = 500; thin = 1;
##          total post-warmup draws = 6000
## 
## Multilevel Hyperparameters:
## ~Participant (Number of levels: 620) 
##               Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(Intercept)     0.26      0.01     0.24     0.28 1.00     1658     3150
## 
## Regression Coefficients:
##                                                             Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept                                                      -0.28      0.04    -0.36    -0.20 1.00     1227     2458
## IsDetectorChangeImporved1                                      -0.80      0.04    -0.88    -0.72 1.00     1465     2737
## SignalingTypeNP                                                 0.08      0.06    -0.05     0.20 1.00     1435     2836
## SignalingTypeVP                                                 0.08      0.06    -0.03     0.20 1.00     1455     3134
## SignalingTypeFP                                                 0.05      0.06    -0.06     0.16 1.00     1221     2329
## ResourceSpeedslow                                              -0.26      0.06    -0.37    -0.15 1.00     1024     1704
## IsDetectorChangeImporved1:SignalingTypeNP                      -0.01      0.06    -0.12     0.11 1.00     1892     3355
## IsDetectorChangeImporved1:SignalingTypeVP                       0.22      0.06     0.11     0.33 1.00     1886     3127
## IsDetectorChangeImporved1:SignalingTypeFP                       0.42      0.05     0.32     0.52 1.00     1720     3144
## IsDetectorChangeImporved1:ResourceSpeedslow                    -0.16      0.05    -0.25    -0.06 1.00     1345     2815
## SignalingTypeNP:ResourceSpeedslow                               0.00      0.08    -0.15     0.16 1.00     1267     2417
## SignalingTypeVP:ResourceSpeedslow                               0.13      0.08    -0.02     0.27 1.00     1101     2130
## SignalingTypeFP:ResourceSpeedslow                               0.03      0.07    -0.11     0.18 1.00     1066     1805
## IsDetectorChangeImporved1:SignalingTypeNP:ResourceSpeedslow     0.28      0.07     0.14     0.41 1.00     1739     3635
## IsDetectorChangeImporved1:SignalingTypeVP:ResourceSpeedslow     0.21      0.07     0.08     0.34 1.00     1698     3227
## IsDetectorChangeImporved1:SignalingTypeFP:ResourceSpeedslow     0.22      0.06     0.10     0.34 1.00     1612     3154
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Model predictions

Figure

fig_rotation_direction_detector_change <- m.RotationDirection.DetectorChange.draws %>%
  mutate(IsDetectorChangeImporved = ifelse(IsDetectorChangeImporved == 1, "Approaching Resource", "Moving Away from Resource")) %>% 
  ggplot(aes(x = SignalingType, 
             y = .epred, 
             color = SignalingType, 
             fill = SignalingType,
             shape = ResourceSpeed)) +
  ggdist::stat_pointinterval(
    position = position_dodge(width = .5),
    point_interval = "mean_hdci",
    .width = 0.9,
    point_size = 3.6,
    ) + 
  theme_nice(legend.pos = "right") +
  scale_color_manual(breaks = c('A', 'NP', 'VP', 'FP'),
                     aesthetics = c("colour", "fill"),
                     values = c("#000000", "#DF536B", "#61D04F", "#2297E6"), 
                     guide = guide_legend(title = "Payoff Condition")) +
  scale_shape_manual(values = c(21, 24), guide = guide_legend(title = "Resource")) +
  facet_grid(cols = vars(IsDetectorChangeImporved)) +
  theme_clean() +
  theme(legend.position = "bottom") +
  panel_border() +
  labs(y = "P(Rotation Direction Change)", x = "") # "Payoff Condition"

fig_rotation_direction_detector_change

Social Information

m.RotationDirection.SocInfoQual.data <- m.RotationDirection.tracking.data %>% 
  filter(SignalingType != 'A') %>%
  mutate(SignalingType = factor(SignalingType, levels = c('NP', 'VP', 'FP'))) %>%
  filter(IsSocialInfo == "Yes") %>% 
  filter(!is.na(IsSocialInfoDirecionDifferent))
m.RotationDirection.SocInfoQual.formula <- brmsformula(
  IsRotationDifferent ~ SignalingType * ResourceSpeed * IsSocialInfoDirecionDifferent * SocInfoQuality + (1 | Participant),
  family = bernoulli()
  )

m.RotationDirection.SocInfoQual.formula_comparison <- brmsformula(
  IsRotationDifferent ~ SignalingType * ResourceSpeed * IsSocialInfoDirecionDifferent * SocInfoQuality
  )

m.RotationDirection.SocInfoQual.priors <-
  prior(normal(0, 1), class = "Intercept") +
  prior(normal(0, 0.5), class = b) +
  prior(normal(0, 0.1), class = 'sd')

Model fitting

m.RotationDirection.SocInfoQual.fit <- brm(
  formula = m.RotationDirection.SocInfoQual.formula,
  data    = m.RotationDirection.SocInfoQual.data,
  prior   = m.RotationDirection.SocInfoQual.priors,
  chains  = 4,
  cores   = 4,
  seed    = 42,
  warmup = 500,
  iter    = 2000,
  file = paste0(fits_path, 'rotation_dir_soc_info_quality_1.rds'),
  backend = "cmdstanr",
  threads = threading(100),
  control = list(adapt_delta = 0.95),
  save_pars = save_pars(all = TRUE)
  )

Model diagnostics

##  Family: bernoulli 
##   Links: mu = logit 
## Formula: IsRotationDifferent ~ SignalingType * ResourceSpeed * IsSocialInfoDirecionDifferent * SocInfoQuality + (1 | Participant) 
##    Data: m.RotationDirection.SocInfoQual.data (Number of observations: 97954) 
##   Draws: 4 chains, each with iter = 2000; warmup = 500; thin = 1;
##          total post-warmup draws = 6000
## 
## Multilevel Hyperparameters:
## ~Participant (Number of levels: 475) 
##               Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## sd(Intercept)     0.25      0.01     0.22     0.27 1.00     2173     3634
## 
## Regression Coefficients:
##                                                                                  Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
## Intercept                                                                           -0.29      0.05    -0.40    -0.19 1.00     1735     2993
## SignalingTypeVP                                                                     -0.01      0.07    -0.15     0.14 1.00     1467     2507
## SignalingTypeFP                                                                      0.28      0.07     0.14     0.42 1.00     1623     2453
## ResourceSpeedslow                                                                   -0.09      0.07    -0.22     0.04 1.00     1520     2632
## IsSocialInfoDirecionDifferent1                                                      -0.44      0.06    -0.56    -0.32 1.00     1640     2640
## SocInfoQuality1                                                                     -0.15      0.08    -0.30     0.00 1.00     1177     1925
## SignalingTypeVP:ResourceSpeedslow                                                    0.27      0.09     0.09     0.45 1.00     1335     2862
## SignalingTypeFP:ResourceSpeedslow                                                   -0.04      0.09    -0.21     0.13 1.00     1439     2575
## SignalingTypeVP:IsSocialInfoDirecionDifferent1                                       0.14      0.08    -0.02     0.31 1.00     1568     3168
## SignalingTypeFP:IsSocialInfoDirecionDifferent1                                      -0.15      0.08    -0.30     0.01 1.00     1818     2830
## ResourceSpeedslow:IsSocialInfoDirecionDifferent1                                    -0.23      0.07    -0.37    -0.09 1.00     1458     2600
## SignalingTypeVP:SocInfoQuality1                                                      0.29      0.10     0.09     0.50 1.00     1353     2735
## SignalingTypeFP:SocInfoQuality1                                                      0.37      0.09     0.19     0.55 1.00     1253     1927
## ResourceSpeedslow:SocInfoQuality1                                                    0.13      0.09    -0.04     0.30 1.00     1155     1717
## IsSocialInfoDirecionDifferent1:SocInfoQuality1                                      -0.45      0.11    -0.66    -0.23 1.00     1305     2482
## SignalingTypeVP:ResourceSpeedslow:IsSocialInfoDirecionDifferent1                    -0.18      0.10    -0.37     0.02 1.00     1499     3332
## SignalingTypeFP:ResourceSpeedslow:IsSocialInfoDirecionDifferent1                     0.05      0.09    -0.13     0.24 1.00     1696     2674
## SignalingTypeVP:ResourceSpeedslow:SocInfoQuality1                                   -0.22      0.11    -0.44    -0.00 1.00     1309     2174
## SignalingTypeFP:ResourceSpeedslow:SocInfoQuality1                                   -0.03      0.10    -0.23     0.17 1.00     1220     1818
## SignalingTypeVP:IsSocialInfoDirecionDifferent1:SocInfoQuality1                      -0.16      0.14    -0.44     0.12 1.00     1605     3128
## SignalingTypeFP:IsSocialInfoDirecionDifferent1:SocInfoQuality1                      -0.26      0.13    -0.51    -0.00 1.00     1349     2427
## ResourceSpeedslow:IsSocialInfoDirecionDifferent1:SocInfoQuality1                    -0.28      0.12    -0.52    -0.04 1.00     1360     2542
## SignalingTypeVP:ResourceSpeedslow:IsSocialInfoDirecionDifferent1:SocInfoQuality1     0.25      0.16    -0.06     0.56 1.00     1534     3094
## SignalingTypeFP:ResourceSpeedslow:IsSocialInfoDirecionDifferent1:SocInfoQuality1     0.08      0.14    -0.21     0.36 1.01     1342     2296
## 
## Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
## and Tail_ESS are effective sample size measures, and Rhat is the potential
## scale reduction factor on split chains (at convergence, Rhat = 1).

Model predictions

Figure

fig_rotation_direction_soc_info_quality <- m.RotationDirection.SocInfoQual.draws %>%
  mutate(IsSocialInfoDirecionDifferent = case_when(
    IsSocialInfoDirecionDifferent == 1 ~ "SI is aligned with rotation", 
    IsSocialInfoDirecionDifferent == 0 ~ "SI is not aligned with rotation"
    )) %>%
  mutate(SocInfoQualityCat = case_when(
    SocInfoQuality == -1 ~ "SI Bad",
    SocInfoQuality == 1 ~ "SI Good",
  )) %>% 
  ggplot(aes(x = SignalingType, 
             y = .epred, 
             color = SignalingType, 
             fill = SignalingType,
             shape = SocInfoQualityCat)) +
  ggdist::stat_pointinterval(
    position = position_dodge(width = .5),
    point_interval = "mean_hdci",
    .width = 0.9,
    point_size = 3.6,
    ) + 
  theme_nice(legend.pos = "right") +
  scale_color_manual(breaks = c('A', 'NP', 'VP', 'FP'),
                     aesthetics = c("colour", "fill"),
                     values = c("#000000", "#DF536B", "#61D04F", "#2297E6"), 
                     guide = guide_legend(title = "Payoff Condition")) +
  # scale_shape_manual(values = c(21, 24), guide = guide_legend(title = "Resource")) +
  scale_shape_manual(values = c(22, 23), guide = guide_legend(title = "SI Quality")) +
  facet_grid(cols = vars(IsSocialInfoDirecionDifferent), rows = vars(ResourceSpeed)) +
  theme_clean() +
  theme(legend.position = "bottom") +
  panel_border() +
  labs(y = "P(Rotation Direction Change)", x = "") # "Payoff Condition"

fig_rotation_direction_soc_info_quality