title: CFA nice path plots
body: <p>When I do an EFA from the package psych I can generate really nice path plots with correlations and loadings and such like this:</p>
  
  <p><img src="https://i.stack.imgur.com/W0d67.png" alt="enter image description here"> </p>
  
  <p>using the <code>fa.diagram</code> function with the following code:</p>
  
  <pre><code>library(psych)
  covariances &lt;- ability.cov$cov
  correlations &lt;- cov2cor(covariances)
  fa.promax &lt;- fa(correlations, nfactors=2, rotate="promax", fm="pa")
  fa.diagram(fa.promax, simple=FALSE)
  </code></pre>
  
  <p>I tend to use CFA more than EFA and would like to be able to plot the model with correlations in the same way.  I use the SEM package.  I have tried the <code>pathDiagram</code> function but it only produces the code that I can then paste to GVedit from Graphviz.  I do that and the correlations and between factor correlations aren't there. Additionally I don't like cutting and pasting to another program (though the help file from sem for pathDiagram reads: "<strong><em>To obtain graphics output directly, the dot program must be on the system search path.</em></strong>"; I don't know what exactly to put in the path to make that happen and if it will even have the correlations anyway?)</p>
  
  <p><strong>I'd like to be able to make a path diagram similar to what fa.diagram from psych does for EFA.  I'd like to be able to do this in R and not cut and paste.</strong>  I don't care what package you use to do this but I think most people would agree the simpler the better and if it can be done within R it would give great freedom of the choice of graphics device.</p>
  
  <p>Here is some sample code for a CFA model to work with:</p>
  
  <pre><code>dat3 &lt;- read.table(url("http://dl.dropbox.com/u/61803503/Proj_2b.dat"), 
              header=T, strip.white = T, as.is=FALSE, 
              na.strings= c("999", "NA", " "))
  
  NHSDA.cov &lt;- cov(dat3)
  
  ete.mod &lt;- specifyModel() 
  F1 -&gt; item3, lam1, NA 
  F1 -&gt; item5, lam2, NA 
  F1 -&gt; item9, lam3, NA 
  F1 -&gt; item10, lam4, NA 
  F2 -&gt; item4, lam5, NA 
  F2 -&gt; item13, lam6, NA 
  F2 -&gt; item14, lam7, NA 
  F2 -&gt; item15, lam8, NA 
  F3 -&gt; item1, lam9, NA 
  F3 -&gt; item6, lam10, NA 
  F3 -&gt; item7, lam11, NA 
  F3 -&gt; item11, lam12, NA 
  F3 -&gt; item12, lam13, NA 
  F4 -&gt; item2, lam14, NA 
  F4 -&gt; item8, lam15, NA 
  F4 -&gt; item16, lam16, NA 
  F4 -&gt; item17, lam17, NA 
  item1 &lt;-&gt; item1, e1, NA 
  item2 &lt;-&gt; item2, e2, NA 
  item3 &lt;-&gt; item3, e3, NA 
  item4 &lt;-&gt; item4, e4, NA 
  item5 &lt;-&gt; item5, e5, NA 
  item6 &lt;-&gt; item6, e6, NA 
  item7 &lt;-&gt; item7, e7, NA 
  item8 &lt;-&gt; item8, e8, NA 
  item9 &lt;-&gt; item9, e9, NA 
  item10 &lt;-&gt; item10, e10, NA 
  item11 &lt;-&gt; item11, e11, NA 
  item12 &lt;-&gt; item12, e12, NA 
  item13 &lt;-&gt; item13, e13, NA 
  item14 &lt;-&gt; item14, e14, NA 
  item15 &lt;-&gt; item15, e15, NA 
  item16 &lt;-&gt; item16, e16, NA 
  item17 &lt;-&gt; item17, e17, NA 
  F1 &lt;-&gt; F1, NA, 1
  F2 &lt;-&gt; F2, NA, 1
  F3 &lt;-&gt; F3, NA, 1
  F4 &lt;-&gt; F4, NA, 1
  F2 &lt;-&gt; F1, rF1F2 #1
  F3 &lt;-&gt; F1, rF1F3 #2
  F4 &lt;-&gt; F1, rF1F4 #3
  F3 &lt;-&gt; F2, rF2F3 #4
  F4 &lt;-&gt; F2, rF2F4 #5
  F4 &lt;-&gt; F3, rF3F4 #6
  
  ete.sem &lt;- sem(ete.mod, NHSDA.cov, nrow(dat3)) 
  (ete.SUM &lt;- summary(ete.sem))
  
  pathDiagram(ete.sem) #the attempt thus far
  </code></pre>
  
  <p><em>Running R 2.14.2 on Win 7</em></p>