0

i found how to do a mediation here : Displaying mediator analysis with LaTeX (TikZ-pfg maybe?)

but i don't manage to transform it to a moderation like this : enter image description here

I'd like to keep the possibility to put the values like the mediation i showed.

Thank you very much.

Edit : i reused the given code from the link but didn't manage to make the arrow go between the variable a (time pressure) and b (home conflict). I thought about adding an invisible variable c between a and b so i could make a node from m to c but then it adds a square or a circle, i'd prefere a straight line. I then tried to mix it with this moderation model i found Moderator diagram Tikz but from what i understood it's using another package (i don't know if you can mix them) and you have to select (with edge label={coordinatepos=0.8}]) the position from which the link with the arrow will be, but if i do so it will also affect the starting point from a to m (no more from a.east). I went through the tikzpgfmanual.pdf and found some other way but i don't manage to mix it with the mediation template that i was talking about initially...

Thank you very much for your help

1 Answers1

0

This should solve your problem. Next time, please add a MWE as @SebGlav suggested.

\documentclass[tikz,border=4]{standalone}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\begin{document} \begin{tikzpicture}[ node distance=2cm, every node/.style={ inner ysep=0.5pt, font=\sffamily } ]

\node                   (m) {Psychological detachment};
\node[below left=of m]  (a) {Time pressure};
\node[below right=of m] (b) {Home conflict};

\draw[<->,>=Latex] (b) -- (a.east) -- (m.south west);
\draw[-Latex] (m) -- ($(a)!.5!(b)!.15!(m)$);

\end{tikzpicture} \end{document}

Result

Unknown
  • 822