title: CFA in R (lavaan) with ordinal data - polychoric correlation included?
body: <p>I would like to compute a confirmatory factor analysis (CFA) with ordinal data in <code>R</code> using <code>lavaan</code>. The data is from a questionnaire, containing 16 items structured on a Likert-scale. </p>
  
  <p>I assume a 4-factor-model to be the best fit to my data. To compute the CFA I searched for information and found some useful advise in this <a href="https://www.researchgate.net/publication/7489589_Comparison_of_alternative_estimation_methods_in_confirmatory_factor_analyses_of_the_General_Health_Questionnaire" rel="nofollow noreferrer">paper</a>.</p>
  
  <p>The recommendation is to use DWLS-estimation and polychoric correlation. I've managed to compute the CFA with DWLS in <code>R</code> using the <code>lavaan</code> package. I found out that in M<em>plus</em> the DWLS estimation, or WLSMV which is the same, uses <a href="http://web.pdx.edu/~newsomj/semclass/ho_estimate.pd" rel="nofollow noreferrer">polychoric correlation </a>, unfortunately I never used M<em>plus</em> and would like to work with <code>R</code>, so I was wondering if in <code>lavaan</code> it's the same.</p>
  
  <p>So far I computed the CFA like this:</p>
  
  <p>I specified a model (model.4) with 4 factors (AV, AW, AB, AA), (each factor has 4 items)</p>
  
  <pre><code>model.4='
  AV =~ AVf1_+AVf2+AVf3+AVf4 
  AW =~ AWf1+AW2+AWf3+AWf4 
  AB =~ ABf1+ABf2+ABf3+ABf4 
  AA =~ AAf1+AAf2+AAf3+AAf4'
  </code></pre>
  
  <p>Then I used the <code>"ordered"</code> function because of my ordered data, which is recommended in the <code>lavaan</code> package</p>
  
  <pre><code>model.ord = cfa(model.4,data=Data,ordered=c(
  "AVf1","AVf2","AVf3","AVf4",
  "AWf1","AWf2","AWf3","AWf4",
  "ABf1","ABf2","ABf3","ABf4",
  "AAf1","AAf2","AAf3","AAf4"))
  </code></pre>
  
  <p>This worked well. I got an output with all the relevant fit-indices (CFI, RMSEA etc.). Now my question is, if this automatically based upon polychoric correlation like in M<em>plus</em>? If it's not - how can I add a command to use polychoric correlation? There is some information in the <code>lavaan</code> package about polychoric correlation, <code>lavCor</code>, but I don't know if it's useful for my problem and unfortunately I don't know how to use it.</p>
  
  <p>I tried like this:</p>
  
  <pre><code>model.ord1 &lt;- lavCor(cfa(model.4,data=Data,ordered=c(
   "AVf1","AVf2","AVf3","AVf4",
  "AWf1","AWf2","AWf3","AWf4",
  "ABf1","ABf2","ABf3","ABf4",
  "AAf1","AAf2","AAf3","AAf4"))
  </code></pre>
  
  <p>))</p>
  
  <p>But <code>&gt; summary(model.ord1, fit=T)</code> didn't work. I did not receive any results.</p>
  
  <p><strong>To sum up</strong>: Is my CFA automatically based upon polychoric correlation? If not, how can I change my function to implement polychoric correlation?</p>