% \documentclass{article}
% \usepackage{tikz}
% \usetikzlibrary{shapes,arrows,positioning}
% 
% \begin{document}

\tikzstyle{every node}=[font=\scriptsize\ttfamily]
  {\scriptsize
    \pgfmathparse{10em}
    \global\let\pgfmathresult=\pgfmathresult
  }
  \let\nwidth=\pgfmathresult

% Nodes
\tikzstyle{fun} = [rectangle, draw, align=center, fill=white,
    minimum width=8em, text centered, rounded corners, minimum height=1.5em]
% Define the layers to draw the diagram
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\begin{tikzpicture}[node distance = 7em, auto]
%% Draw nodes
  \node (ctree) [fun] {partykit::ctree};
  \node (mob) [fun, right=1em of ctree] {partykit::mob};
  
  \node (f1) [below=2em of mob] {};
  \node [fun, right=1em of f1] (lmtree) {partykit::lmtree};
  \node [fun, below=0.5em of lmtree] (glmtree) {partykit::glmtree};
  
  \node (f2) [below=1.3em of glmtree] {};
  \node [fun, right=2em of lmtree] (lmertree) {glmertree::lmertree};
  \node [fun, below=0.5em of lmertree] (glmertree) {glmertree::glmertree};
  \node [fun, above=1em of lmertree] (lagsarlmtree) {lagsarlmtree::lagsarlmtree}; 
  \node [fun, right=1em of f2] (palmtree) {palmtree::palmtree};
  
  \node [fun, below=4em of glmtree] (raschtree) {psychotree::raschtree};
  \node [fun, below=0.5em of raschtree] (rstree) {psychotree::rstree};
  \node [fun, below=0.5em of rstree] (pctree) {psychotree::pctree};
  \node [fun, below=0.5em of pctree] (bttree) {psychotree::bttree};
  
  \node [fun, below=1.2em of bttree] (betatree) {betareg::betatree};
  
  \node (ytrafo) [ellipse, draw, fill=white, below=9em of ctree] {ytrafo};
  \node (f2) [below=22em of mob] {};
  \node [fun, left=0em of f2] (disttree) {disttree::disttree};
  \node [fun, below=1.2em of disttree] (trafotree) {trtf::trafotree};
  \node [fun, below=1.2em of trafotree] (pmtree) {model4you::pmtree};
  \node [fun, right=1em of pmtree] (pmforest) {model4you::pmforest};
  \node [fun, above=1.2em of pmforest] (traforest) {trtf::trafoforest};
  \node [fun, above=1.2em of traforest] (distforest) {disttree::distforest};

  \node (cforest) [fun, below=30em of ctree] {partykit::cforest};
  \node (ytrafo2) [ellipse, draw, fill=white, right=13em of cforest] {ytrafo};

%% Draw arrows
\begin{pgfonlayer}{background}
  \draw[->] (mob) |- (lmtree);
  \draw[->] (mob) |- (glmtree);
  \draw[->, dashed] (lmtree) |- (lmertree);
  \draw[->, dashed] (glmtree) |- (glmertree);
  \draw[->] (lmtree) -- ++(1,0) |- (lagsarlmtree);
  \draw[->, dashed] (lmtree) |- (palmtree);
  % \draw[->, dashed] (glmtree) |- (palmtree);
  \draw[->] (mob) |- (raschtree);
  \draw[->] (mob) |- (rstree);
  \draw[->] (mob) |- (pctree);
  \draw[->] (mob) |- (bttree);
  \draw[->] (mob) |- (betatree);
  \draw[->, dotted] (ytrafo) -- (mob);
  \draw[->] (ctree) |- (pmtree);
  \draw[->] (ctree) |- (disttree);
  \draw[->] (mob) -- (disttree);
  \draw[->] (ctree) |- (trafotree);
  \draw[->, thick] (pmtree) -- (pmforest);
  \draw[->, thick] (disttree) -- (distforest);
  \draw[->, thick] (trafotree) -- (traforest);
  \draw[->, thick] (ctree) -- ++(-2,0) |- (cforest);
  \draw[->] (cforest) -- ++(19em,0) |- (pmforest);
  \draw[->] (cforest) -- ++(19em,0) |- (distforest);
  \draw[->] (cforest) -- ++(19em,0) |- (traforest);
  
  
\end{pgfonlayer}
\end{tikzpicture}


% \end{document}