How to specify correlation between latent and observed variable in lavaan?
<p>I would like to calculate the correlation between latent and observed variables using lavaan in R.</p>

<p>Here's a simple example of what I'm trying to do. We have some data and a lavaan model. </p>

<pre><code>data(bfi)
names(bfi) &lt;- tolower(names(bfi))
mod &lt;- "
 agree =~ a1 + a2 + a3 + a4 + a5
 consc =~ c1 + c2 + c3 + c4 + c5
 age ~~ agree 
 age ~~ consc
"
lavaan::cfa(mod, bfi)
</code></pre>

<p><code>agree</code> is a latent variable with 5 indicators. Age is an observed variable and I want to get the correlation between the observed variable <code>age</code> and the latent variable <code>agree</code>. The general way of specify covariance in lavaan is by putting <code>~~</code> in between the variables. But this doesn't seem to work when one of the variables is observed.</p>

<p>When I run the above, I get the following error:</p>

<pre><code>Error in lav_model(lavpartable = lavpartable, representation = lavoptions$representation,  : 
  lavaan ERROR: parameter is not defined: agree ~~ age
</code></pre>

<p>In other SEM software, such as Amos, you'd just draw a double headed arrow between the latent and observed variable.</p>

<p>How do you include correlations between latent and observed variables in lavaan?</p>