%% Meghan Sullivan
%% 20171205
%% Higher-order model with two specific factors; north south

% 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 (-10,0)     {y1};
\node[ov] (y2) at (-8.5,0)  {y2};
\node[ov] (y3) at (-7,0)  {y3};
\node[ov] (y4) at (-5.5,0)  {y4};
\node[ov] (y5) at (-4,0)  {y5};
\node[ov] (y6) at (-2.5,0)    {y6};
\node[ov] (y7) at (-1,0)  {y7};
\node[ov] (y8) at (0.5,0)  {y8};
\node[ov] (y9) at (2,0)  {y9};

% latent variables
\node[lv] (f1) at (-8.5, 5)  {$\theta_1$};
\node[lv] (f2) at (-4, 5)  {$\theta_2$};
\node[lv] (f3) at (0.5, 5)  {$\theta_3$};
\node[lv] (f4) at (-4, 10)  {$\theta_H$};

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

\path[->] (f4) edge node[above=0.08cm,scale=0.8,pos=0.9] {} (f1.north);
\path[->] (f4) edge node[above=0.08cm,scale=0.8,pos=0.9] {} (f2.north);
\path[->] (f4) edge node[above=0.08cm,scale=0.8,pos=0.9] {} (f3.north);


\end{tikzpicture}



\end{document}
