이 작업을 수행하는 쉬운 방법이있을 수 있습니다 - 한 가지 방법을 : Mplus에서 아웃
:
나는 다음과 같은 구문을 사용하고 있습니다 이것을하기 위해서는 플로팅하기 전에 객체에서 노드를 제거해야합니다. semPaths
에 위의 호출에서 귀하의 질문에 Rotate Edges in semPaths/qgraph
library(qgraph)
library(semPlot)
library(MplusAutomation)
# This downloads an output file from Mplus examples
download.file("http://www.statmodel.com/usersguide/chap5/ex5.8.out",
outfile <- tempfile(fileext = ".out"))
# Unadjusted plot
s <- semPaths(outfile, intercepts = FALSE)
![enter image description here](https://i.stack.imgur.com/Zo1MU.png)
에서 Mplus의 예를 사용
, outfile
클래스 character
의, 그래서 (semPaths
에 대한 코드의 시작 근처) 라인
if (!"semPlotModel" %in% class(object))
object <- do.call(semPlotModel, c(list(object), modelOpts))
에서 개체를 반환합니다.. 이것은 클래스 "semPlotModel"
입니다.
그래서이 개체를 먼저 만들고 수정 한 다음이 개체를 semPaths
에 전달해야합니다.
# Call semPlotModel on your Mplus file
obj <- semPlot:::semPlotModel.mplus.model(outfile)
# obj <- do.call(semPlotModel, list(outfile)) # this is more general/not just for Mplus
# Remove one factor (F1) from [email protected] - need to check lhs and rhs columns
idx <- apply([email protected][c("lhs", "rhs")], 1, function(i) any(grepl("F1", i)))
[email protected] <- [email protected][!idx, ]
class(obj)
obj
클래스 "semPlotModel"
의 지금과 semPaths
s <- semPaths(obj, intercepts = FALSE)
![enter image description here](https://i.stack.imgur.com/sDWpD.png)
당신은 이것의 구조는 객체를 돌려 볼 str(s)
을 사용할 수 있습니다에 직접 전달 될 수 있습니다.
데이터 구조를 보여주십시오. 'str (x)'의 출력물을 올리 려하거나 더 잘 만들고, [재생 가능한 예제]를 만드십시오 (http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). –
방금 Mplus에서 OUTfile을 업로드했습니다. 조언 주셔서 감사합니다 :) –
Dropbox에서 파일을 제거하면 질문이 쓸모 없게되지 않도록 코드를 답안에 '포함'하십시오. –