%% Prof. Ed Merkle, University of Missouri
%% Charlie Redmon, University of Kansas
%% 20170918
%% SEM path diagram

% 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,scale=0.5]

% observed variables
\node[ov] (y1) at (0,0)  {x1};
\node[ov] (y2) at (0,-1.4)  {x2};
\node[ov] (y3) at (0,-2.8)  {x3};
\node[ov] (y4) at (0,-4.2)  {x4};
\node[ov] (y5) at (0,-5.6)  {x5};
\node[ov] (y6) at (0,-7)  {x6};
\node[ov] (y7) at (0,-8.4)  {x7};
\node[ov] (y8) at (0,-9.8)  {x8};
\node[ov] (y9) at (0,-11.2)  {x9};

% latent variables
\node[lv] (f1) at (5, -1.4)  {visual};
\node[lv] (f2) at (5, -5.6)  {textual};
\node[lv] (f3) at (5, -9.8)  {speed};

% paths
\path[->] (f1) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y1.east);
\path[->] (f1) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y2.east);
\path[->] (f1) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y3.east);
\path[->] (f2) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y4.east);
\path[->] (f2) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y5.east);
\path[->] (f2) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y6.east);
\path[->] (f3) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y7.east);
\path[->] (f3) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y8.east);
\path[->] (f3) edge node[above=0.08cm,scale=0.8,pos=0.7] {} (y9.east);

% paths between latent variables
\path[<->] (f1.east) edge [bend left=45] node[left,scale=0.8] {} (f2.east);
\path[<->] (f1.east) edge [bend left=45] node[left,scale=0.8] {} (f3.east);
\path[<->] (f2.east) edge [bend left=45] node[left,scale=0.8] {} (f3.east);

\end{tikzpicture}



\end{document}