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

2
  • Hello, and welcome on TeX-SX. What did you try so far? It's a good habit not to come and ask for a do it for me but rather ask for a specific question about a specific issue you encountered.
    – SebGlav
    Commented May 10, 2022 at 12:19
  • Thank you for the feedback i edited my post !
    – user219
    Commented May 10, 2022 at 15:20

1 Answer 1

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

2
  • Thank you very much, i appreciate it ! I will, thanks
    – user219
    Commented May 11, 2022 at 14:01
  • @user219 Please accept the answer if it meets your needs.
    – Unknown
    Commented May 14, 2022 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .