I'm trying to graph out some hypotheses that result from a statistical model with #mermaidjs. Trying to do it kinda DAG-style, but I'd really like to be able to visualise the interactions by having arrows from nodes to edges (see issue on GH https://github.com/mermaid-js/mermaid/issues/3425). Do #stats / #rstats people not do this? Or if so, how/where do you make such graphs? Any examples? I had to add the extra arrow manually for now.
Pointing to a line · Issue #3425 · mermaid-js/mermaid

Hi. I am a big fan of mermaids and as a graduate student I want to do research with quantitative research methods. At first I thought I thought I could draw a research model with mermaids, but I fo...

GitHub
As an aside, in this, the "behavioural state" is binary, and has a sort of "gating" effect - ToD has an effect in one state, but no effect in the other. Makes me think in electronic diagrams, but is there a way one would graph it for a causal/statistical diagram?
@roaldarboel I am also using mermaid, diagrammeR is the package for it but usually I just use mermaid
@defuneste Oh, didn't know of that package, looks great! Has the same issue, it's not possible to point to an edge connecting two other nodes. :( I gave a thumbs up on the relevant issue: https://github.com/rich-iannone/DiagrammeR/issues/460
Node to Edge Path (Moderation/Interaction) · Issue #460 · rich-iannone/DiagrammeR

Great package! It has been very useful for creating some network diagrams. I would love to be able to use the package to visualize moderation, meaning, a path going from Node C to the edge connecti...

GitHub
@roaldarboel I'm still not quite clear about what an arrow from a box to a line actually *means*. Is it better to have boxes for your two behavioural states, and have arrows from them to the appropriate boxes? I say this because there seems not to be *an* effect of behavioural state, but the effect of behavioural state depends on which state you're looking at, sort of like an interaction.
@nxskok There’s both actually. There a direct effect of state, and there’s an interaction - see moderation for examples of what I mean: https://en.m.wikipedia.org/wiki/Moderation_(statistics)
Moderation (statistics) - Wikipedia

@roaldarboel If I recall, Andrew Heiss had a nice blog post on this. https://www.andrewheiss.com/
Andrew Heiss

Andrew Heiss is an assistant professor at Georgia State University, researching international NGOs and teaching data science & economics.

Andrew Heiss
@bernardforgues @roaldarboel Do you have a specific link? Dude's got a lot of content there and searching for DAG, graph, node, or edge is not really helpful
@bernardforgues Thanks, I’ll have a look! If you happen to come across it, feel free to post it here too. 😊
@bernardforgues @andrew Do you happen to know anything about this? Your name has been invoked, but I can’t find anything on your site. Problem is how to point an arrow from a node to an edge in a causal graph, or what one should do instead.☺️
@roaldarboel I haven’t seen @andrew here in a long time. You should send your message on bluesky or by email.

@roaldarboel
You can represent this as
node1 --> edge1
edge1 --> node2
node1 --> edge2
edge2 --> node3

node annotating an edge

node3 --> edge3
edge3 --> edge1

@jonny Are you able to make this approach work in Mermaid or similar though?
@roaldarboel
Ya ya. That is mermaid syntax. Should work anywhere, the idea is basically adding another level of nodes that represent edges, which is a standard graph trick. "Just add more nodes"
@roaldarboel
(Use mermaid classes to style them differently)
@jonny So basically just make a node at the intersection? Feels hacky… and not in the good way 😂
@jonny Would wish there was something simple like A —> BC 🫠
@roaldarboel
If only. Problem is there can be multiple edges between B and C, so an edge needs to be given a unique identifier. That just so happens to align with being a node in most graph markup syntaxes. See RDF-Star on the challenges of annotating edges
@jonny Damn. Why does this always happen - discovering an existential problem of our entire knowledge system when all I wanted was a line pointing to a line 😅😂