Plotting conditional effects from a fitted brms ordinal probit model: two categorical predictors

Hi all,

I'm running Rstudio on a macOS Sonoma 14.5, R version 4.4.1 (2024-06-14), rstudio 2024.04.2+764 Chocolate Cosmos (desktop).

I came across a brilliant alternative way to visualise ordinal data proposed by Brice Beffara in Towards Data Science (Testing an alternative visualisation of ordinal data and regression in R | by Brice Beffara | Towards Data Science) which I am trying to replicate using the output of a fitted model with two categorical predictors (5 and 3 levels). The outcome is a 7 point Likert scale (the example has 4 points).

I'm having a hard time manipulating the "xend" part in his secondary axes. Would anyone have an alternative solution than to setting the coordinates by hand?

This is the first part of the code which plots the raw data
plot_S <-
ggplot(rdatLong, aes(
x = factor(T, level = level_order),
y = Y,
fill = S
)) +
geom_point(
data = rdatLong,
aes(
x = factor(T, level = level_order),
y = Y,
colour = T,
fill = S
),
position = position_jitterdodge(
jitter.width = .08,
jitter.height = 0.16,
dodge.width = .2
),
size = 2,
alpha = .2,
shape = 20,
inherit.aes = FALSE
)

It works fine.

Then comes

Prepare secondary axes

plot_S <- plot_S + geom_segment(
data = conditional_merged,
aes(
x = T,
xend = c(
1.95,
2.95,
0.95,
1.95,
2.95,
0.95,
1.95,
2.95,
0.95,
1.95,
2.95,
0.95,
2.05,
3.05,
1.05,
2.05,
3.05,
1.05,
2.05,
3.05,
1.05,
2.05,
3.05,
1.05
),
y = as.numeric(effect2__) + 0.2,
yend = as.numeric(effect2__) + 0.5,
linetype = "1"
),
color = "gray20",
size = 0.3,
position = position_dodge(width = .2),
lineend = "round",
show.legend = FALSE
)

I've tried adding values so that you have 7 points per interval (i.e. 1,95 - 2.95 - 0.95 and so on) instead of 4 but it doesn't work and returns
"Warning message:
In geom_segment(data = conditional_merged, aes(x = T, xend = c(1.95, :
Ignoring unknown aesthetics: position, lineend, and show.legend"

Any ideas?

Hi @OlDan ,

Could you post both your data and your in code blocks? For the data, you could follow these steps:

  1. Run dput(rdatLong).
  2. Copy the corresponding output from the console.
  3. Start a reply here.
  4. Once on a new line in the reply, click the </> in the editor menu .
  5. Paste the output where it says "type or paste code here".

The result is called a code block, and to share the code, first make sure it's indented correctly in RStudio, and then paste as a code block.

Hi,

#dput(rdatLong)

structure(list(T = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2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1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), levels = c("F", "M"), class = "factor"), 
    Ind = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 
    13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 
    25L, 26L, 27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 
    8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 
    20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 1L, 
    2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
    11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 
    23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 
    6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 
    19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
    11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 
    23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 
    6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 
    19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
    11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 
    23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L), S = structure(c(1L, 
    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 4L, 6L, 1L, 7L, 1L, 1L, 7L, 3L, 4L, 1L, 
    1L, 2L, 6L, 4L, 6L, 6L, 2L, 6L, 4L, 2L, 2L, 2L, 1L, 7L, 6L, 
    5L, 7L, 1L, 7L, 5L, 5L, 4L, 6L, 1L, 7L, 6L, 2L, 3L, 5L, 4L, 
    2L, 4L, 5L, 5L, 6L, 7L, 3L, 4L, 6L, 2L, 4L, 5L, 3L, 6L, 1L, 
    2L, 1L, 4L, 2L, 3L, 1L, 2L, 5L, 2L, 2L, 7L, 1L, 1L, 6L, 1L, 
    1L, 5L, 2L, 7L, 2L, 4L, 1L, 3L, 3L, 6L, 7L, 1L, 5L, 3L, 6L, 
    4L, 1L, 1L, 1L, 2L, 2L, 2L, 7L, 3L, 1L, 4L, 1L, 6L, 1L, 2L, 
    2L, 5L, 4L, 3L, 1L, 1L, 1L, 4L, 3L, 1L, 7L, 3L, 4L)), row.names = c(NA, 
-300L), class = "data.frame")

#The model

fit_cuML <- brm(
  formula = Y ~ 1 + S + T + T:S + (1 | Ind) + (1 | Item), 
  data = rdatLong, 
  family = cumulative("probit"),
  prior = prior(exponential(1) , class = sd),
  cores = 8,
  seed = 5476,
  init_r = 0.2,
  control = list(adapt_delta = .99),
  file = 'fitCuML'
)

Would this be what you are asking for?

Thank you, @OlDan , I meant the data and the ggplot() code you posted above, but this is already helpful. I'll have to come back, but maybe the meantime someone else may be able to help.

Here's the ggplot() code you posted above:

plot_S <-
  ggplot(
    rdatLong, 
    aes(
      x = factor(T, level = level_order),
      y = Y,
      fill = S
    )
  ) +
  geom_point(
    data = rdatLong,
    aes(
      x = factor(T, level = level_order),
      y = Y,
      colour = T,
      fill = S
    ),
    position = position_jitterdodge(
      jitter.width = .08,
      jitter.height = 0.16,
      dodge.width = .2
    ),
    size = 2,
    alpha = .2,
    shape = 20,
    inherit.aes = FALSE
  )
plot_S <- plot_S + geom_segment(
  data = conditional_merged,
  aes(
    x = T,
    xend = c(
      1.95,      2.95,      0.95,      1.95,
      2.95,      0.95,      1.95,      2.95,
      0.95,      1.95,      2.95,      0.95,
      2.05,      3.05,      1.05,      2.05,
      3.05,      1.05,      2.05,      3.05,
      1.05,      2.05,      3.05,      1.05
    ),
    y = as.numeric(effect2__) + 0.2,
    yend = as.numeric(effect2__) + 0.5,
    linetype = "1"
  ),
  color = "gray20",
  size = 0.3,
  position = position_dodge(width = .2),
  lineend = "round",
  show.legend = FALSE
)

Sorry about the misunderstanding and thanks in advance for your patience.

The rest of the code follows from the article I mentioned above, here is my humble attempt to replicate monsieur Beffara's brilliant visualisation.

#### Plot estimates and CI ####
plot_State <- plot_State + geom_segment(
  data = conditional_merged,
  aes(
    x = T,
    xend = c(
      1.95,  #1
      2.95,
      0.95,
      1.95,  #2
      2.95,
      0.95,
      1.95,  #3
      2.95,
      0.95,
      1.95,  #4
      2.95,
      0.95,
      1.95,  #5
      2.95,
      0.95,
      1.95,  #6
      2.95,
      0.95,
      1.95,  #7
      2.95,  
      0.95,
      2.05,  #1
      3.05,
      1.05,
      2.05,  #2
      3.05,
      1.05,
      2.05,  #3
      3.05,
      1.05,
      2.05,  #4
      3.05,
      1.05,
      2.05,  #5
      3.05,
      1.05,
      2.05,  #6
      3.05,
      1.05,
      2.05,  #7
      3.05,
      1.05
    ),
    colour = S,
    y = as.numeric(effect2__) + 0.2 + lower__ * 0.3,
    yend = as.numeric(effect2__) + 0.2 + upper__ * 0.3,
    linetype = "1"
  ),
  size = 2,
  position = position_dodge(width = .2),
  lineend = "round",
  show.legend = FALSE
) + geom_point(
  data = conditional_merged,
  aes(
    x = T,
    y =  as.numeric(effect2__) + 0.2 + estimate__ * 0.3,
    colour = S,
  ),
  size = 4,
  position = position_dodge(width = .2),
  show.legend = FALSE
)

#### Dashed lines ####
plot_State <- plot_State + geom_line(
  data = overall_sum,
  aes(
    x = factor(T, level = level_order),
    y = overall_resp,
    group = S,
    colour = S
  ),
  linetype = 3,
  size = 0.5
)

#Customisation
plot_S <- plot_S +
  scale_colour_brewer(palette = "Dark2",
                      name = "S") +
  scale_fill_brewer(palette = "Dark2",
                    name = "S") +
  theme_minimal() +
  scale_x_discrete(name = "T") +
  scale_y_continuous(name = "Y",) +
  theme_ipsum_rc(
    base_size = 25,
    subtitle_size = 25,
    axis_title_size = 30
  ) +
  guides(colour = guide_legend(override.aes = list(shape = 15, size = 7))) +
  scale_alpha_continuous(range = c(0.2, 1)) +
  theme(text = element_text(size = 30))

Any help is much appreciated.

Best,

Dan

Sorry, @OlDan : This the table whose dput() output I should have asked you to post, this that's what's going into to the ggplot() code — could you post that, too?

Thanks again for your help!

dput(conditional_merged)
structure(list(T = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 
3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 
1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 
3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 
1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 
3L), levels = c("Citizen", "Married", "Parental"), class = "factor"), 
    Y = c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5), S = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), levels = c("Sw", 
    "UK", "Ge", "Br", "Th"), class = "factor"), Ind = c(NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Item = c(NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 
    cond__ = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L), levels = c("Sw", "UK", "Ge", "Br", 
    "Th"), class = "factor"), cats__ = structure(c(1L, 1L, 1L, 
    2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 
    7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 
    5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 
    3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 
    1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 
    6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 
    4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L), levels = c("1", 
    "2", "3", "4", "5", "6", "7"), class = "factor"), effect1__ = structure(c(1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), levels = c("Citizen", 
    "Married", "Parental"), class = "factor"), effect2__ = structure(c(1L, 
    1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 
    6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 
    4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 
    2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 
    7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 
    5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 
    3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L), levels = c("1", 
    "2", "3", "4", "5", "6", "7"), class = "factor"), estimate__ = c(0.0110654992318489, 
    0.0155451930948465, 0.0143688283366143, 0.0231477479538397, 
    0.0298180090439486, 0.0286696159552191, 0.0280057378331549, 
    0.0346250061289056, 0.0335251419107379, 0.0682172232574559, 
    0.0807131245046543, 0.0780251387214389, 0.105513471142949, 
    0.117887647659516, 0.115221373226776, 0.404292450048423, 
    0.405430022340397, 0.406003178411718, 0.336534780571447, 
    0.289696237598041, 0.2990972503542, 0.0156808816091179, 0.00277328606502982, 
    0.0111592137174544, 0.0306463734233264, 0.00768341965794163, 
    0.0236643286551781, 0.0349025263478279, 0.0112023977531259, 
    0.0284558530277247, 0.0811053269302007, 0.0325326196000248, 
    0.0689519399282479, 0.11757474130441, 0.0613850173001845, 
    0.106508592995788, 0.405475228422769, 0.351683434497228, 
    0.402642310694309, 0.285180985591472, 0.524287753718591, 
    0.333911980800946, 0.00979796886054212, 0.00570130805082793, 
    0.00233072817324596, 0.0212314078244049, 0.0140549388779621, 
    0.0068232687875468, 0.0260880112021022, 0.0185094524322694, 
    0.0100929525231874, 0.0645134418043492, 0.0493396337561076, 
    0.0296237944376507, 0.103084251746014, 0.0841942418578971, 
    0.056836357329974, 0.401257052161464, 0.387309254414065, 
    0.341430989449393, 0.352592362470262, 0.423839949798206, 
    0.546001130772936, 0.0921010834152706, 0.178876225540506, 
    0.134522409582397, 0.102213816840051, 0.14267641542715, 0.124009914545333, 
    0.0863710535019469, 0.103737854837303, 0.0965534740013175, 
    0.146835410566114, 0.15384253402327, 0.153172651093373, 0.152069338306094, 
    0.139587182476441, 0.147928895991995, 0.307696735598537, 
    0.211281064084697, 0.257488213122604, 0.0810186048192243, 
    0.035817672342357, 0.0542293755924334, 0.329192344483761, 
    0.332069463778455, 0.223812219006906, 0.172615827409854, 
    0.172253025721409, 0.155901890875351, 0.106583717789106, 
    0.106011352168884, 0.106287267510947, 0.136970466296969, 
    0.136582322262654, 0.151874907778618, 0.102126013959185, 
    0.101018276448439, 0.128795745775057, 0.112174416292674, 
    0.110978083294732, 0.176756398086223, 0.0114895432323385, 
    0.0111524113662377, 0.0252449963964245), se__ = c(0.00982897434582293, 
    0.0136614340031164, 0.012336477178051, 0.0160943425008606, 
    0.0196053997485493, 0.0192223541331911, 0.017004902709182, 
    0.019443871640266, 0.018745683210574, 0.0320664226501304, 
    0.0346546645511961, 0.0336283836865701, 0.0352242421734997, 
    0.034998135588272, 0.0339024280833158, 0.0409907081564807, 
    0.0403614522957276, 0.041136640652593, 0.123311314754203, 
    0.116903742861806, 0.115602503270152, 0.0136721132494112, 
    0.0028655272673575, 0.0100807490561194, 0.020524348579282, 
    0.00672585523129708, 0.0168098737374559, 0.0194651336798764, 
    0.00847014629843682, 0.0173781650046282, 0.034626716654684, 
    0.0211490832592673, 0.0323391782503615, 0.0349178447069473, 
    0.0312894293854673, 0.0360706958453841, 0.0400334661506288, 
    0.0694317088203182, 0.0420220164603831, 0.114302491600598, 
    0.140285249807933, 0.127005622452064, 0.00868437336077789, 
    0.00540747625687178, 0.00240730705024832, 0.0150432155342528, 
    0.0110437214954306, 0.00605113346383297, 0.0161762264144541, 
    0.0124986631801403, 0.0080192900181911, 0.032266965262857, 
    0.0276786941554329, 0.0198561436499061, 0.0373449901271686, 
    0.0363564838170285, 0.0296313651833963, 0.0424064126612661, 
    0.0510141672870054, 0.0757728278337127, 0.127988603510765, 
    0.137310986612634, 0.143325079056937, 0.0562809590383617, 
    0.0873483834864042, 0.0755732219442349, 0.0423097017690029, 
    0.0423457846391073, 0.043329961860808, 0.0286275672274886, 
    0.0279595480626215, 0.0276822991151561, 0.0310914676736756, 
    0.0301224587153443, 0.0309297161545429, 0.028094214161304, 
    0.0318473203013194, 0.0294801714703064, 0.0806760232946475, 
    0.0807302763443041, 0.0873990950276758, 0.0520339834246294, 
    0.0260936269414261, 0.0385915279748072, 0.121909202778624, 
    0.124943566349674, 0.100647790989541, 0.038751146304892, 
    0.0393667448102692, 0.04144055924087, 0.0272409590545223, 
    0.0277419844888264, 0.026920744113271, 0.0330019462183535, 
    0.0341131118146589, 0.0302565480114382, 0.0353372676829492, 
    0.0369701490627691, 0.0338723723534759, 0.0591420740666044, 
    0.0603561527127758, 0.0785244039152127, 0.00984776641321559, 
    0.0096044912551709, 0.0201100566239427), lower__ = c(0.000913982741156934, 
    0.00146405430602157, 0.0013935445989323, 0.0031477417767424, 
    0.00473699676050253, 0.00419686862395037, 0.00548920065971852, 
    0.00720796663964236, 0.0068783468349181, 0.0179106360445487, 
    0.0240834525100028, 0.022124749184778, 0.0396127643182086, 
    0.0497284984466486, 0.0473144769498911, 0.270807695307911, 
    0.285851184908906, 0.28732356165151, 0.115661609153439, 0.086086016891724, 
    0.0942601011929971, 0.00159667412082705, 0.000159622023744514, 
    0.000914789965871641, 0.00488321882244597, 0.000755076987142175, 
    0.00312645267397237, 0.00768070908536947, 0.00140633513155234, 
    0.00525194736062064, 0.0242932558663215, 0.00618889077908613, 
    0.0185020898008606, 0.0486622539705306, 0.0163178796394723, 
    0.0382350720542917, 0.284102305695123, 0.172903247930255, 
    0.270756618090465, 0.0924559223001569, 0.248956640966172, 
    0.110353114508128, 0.00079890008211194, 0.000333645263577051, 
    0.000120131753906724, 0.00305123371132576, 0.00140499585264682, 
    0.000603860469152212, 0.00483578775423189, 0.00257939545694531, 
    0.00122028328442474, 0.0165348226424873, 0.00955437764794756, 
    0.00498283373734577, 0.0362024437944096, 0.0232660681386723, 
    0.0125718154503175, 0.267639126776708, 0.22025881139775, 
    0.159177066629826, 0.122785358506728, 0.171327072157765, 
    0.249032963329149, 0.0167112043578239, 0.0429861025946624, 
    0.0265094158659963, 0.0310796909445921, 0.0593457259192043, 
    0.0440125940141797, 0.0347750913287578, 0.0537215127519549, 
    0.0449275762602897, 0.0774575275980634, 0.0928641184397192, 
    0.0907373920115007, 0.0935880352311787, 0.0703095960148987, 
    0.0830623383565781, 0.132553296117509, 0.0626989533690681, 
    0.0941462357518712, 0.0145432382613072, 0.00428366448649126, 
    0.00799675422286008, 0.118720863378195, 0.111441375304363, 
    0.0626867750692461, 0.0981129594158345, 0.0924419764529949, 
    0.0742344161780983, 0.0563579380005086, 0.0552364335737838, 
    0.0586130374607474, 0.0637893832055842, 0.061272292562135, 
    0.0848045960632077, 0.0341860109421753, 0.0342047641484036, 
    0.0553508085606113, 0.0226750150757711, 0.0228549828766774, 
    0.047244089505723, 0.000893033306311348, 0.000903840240186069, 
    0.00292069154005023), upper__ = c(0.0686565627835526, 0.0867632305960958, 
    0.0840329775013701, 0.0892021123456843, 0.105114566997267, 
    0.0996508109797314, 0.0831486974186986, 0.0960108691963655, 
    0.0922601265940269, 0.14842176507417, 0.16139648903417, 0.156941815087189, 
    0.176524489845079, 0.184069722492062, 0.184027350084172, 
    0.474993859953592, 0.477952869229246, 0.476925033436006, 
    0.636008277055492, 0.580822458160666, 0.591237415858338, 
    0.0854701646981032, 0.0238676048508396, 0.0732506210294763, 
    0.100556056539663, 0.0413444151261656, 0.0928770102507483, 
    0.0932413328139755, 0.0469500997037422, 0.0838399138635992, 
    0.159931165970491, 0.101368568490458, 0.151559445011825, 
    0.190939525399452, 0.140245678054706, 0.183038190641973, 
    0.479527230084332, 0.453987895097446, 0.476931394073483, 
    0.581435212624706, 0.795617187386757, 0.637678777991919, 
    0.0599781160801926, 0.0402142162440088, 0.0223730030811905, 
    0.079211351132755, 0.0640868752098044, 0.0393601702199409, 
    0.0807602587460517, 0.0666192418522572, 0.0446778309201877, 
    0.144956790114658, 0.127648867751171, 0.0966740133596861, 
    0.177983247229119, 0.16293614423449, 0.136042417380295, 0.47549541352253, 
    0.469357381972033, 0.454052607522457, 0.644816920184542, 
    0.734100352507667, 0.820317518878862, 0.286363014723545, 
    0.444800678667629, 0.372026270639255, 0.196873501786698, 
    0.231439133866329, 0.217953802745165, 0.147578469981255, 
    0.16264035804399, 0.155566800212894, 0.211648718785116, 0.214696679929251, 
    0.216673176150547, 0.211023277905634, 0.202169220477045, 
    0.207207980995132, 0.440602559443335, 0.388380263577091, 
    0.415276858900119, 0.264786986039771, 0.149577054115932, 
    0.207276287794153, 0.636523371770171, 0.649398433713199, 
    0.508564158906448, 0.251907727232264, 0.25188996257815, 0.238392871419476, 
    0.167058994062156, 0.164624546164505, 0.166777275025444, 
    0.204671025827926, 0.203281336217566, 0.216492026826437, 
    0.176291741684375, 0.178887787222629, 0.196212767753464, 
    0.286919155879723, 0.290793397488513, 0.356005721464494, 
    0.0671310150480841, 0.071730926195891, 0.118262826481373)), row.names = c(NA, 
-105L), effects = c("T", "cats__"), response = "Y", surface = FALSE, categorical = TRUE, catscale = "Probability", ordinal = FALSE, points = structure(list(
    T = c("Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Married", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental"
    ), resp__ = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
    6L, 5L, 6L, 6L, 6L, 6L, 6L, 5L, 6L, 6L, 6L, 6L, 5L, 6L, 6L, 
    5L, 6L, 6L, 5L, 6L, 6L, 6L, 6L, 6L, 7L, 6L, 7L, 6L, 6L, 5L, 
    6L, 6L, 6L, 7L, 6L, 6L, 6L, 7L, 6L, 6L, 6L, 7L, 6L, 5L, 6L, 
    7L, 6L, 6L, 7L), cond__ = structure(c(1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), levels = "Sw", class = "factor"), 
    effect1__ = c("Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Married", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental"
    )), row.names = c(NA, 60L), class = "data.frame"), class = "data.frame")

Best,
D

Here's another data object to share with dput() — unless level_order is a column name, but if so, it doesn't appear in your tables.

Sorry about all the missing info..

level_order <- c('Citizen', 'Married', 'Parental')
dput(level_order)
c("Citizen", "Married", "Parental")

Thanks!

1 Like

How were hoping to match the 24 values you supplied to xend to the 105 values contained in T?

A better question is, how were you imagining the segments to appear on the first plot?
image

Hi,

Sorry, I'm new to using ggplot and I got it wrong. I was hoping to get one colour for each country and T on the x axis. So in the ideal world there would be five groups of dots per row (each group indicating one country). Does that make sense? (See attached picture as an example; credit due to Brice Beffara)

Would there be a different solution than using xend?

Thanks again for your help.

Maybe focusing on a single location in the plot would be helpful: What would you like to see at location x = Citizen and y = 1?

Thanks for your willingness to help. I would love to get the number of responses on the scale of 1 to 7 on the y-axis. Each dot on y = 1 representing an anser of 1 on the ordinal scale. The colour of that dot representing the country of that response. On the x-axis I would like to have the three categories in T (citizen, married, parental).

In the graph by Beffara he has two groups which would be five in my case (five countries).

So if I have 10 responses of 7 on my ordinal scale for Sw and citizen, I would like to get 10 dots at x = citizen, colour of Sw, and the dots at 7 on the y-axis.

Does that give a proper explanation of what I'm looking for?

Thanks in advance!

Sorry, for some reason I was never notified of your reply, so just saw it! I can't reply now, but will when I can.

Thanks, and what lines and segments would you like to see?

Hi,

Thanks for picking this up again @dromano. Much appreciated!

My post needed to be reviewed by one of the admins before being published (some kind of automatic spam filter).

I would like a dashed line connecting the overall response for each type, the "overall response estimate" as computed by the brms model.

Overall response estimates (dashed lines on the plot)

overall_list <- conditional_merged %>%
  mutate(overall_resp = as.numeric(effect2__) * estimate__)
overall_sum <-
  aggregate(data = overall_list, overall_resp ~ S * T, sum)

And in regards to segment I would like the equivalent of a grouped bar chart, each segment representing a level of S side by side for the given level of T. I hope that makes sense?

Thanks again for your help.

Best,
Dan

There's a lot going on with the fruit example you shared — would it be enough to have just a bar chart (one bar per country) at each location? Or is it that you prefer the jittered data with segments instead?

Sorry for the delayed response. Yes, it would be enough to have a bar chart. Thanks again for your help!

Here's one possibility, then:

original data, saved as tables `rdatLong` and `conditional_merged`
rdatLong <- 
structure(list(T = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 1L, 1L, 1L, 1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, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), levels = c("F", "M"), class = "factor"), 
    Ind = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 
    13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 
    25L, 26L, 27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 
    8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 
    20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 1L, 
    2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
    11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 
    23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 
    6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 
    19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
    11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 
    23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 
    6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 
    19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 
    11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 
    23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L), S = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L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 
