I am trying to reproduce this image http://www.ats.ucla.edu/stat/stata/faq/model5s.png from this page http://www.ats.ucla.edu/stat/stata/faq/modmed.htm using tikz-cd. I have the following code and diagram. How do I add an arrow from W to the arrow of X to M or to the arrow from M to Y?
I am not sure if it is possible since the arrows themselves are not nodes. Also, is it possible to include an oval or rectangular border around a node? I may not be using the right package. I appreciate any suggestions.
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
& W \\
& M \arrow{dr} \\
X \arrow{ur} \arrow{rr} & & Y
\end{tikzcd}
\end{document}
Thanks, ksint