×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
# 心理統計学の基礎, p347-350のもの。感謝
# 表10-1 p318 相関行列
mat <- matrix(c(
1.000,0.033,0.315,0.456,0.266,0.607,0.228,0.419,
0.033,1.000,0.637,0.250,0.528,0.195,0.522,0.420,
0.315,0.637,1.000,0.333,0.880,0.237,0.750,0.328,
0.456,0.250,0.333,1.000,0.362,0.432,0.398,0.449,
0.266,0.528,0.880,0.362,1.000,0.252,0.738,0.269,
0.607,0.195,0.237,0.432,0.252,1.000,0.335,0.463,
0.228,0.522,0.750,0.398,0.738,0.335,1.000,0.238,
0.419,0.420,0.328,0.449,0.269,0.463,0.238,1.000),
nrow=8, dimnames=list(c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"), c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"))
)
library(sem)
model <- specify.model()
f1 -> yok, b12, 1
f1 -> gai, b13, NA
f1 -> sha, b15, NA
f1 -> sek, b17, NA
f2 -> onw, b21, NA
f2 -> sin, b24, NA
f2 -> kyo, b26, NA
f2 -> sun, b28, NA
f1 <-> f2, g11, NA
f1 <-> f1, NA, 1
f2 <-> f2, NA,1
onw <-> onw, e1, NA
yok <-> yok, e2, NA
gai <-> gai, e3, NA
sin <-> sin, e4, NA
sha <-> sha, e5, NA
kyo <-> kyo, e6, NA
sek <-> sek, e7, NA
sun <-> sun, e8, NA
semres <- sem(model, mat, N=200)
# 表10-7, p394 のものと一致
summary(semres)
# 適合度指標基準の覚書
# 以下参考にしたサイト。感謝。David Kennyのをちゃんと読むのが一番いいだろう
# David Kenny
# 小塩先生のページ。感謝
# Rでsem入門。
# Indiana Universityとpdf
# 荘島先生のサイト
# GFI, AGFIは.90以上。サンプルサイズが大きいときは無視
# RMSEAは小さいほうがいい。0.05未満
# AIC, BICは相対基準。小さいほうがいい
# 表10-1 p318 相関行列
mat <- matrix(c(
1.000,0.033,0.315,0.456,0.266,0.607,0.228,0.419,
0.033,1.000,0.637,0.250,0.528,0.195,0.522,0.420,
0.315,0.637,1.000,0.333,0.880,0.237,0.750,0.328,
0.456,0.250,0.333,1.000,0.362,0.432,0.398,0.449,
0.266,0.528,0.880,0.362,1.000,0.252,0.738,0.269,
0.607,0.195,0.237,0.432,0.252,1.000,0.335,0.463,
0.228,0.522,0.750,0.398,0.738,0.335,1.000,0.238,
0.419,0.420,0.328,0.449,0.269,0.463,0.238,1.000),
nrow=8, dimnames=list(c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"), c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"))
)
library(sem)
model <- specify.model()
f1 -> yok, b12, 1
f1 -> gai, b13, NA
f1 -> sha, b15, NA
f1 -> sek, b17, NA
f2 -> onw, b21, NA
f2 -> sin, b24, NA
f2 -> kyo, b26, NA
f2 -> sun, b28, NA
f1 <-> f2, g11, NA
f1 <-> f1, NA, 1
f2 <-> f2, NA,1
onw <-> onw, e1, NA
yok <-> yok, e2, NA
gai <-> gai, e3, NA
sin <-> sin, e4, NA
sha <-> sha, e5, NA
kyo <-> kyo, e6, NA
sek <-> sek, e7, NA
sun <-> sun, e8, NA
semres <- sem(model, mat, N=200)
# 表10-7, p394 のものと一致
summary(semres)
# 適合度指標基準の覚書
# 以下参考にしたサイト。感謝。David Kennyのをちゃんと読むのが一番いいだろう
# David Kenny
# 小塩先生のページ。感謝
# Rでsem入門。
# Indiana Universityとpdf
# 荘島先生のサイト
# GFI, AGFIは.90以上。サンプルサイズが大きいときは無視
# RMSEAは小さいほうがいい。0.05未満
# AIC, BICは相対基準。小さいほうがいい
PR
Comment
Trackback
Trackback URL
Comment form