top of page

dat <- read.csv("kyomi.csv",header=T)
dat


attach(dat)

install.packages("sem")
library(sem)

 

#確認的因子分析

model01 <- cfa()
   fkyomi: kyomi1, kyomi2, kyomi3  # 測定モデル(興味)
   foya  : oya1, oya2, oya3        # 測定モデル(親)
   fses  : ses1, ses2, ses3        # 測定モデル(SES)

 


fit01 <- sem(model=model01,S=cov(dat),N=nrow(dat))

summary(fit01,fit.indices=c("GFI","AGFI","CFI","NFI","SRMR","RMSEA","AIC"))

standardizedCoefficients(fit01)


# パス図の出力

# パッケージ semPlotを利用する場合

install.packages(semPlot) 

library(semPlot)
 semPaths(fit01,whatLabels="stand",layout="circle",style="lisrel")

#ソフトウェア Graphvizが利用できる場合
pathDiagram(fit01, ignore.double=FALSE, edge.labels="values", digits=2,standardize=TRUE)

© 2018-2024 HIDEYUKI UNUMA

All visitors since 14 Apr. 2018

  • Twitter
  • Instagram
  • Facebook
bottom of page