SachaEpskamp / semPlot

Path diagrams and visual analysis of various SEM packages' output
GNU General Public License v2.0
61 stars 20 forks source link

SemPlot Differing Values After Regraph #2

Closed StaticStudent closed 6 years ago

StaticStudent commented 11 years ago

Perhaps there is a fix for this or something I am missing but, here goes.

In using the semPaths function to plot a sem model, the model returns different values for residual errors of manifest and latent variables when the function is recalled.

For instance, using the semPaths command the first time will return what I believe to be the "true" values, however if we designate the semPaths function call as a new stored value i.e. file <- semPaths(etc.) then using plot(file) will return different values.

This becomes a problem when performing further actions on the returned qgraph object, as using qgraph(file, etc.) will use the same "wrong" values as in the returned plot(file) model.

SachaEpskamp commented 11 years ago

In the CRAN release there is a bug where I use the abbreviate function on the edge labels even if they are numeric. This is fixed in the devellopmental version here on Github. This might be your problem. Is the problem still there if you try the developmental version?

StaticStudent commented 11 years ago

I'm sorry, I am very new to this still. In using the developmental version of semPlot do I simply download it as a zip and install or do I have to use devtools? The developmental package was named semPlot-master so I didn't think r would recognize it as semPlot.

SachaEpskamp commented 11 years ago

You can install it using:

install.packages("devtools") library(devtools) install_github("qgraph", "sachaepskamp") install_github("lisrelToR", "sachaepskamp") install_github("semPlot", "sachaepskamp")

Note that this does require you to be able to compile packages. For Windows, you need RTools installed (http://cran.r-project.org/bin/windows/Rtools/).

I expect the update the packages to CRAN in 2 weeks or so.

StaticStudent commented 11 years ago

I downloaded and installed Rtools for windows and was able to use devtools to install lisrelToR and semPlot developmental packages but the qgraph developmental package failed to compile for an unspecified reason. The only thing I can think of why it might not have compiled is that I do not have a latex package installed, although I didn't think it would be an issue. Perhaps it is?

I tried using the cran version of qgraph with the developmental versions of lisrelToR and semPlot but received the same problem that I mentioned in my first post.

SachaEpskamp commented 11 years ago

Hm. You shouldn't need LaTeX for it, maybe you need to install the colorspace package from CRAN which is now imported in the new qgraph version.

StaticStudent commented 11 years ago

I tried downloading colorspace, but that did not help. Below is the exact output I receive after trying to install the developmental version of qgraph:

Installing github repo(s) qgraph/master from sachaepskamp Installing qgraph.zip from https://github.com/sachaepskamp/qgraph/archive/master.zip Installing qgraph pdflatex not found. Not building PDF vignettes. "C:/PROGRA~1/R/R-215~1.2/bin/i386/R" --vanilla CMD build "C:\Users\mshams\AppData\Local\Temp\RtmpesyrK9\qgraph-master" --no-manual --no-resave-data \ --no-vignettes

"C:/PROGRA~1/R/R-215~1.2/bin/i386/R" --vanilla CMD INSTALL "C:\Users\mshams\AppData\Local\Temp\RtmpesyrK9/qgraph_1.2.2.tar.gz" \ --library="C:/Users/mshams/Documents/R/win-library/2.15" --with-keep.source

*\ arch - i386 ERROR: compilation failed for package 'qgraph'

Do you think using r version 2.15.2 instead of 2.15.3 could be a cause? Sorry to bother you with this.

SachaEpskamp commented 11 years ago

Ok, I have compiled it for you. Should be easy to install now. Download the binary from:

http://sachaepskamp.com/files/qgraph_1.2.2.zip

Then install using:

install.packages(file.choose(), repos = NULL)

Select the qgraph_1.2.2.zip file

StaticStudent commented 11 years ago

Thank you for all the assistance. Unfortunately, even with the development versions of these packages, after feeding the obtained qgraph object from semPlot back into qgraph the values still display differently for factor loadings and residual errors the second time. When calling the name of the stored value, i.e. in my original post, "file" will display all the correct correlation, covariance, and error relationships but will not match up with the new model.

SachaEpskamp commented 9 years ago

Hey, I missed this. Any chance this has been fixed by now?