%% Charlie Redmon
%% 20170913
%% SEM path diagram: exploratory factor analysis model

% standalone class for individual image to be included in a document
% border=15pt controls the whitespace padding around the diagram
\documentclass[border=15pt]{standalone}

% load custom style configurations from separate file
\input{setupSEMstyle.tex}

\begin{document}

%% ">=stealth" sets the arrow head style
%% "semithick" sets the line width (0.6 pt)
\begin{tikzpicture}[>=stealth,semithick]

% predictor nodes (x)
\node[ov] (x1) {$x_{1}$};
\node[ov] (x2) [below of=x1]  {$x_{2}$};
\node[ov] (x3) [below of=x2]  {$x_{3}$};
\node[ov] (x4) [below of=x3]  {$x_{4}$};

% response node (y)
\begin{scope}[xshift=2cm]
\node[av] (y1) at (0,-1)      {$y_1$};
\node[av] (y2) [below of=y1]  {$y_2$};
\end{scope}

% paths (arrows) between x's and y1
\path[->] (x1) edge node[above,scale=0.6] {} (y1)
          (x2) edge node[above,scale=0.6] {} (y1)
          (x3) edge node[above,scale=0.6] {} (y1)
          (x4) edge node[above,scale=0.6] {} (y1);
% paths (arrows) between x's and y2
\path[->] (x1) edge node[above,scale=0.6] {} (y2)
          (x2) edge node[above,scale=0.6] {} (y2)
          (x3) edge node[above,scale=0.6] {} (y2)
          (x4) edge node[above,scale=0.6] {} (y2);
\end{tikzpicture}


\end{document}