Skip to content

Instantly share code, notes, and snippets.

@masaha03
Created May 4, 2012 20:02
Show Gist options
  • Save masaha03/2597370 to your computer and use it in GitHub Desktop.
Save masaha03/2597370 to your computer and use it in GitHub Desktop.
cor.2 <- readMoments(diag=FALSE,
names=c("両親に服従", "権威に敬意", "指導者に頼る", "伝統重視"))
0.5063549
0.4457519 0.5200434
0.3975495 0.4201535 0.4834760
# 従来の記法
model.c1 <- specifyModel()
権威主義 -> 両親に服従 , NA, 1
権威主義 -> 権威に敬意 , a2, NA
権威主義 -> 指導者に頼る , a3, NA
権威主義 -> 伝統重視 , a4, NA
権威主義 <-> 権威主義 , v1, NA
# CFA記法
model.c2 <- cfa(reference.indicators=TRUE)
権威主義: 両親に服従, 権威に敬意, 指導者に頼る, 伝統重視
sem.c <- sem(model.c2, cor.2, 1102)
summary(sem.c)
# 誤差相関の追加
model.c3 <- cfa(reference.indicators=TRUE,
covs="権威に敬意, 両親に服従")
権威主義: 両親に服従, 権威に敬意, 指導者に頼る, 伝統重視
sem.c2 <- sem(model.c3, cor.2, 1102)
summary(sem.c2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment