Changing default for "connect.lines =TRUE" ggpredict (3 level factor variable)

I’m using ggeffect/ggpredict/ggemmeans to plot interaction effects.

I have a categorical factor variable with three levels (0,1,2). When I use “connect lines = TRUE” the default connects the dots in numerical order, i.e. 0->1 and 1->2. But I want the lines to be connected in relation to the reference level (0), i.e., 0->1 and 0->2

How to adjust the default? This is my simple code:

X <- ggemmeans(mymodel, terms = c("COMP", "LOC"))
plot(X, connect.lines = TRUE)

Attached picture shows what I get vs what I want. I think my question is simple enough that a reprex is not necessary)

Scott

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.