-300L), class = "data.frame")

conditional_merged <- 
structure(list(T = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 
3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 
1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 
3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 
1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 
3L), levels = c("Citizen", "Married", "Parental"), class = "factor"), 
    Y = c(5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5), S = structure(c(1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), levels = c("Sw", 
    "UK", "Ge", "Br", "Th"), class = "factor"), Ind = c(NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Item = c(NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), 
    cond__ = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
    2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
    5L, 5L, 5L, 5L, 5L, 5L), levels = c("Sw", "UK", "Ge", "Br", 
    "Th"), class = "factor"), cats__ = structure(c(1L, 1L, 1L, 
    2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 
    7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 
    5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 
    3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 
    1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 
    6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 
    4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L), levels = c("1", 
    "2", "3", "4", "5", "6", "7"), class = "factor"), effect1__ = structure(c(1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
    2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), levels = c("Citizen", 
    "Married", "Parental"), class = "factor"), effect2__ = structure(c(1L, 
    1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 
    6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 
    4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 
    2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 
    7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 
    5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 
    3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L), levels = c("1", 
    "2", "3", "4", "5", "6", "7"), class = "factor"), estimate__ = c(0.0110654992318489, 
    0.0155451930948465, 0.0143688283366143, 0.0231477479538397, 
    0.0298180090439486, 0.0286696159552191, 0.0280057378331549, 
    0.0346250061289056, 0.0335251419107379, 0.0682172232574559, 
    0.0807131245046543, 0.0780251387214389, 0.105513471142949, 
    0.117887647659516, 0.115221373226776, 0.404292450048423, 
    0.405430022340397, 0.406003178411718, 0.336534780571447, 
    0.289696237598041, 0.2990972503542, 0.0156808816091179, 0.00277328606502982, 
    0.0111592137174544, 0.0306463734233264, 0.00768341965794163, 
    0.0236643286551781, 0.0349025263478279, 0.0112023977531259, 
    0.0284558530277247, 0.0811053269302007, 0.0325326196000248, 
    0.0689519399282479, 0.11757474130441, 0.0613850173001845, 
    0.106508592995788, 0.405475228422769, 0.351683434497228, 
    0.402642310694309, 0.285180985591472, 0.524287753718591, 
    0.333911980800946, 0.00979796886054212, 0.00570130805082793, 
    0.00233072817324596, 0.0212314078244049, 0.0140549388779621, 
    0.0068232687875468, 0.0260880112021022, 0.0185094524322694, 
    0.0100929525231874, 0.0645134418043492, 0.0493396337561076, 
    0.0296237944376507, 0.103084251746014, 0.0841942418578971, 
    0.056836357329974, 0.401257052161464, 0.387309254414065, 
    0.341430989449393, 0.352592362470262, 0.423839949798206, 
    0.546001130772936, 0.0921010834152706, 0.178876225540506, 
    0.134522409582397, 0.102213816840051, 0.14267641542715, 0.124009914545333, 
    0.0863710535019469, 0.103737854837303, 0.0965534740013175, 
    0.146835410566114, 0.15384253402327, 0.153172651093373, 0.152069338306094, 
    0.139587182476441, 0.147928895991995, 0.307696735598537, 
    0.211281064084697, 0.257488213122604, 0.0810186048192243, 
    0.035817672342357, 0.0542293755924334, 0.329192344483761, 
    0.332069463778455, 0.223812219006906, 0.172615827409854, 
    0.172253025721409, 0.155901890875351, 0.106583717789106, 
    0.106011352168884, 0.106287267510947, 0.136970466296969, 
    0.136582322262654, 0.151874907778618, 0.102126013959185, 
    0.101018276448439, 0.128795745775057, 0.112174416292674, 
    0.110978083294732, 0.176756398086223, 0.0114895432323385, 
    0.0111524113662377, 0.0252449963964245), se__ = c(0.00982897434582293, 
    0.0136614340031164, 0.012336477178051, 0.0160943425008606, 
    0.0196053997485493, 0.0192223541331911, 0.017004902709182, 
    0.019443871640266, 0.018745683210574, 0.0320664226501304, 
    0.0346546645511961, 0.0336283836865701, 0.0352242421734997, 
    0.034998135588272, 0.0339024280833158, 0.0409907081564807, 
    0.0403614522957276, 0.041136640652593, 0.123311314754203, 
    0.116903742861806, 0.115602503270152, 0.0136721132494112, 
    0.0028655272673575, 0.0100807490561194, 0.020524348579282, 
    0.00672585523129708, 0.0168098737374559, 0.0194651336798764, 
    0.00847014629843682, 0.0173781650046282, 0.034626716654684, 
    0.0211490832592673, 0.0323391782503615, 0.0349178447069473, 
    0.0312894293854673, 0.0360706958453841, 0.0400334661506288, 
    0.0694317088203182, 0.0420220164603831, 0.114302491600598, 
    0.140285249807933, 0.127005622452064, 0.00868437336077789, 
    0.00540747625687178, 0.00240730705024832, 0.0150432155342528, 
    0.0110437214954306, 0.00605113346383297, 0.0161762264144541, 
    0.0124986631801403, 0.0080192900181911, 0.032266965262857, 
    0.0276786941554329, 0.0198561436499061, 0.0373449901271686, 
    0.0363564838170285, 0.0296313651833963, 0.0424064126612661, 
    0.0510141672870054, 0.0757728278337127, 0.127988603510765, 
    0.137310986612634, 0.143325079056937, 0.0562809590383617, 
    0.0873483834864042, 0.0755732219442349, 0.0423097017690029, 
    0.0423457846391073, 0.043329961860808, 0.0286275672274886, 
    0.0279595480626215, 0.0276822991151561, 0.0310914676736756, 
    0.0301224587153443, 0.0309297161545429, 0.028094214161304, 
    0.0318473203013194, 0.0294801714703064, 0.0806760232946475, 
    0.0807302763443041, 0.0873990950276758, 0.0520339834246294, 
    0.0260936269414261, 0.0385915279748072, 0.121909202778624, 
    0.124943566349674, 0.100647790989541, 0.038751146304892, 
    0.0393667448102692, 0.04144055924087, 0.0272409590545223, 
    0.0277419844888264, 0.026920744113271, 0.0330019462183535, 
    0.0341131118146589, 0.0302565480114382, 0.0353372676829492, 
    0.0369701490627691, 0.0338723723534759, 0.0591420740666044, 
    0.0603561527127758, 0.0785244039152127, 0.00984776641321559, 
    0.0096044912551709, 0.0201100566239427), lower__ = c(0.000913982741156934, 
    0.00146405430602157, 0.0013935445989323, 0.0031477417767424, 
    0.00473699676050253, 0.00419686862395037, 0.00548920065971852, 
    0.00720796663964236, 0.0068783468349181, 0.0179106360445487, 
    0.0240834525100028, 0.022124749184778, 0.0396127643182086, 
    0.0497284984466486, 0.0473144769498911, 0.270807695307911, 
    0.285851184908906, 0.28732356165151, 0.115661609153439, 0.086086016891724, 
    0.0942601011929971, 0.00159667412082705, 0.000159622023744514, 
    0.000914789965871641, 0.00488321882244597, 0.000755076987142175, 
    0.00312645267397237, 0.00768070908536947, 0.00140633513155234, 
    0.00525194736062064, 0.0242932558663215, 0.00618889077908613, 
    0.0185020898008606, 0.0486622539705306, 0.0163178796394723, 
    0.0382350720542917, 0.284102305695123, 0.172903247930255, 
    0.270756618090465, 0.0924559223001569, 0.248956640966172, 
    0.110353114508128, 0.00079890008211194, 0.000333645263577051, 
    0.000120131753906724, 0.00305123371132576, 0.00140499585264682, 
    0.000603860469152212, 0.00483578775423189, 0.00257939545694531, 
    0.00122028328442474, 0.0165348226424873, 0.00955437764794756, 
    0.00498283373734577, 0.0362024437944096, 0.0232660681386723, 
    0.0125718154503175, 0.267639126776708, 0.22025881139775, 
    0.159177066629826, 0.122785358506728, 0.171327072157765, 
    0.249032963329149, 0.0167112043578239, 0.0429861025946624, 
    0.0265094158659963, 0.0310796909445921, 0.0593457259192043, 
    0.0440125940141797, 0.0347750913287578, 0.0537215127519549, 
    0.0449275762602897, 0.0774575275980634, 0.0928641184397192, 
    0.0907373920115007, 0.0935880352311787, 0.0703095960148987, 
    0.0830623383565781, 0.132553296117509, 0.0626989533690681, 
    0.0941462357518712, 0.0145432382613072, 0.00428366448649126, 
    0.00799675422286008, 0.118720863378195, 0.111441375304363, 
    0.0626867750692461, 0.0981129594158345, 0.0924419764529949, 
    0.0742344161780983, 0.0563579380005086, 0.0552364335737838, 
    0.0586130374607474, 0.0637893832055842, 0.061272292562135, 
    0.0848045960632077, 0.0341860109421753, 0.0342047641484036, 
    0.0553508085606113, 0.0226750150757711, 0.0228549828766774, 
    0.047244089505723, 0.000893033306311348, 0.000903840240186069, 
    0.00292069154005023), upper__ = c(0.0686565627835526, 0.0867632305960958, 
    0.0840329775013701, 0.0892021123456843, 0.105114566997267, 
    0.0996508109797314, 0.0831486974186986, 0.0960108691963655, 
    0.0922601265940269, 0.14842176507417, 0.16139648903417, 0.156941815087189, 
    0.176524489845079, 0.184069722492062, 0.184027350084172, 
    0.474993859953592, 0.477952869229246, 0.476925033436006, 
    0.636008277055492, 0.580822458160666, 0.591237415858338, 
    0.0854701646981032, 0.0238676048508396, 0.0732506210294763, 
    0.100556056539663, 0.0413444151261656, 0.0928770102507483, 
    0.0932413328139755, 0.0469500997037422, 0.0838399138635992, 
    0.159931165970491, 0.101368568490458, 0.151559445011825, 
    0.190939525399452, 0.140245678054706, 0.183038190641973, 
    0.479527230084332, 0.453987895097446, 0.476931394073483, 
    0.581435212624706, 0.795617187386757, 0.637678777991919, 
    0.0599781160801926, 0.0402142162440088, 0.0223730030811905, 
    0.079211351132755, 0.0640868752098044, 0.0393601702199409, 
    0.0807602587460517, 0.0666192418522572, 0.0446778309201877, 
    0.144956790114658, 0.127648867751171, 0.0966740133596861, 
    0.177983247229119, 0.16293614423449, 0.136042417380295, 0.47549541352253, 
    0.469357381972033, 0.454052607522457, 0.644816920184542, 
    0.734100352507667, 0.820317518878862, 0.286363014723545, 
    0.444800678667629, 0.372026270639255, 0.196873501786698, 
    0.231439133866329, 0.217953802745165, 0.147578469981255, 
    0.16264035804399, 0.155566800212894, 0.211648718785116, 0.214696679929251, 
    0.216673176150547, 0.211023277905634, 0.202169220477045, 
    0.207207980995132, 0.440602559443335, 0.388380263577091, 
    0.415276858900119, 0.264786986039771, 0.149577054115932, 
    0.207276287794153, 0.636523371770171, 0.649398433713199, 
    0.508564158906448, 0.251907727232264, 0.25188996257815, 0.238392871419476, 
    0.167058994062156, 0.164624546164505, 0.166777275025444, 
    0.204671025827926, 0.203281336217566, 0.216492026826437, 
    0.176291741684375, 0.178887787222629, 0.196212767753464, 
    0.286919155879723, 0.290793397488513, 0.356005721464494, 
    0.0671310150480841, 0.071730926195891, 0.118262826481373)), row.names = c(NA, 
-105L), effects = c("T", "cats__"), response = "Y", surface = FALSE, categorical = TRUE, catscale = "Probability", ordinal = FALSE, points = structure(list(
    T = c("Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Married", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental"
    ), resp__ = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
    6L, 5L, 6L, 6L, 6L, 6L, 6L, 5L, 6L, 6L, 6L, 6L, 5L, 6L, 6L, 
    5L, 6L, 6L, 5L, 6L, 6L, 6L, 6L, 6L, 7L, 6L, 7L, 6L, 6L, 5L, 
    6L, 6L, 6L, 7L, 6L, 6L, 6L, 7L, 6L, 6L, 6L, 7L, 6L, 5L, 6L, 
    7L, 6L, 6L, 7L), cond__ = structure(c(1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), levels = "Sw", class = "factor"), 
    effect1__ = c("Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Married", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", "Citizen", 
    "Citizen", "Citizen", "Married", "Married", "Married", "Married", 
    "Married", "Married", "Married", "Married", "Married", "Married", 
    "Parental", "Parental", "Parental", "Parental", "Parental", 
    "Parental", "Parental", "Parental", "Parental", "Parental"
    )), row.names = c(NA, 60L), class = "data.frame"), class = "data.frame")
library(tidyverse)
rdatLong |> 
  mutate(
    # reverse order of response levels so 7 appears at top of plot
    Y = Y |> as.character(),
    Y = Y |> fct_relevel(7:1 |> as.character())
  ) |> 
  inner_join(
    conditional_merged %>% as_tibble() |> 
      mutate(overall_resp = as.numeric(effect2__) * estimate__) |>
      aggregate(overall_resp ~ S * T, sum) 
  ) |> 
  ggplot() + 
  geom_bar(aes(S, fill = S)) +
  # add open dots at overall response value, replotted at each response value
  geom_point(aes(S, overall_resp, fill = S), shape = 21) +
  facet_grid(Y ~ T)

Created on 2024-08-24 with reprex v2.0.2

Is this close to what you were hoping for?