Rè¨èªã§æ§é æ¹ç¨å¼ã¢ããªã³ã° ãã®1
è¡åç§å¦ãªã©ã®é åã§ã¯ãéããé·ãã®ããã«ç´æ¥è¦³æ¸¬å¯è½ãªç¹æ§ã ãã§ãªãããå
é«æããç¥è½ãããã©ã³ãã¤ã¡ã¼ã¸ãã®ããã«ç´æ¥æ¸¬å®åºæ¥ãªãç¹æ§ã§ããæ§ææ¦å¿µï¼æ½å¨å¤æ°ï¼ãæ±ãå¿
è¦ãããã
æ§é æ¹ç¨å¼ã¢ããªã³ã°ã¯ãæ§ææ¦å¿µã観測å¤æ°ã®æ§è³ªã調ã¹ãããã«éããå¤ãã®è¦³æ¸¬å¤æ°ãåæã«åæããããã®çµ±è¨çæ¹æ³ã
æ§é æ¹ç¨å¼ã¢ããªã³ã°
- å¤å¤é解æã®1ææ³
- 第2ä¸ä»£ã®å¤å¤é解æ
- ä¼çµ±çãªçµ±è¨ææ³ãä¸ä½ã¢ãã«ã¨ãã¦å®è¡å¯è½
- å ååææ³
- å¤å¤é解æ
- ãã¹è§£ææ³
- æç³»å解æ
- etc...
å¤æ°ã®åé¡
æ¹ç¨å¼ã¢ãã«ã«ã¯ãæ§ã ãªç¨®é¡ã®å¤æ°ãç»å ´ãããããããã§ã¯ã3ã¤ã®è¦³ç¹ããåé¡ããã®æ§è³ªã確èªãã
- 観測å¤æ°ã¨æ½å¨å¤æ°
- 観測å¤æ° : ç´æ¥è¦³æ¸¬åºæ¥ãå¤æ°ã
- æ½å¨å¤æ° : ã¢ãã«ã«å°å ¥ããç´æ¥è¦³æ¸¬åºæ¥ãªãå¤æ°ãæ§ææ¦å¿µ
- æ§é å¤æ°ã¨èª¤å·®å¤æ°
- æ§é å¤æ° : èå¯ã®å¯¾è±¡ã¨ãªã£ã¦ããæ§ææ¦å¿µãå«ãã§ããå¤æ°
- 誤差å¤æ° : èå¯ã®å¯¾è±¡ã¨ãªã£ã¦ããæ§ææ¦å¿µã§ã¯èª¬æåºæ¥ãªãçµæå´ã®å¤æ°ã®å¤åãçã¿åºãè¦å ã¨ãã¦ã¢ãã«ã«å°å ¥ãããå¤æ°
- å¤çå¤æ°ã¨å
çå¤æ°
- å¤çå¤æ° : ã¢ãã«ã®ä¸ã§1度ãä»ã®å¤æ°ã®çµæã«ãªããªãå¤æ°
- å çå¤æ° : ã¢ãã«ã®ä¸ã§çæãããå¤æ°
æ¹ç¨å¼ã¢ãã«ã®å¯è¦å
ãã¹å³ã使ã£ã¦ãæ¹ç¨å¼ã¢ãã«ãå¯è¦åããã
- 観測å¤æ°ã¯åè§ã§å²ã
- æ½å¨å¤æ°ï¼æ§ææ¦å¿µï¼ã¯æ¥åã§å²ã
- 誤差å¤æ°ã¯å²ã¾ãªã
- å½±é¿ãä¸ããå¤æ°ãããä¸ããããå¤æ°ã«åæ¹åã®ç¢å°ãæ¸ããç¢å°ã«å æã®å½±é¿åã示ãæ°å¤ãä»ä¸
- å ±å¤åã示ã2ã¤ã®å¤çå¤æ°ã«å æé¢ä¿ãä»®å®ããªãæã«ã¯åæ¹åã®ç¢å°ãæ¸ããç¢å°ã«å ±åæ£ã示ãæ°å¤ãä»ä¸
ã¢ãã«ã®è¨è¿°
æ§é æ¹ç¨å¼ã¢ããªã³ã°ã§ã¯ãæå
ã®ãã¼ã¿ã®æ§è³ªãåæ社ã®ä»®èª¬ã«åºã¥ãã¦ãªãªã¸ãã«ã®åæã¢ãã«ããã¤ãããããå¾æ¥åã®å¤å¤é解æã®å¤ãã®ã¢ãã«ãä¸ä½ã¢ãã«ã¨ãã¦å®è¡ãããã¨ãåºæ¥ãã
ããã§ã¯ã3ã¤ã®ã¢ãã«ããã£ã¦ã¿ã
2次å ååæã¢ãã«
ä¸å³ã®ããã«ã観測å¤æ°ã®èå¾ã«ä»®å®ããæ§ææ¦å¿µã®èå¾ã«ãããã«é«æ¬¡ã®æ§ææ¦å¿µãä»®å®ããã¢ãã«ã
MIMICã¢ãã«ï¼Multiple Indicator MultIple Cause Modelï¼
ä¸å³ã®ããã«ãè¤æ°ã®è¦³æ¸¬ææ¨ã«ãã£ã¦ãæ§ææ¦å¿µãè¦å®ããããã®æ§ææ¦å¿µã観測å¤æ°ã®åå ã¨ãªã£ã¦ããã¢ãã«ã
å®è¡ä¾
以ä¸ã3ã¤ã®ã¢ãã«ã«ã¤ãã¦ãRè¨èªã§ã®å®è¡ä¾ãæ¸ãã
æºå
ããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«åã³èªã¿è¾¼ã¿
> install.packages("sem") > library(sem)
2次å ååæã¢ãã«
- ã¢ãã«ãèå¥ãããããã«ãããã¤ãã®æ¯æ°ãåºå®ãã
- f1 : å¤çå¤æ°ãªã®ã§ã, a1, a2, a3ã®ãã¡ã©ããã1ã¤ãåºå®ã
- f2 : å çå¤æ°ãªã®ã§ãb1,b2ã®ã©ã¡ãã1ã¤ãåºå®ã
- f3 : å çå¤æ°ãªã®ã§ãb3,b4ã®ã©ã¡ãã1ã¤ãåºå®ã
- f4 : å çå¤æ°ãªã®ã§ãb5,b6ã®ã©ã¡ãã1ã¤ãåºå®ã
- ãã¼ã¿
- 以ä¸ã®ãããª6ã¤ã®ãã¹ãã®ç¸é¢è¡å
TEST1 | 1.00 |
TEST2 | 0.703 1.00 |
TEST3 | 0.432 0.469 1.00 |
TEST4 | 0.424 0.461 0.738 1.00 |
TEST5 | 0.330 0.303 0.471 0.427 1.00 |
TEST6 | 0.348 0.388 0.433 0.490 0.717 1.00 |
- å®è¡
ç¸é¢è¡åãå ¥å
> TEST.cor <- read.moments(names = c("TEST1", "TEST2", "TEST3", "TEST4","TEST5", "TEST6")) 1: 1.00 2: 0.703 1.00 4: 0.432 0.469 1.00 7: 0.424 0.461 0.738 1.00 11: 0.330 0.303 0.471 0.427 1.00 16: 0.348 0.388 0.433 0.490 0.717 1.00 22: Read 21 items > TEST.cor TEST1 TEST2 TEST3 TEST4 TEST5 TEST6 TEST1 1.000 0.000 0.000 0.000 0.000 0 TEST2 0.703 1.000 0.000 0.000 0.000 0 TEST3 0.432 0.469 1.000 0.000 0.000 0 TEST4 0.424 0.461 0.738 1.000 0.000 0 TEST5 0.330 0.303 0.471 0.427 1.000 0 TEST6 0.348 0.388 0.433 0.490 0.717 1
ã¢ãã«ãæå®
> TEST.model <- specify.model() ç¥è½ -> åä½ç¥è½, a1, NA ç¥è½ -> è¨æ¶å, a2, NA ç¥è½ -> æ°çç¥è½, a3, NA åä½ç¥è½ -> TEST1, NA, 1 åä½ç¥è½ -> TEST2, b2, NA è¨æ¶å -> TEST3, NA, 1 è¨æ¶å -> TEST4, b4, NA æ°çç¥è½ -> TEST5, NA, 1 æ°çç¥è½ -> TEST6, b6, NA ç¥è½ <-> ç¥è½, NA, 1 åä½ç¥è½ <-> åä½ç¥è½, d2, NA è¨æ¶å <-> è¨æ¶å, d3, NA æ°çç¥è½ <-> æ°çç¥è½, d4, NA TEST1 <-> TEST1, e1, NA TEST2 <-> TEST2, e2, NA TEST3 <-> TEST3, e3, NA TEST4 <-> TEST4, e4, NA TEST5 <-> TEST5, e5, NA TEST6 <-> TEST6, e6, NA Read 19 records
ã¢ãã«æ§ç¯
> TEST.sem <- sem(ram = TEST.model, S = TEST.cor, N = 1000) > summary(TEST.sem) Model Chisquare = 55.935 Df = 6 Pr(>Chisq) = 3.0007e-10 Chisquare (null model) = 2918.6 Df = 15 Goodness-of-fit index = 0.98236 Adjusted goodness-of-fit index = 0.93827 RMSEA index = 0.091273 90% CI: (0.0703, 0.11386) Bentler-Bonnett NFI = 0.98083 Tucker-Lewis NNFI = 0.957 Bentler CFI = 0.9828 SRMR = 0.015852 BIC = 14.488 Normalized Residuals Min. 1st Qu. Median Mean 3rd Qu. Max. -1.25000 -0.11500 0.00001 -0.00386 0.24000 0.97900 Parameter Estimates Estimate Std Error z value Pr(>|z|) a1 0.56105 0.034836 16.1055 0.0000e+00 åä½ç¥è½ <--- ç¥è½ a2 0.76424 0.036971 20.6712 0.0000e+00 è¨æ¶å <--- ç¥è½ a3 0.57208 0.034329 16.6645 0.0000e+00 æ°çç¥è½ <--- ç¥è½ b2 1.07429 0.052826 20.3363 0.0000e+00 TEST2 <--- åä½ç¥è½ b4 1.00951 0.040304 25.0478 0.0000e+00 TEST4 <--- è¨æ¶å b6 1.06620 0.051607 20.6599 0.0000e+00 TEST6 <--- æ°çç¥è½ d2 0.33961 0.033132 10.2501 0.0000e+00 åä½ç¥è½ <--> åä½ç¥è½ d3 0.14698 0.038053 3.8625 1.1224e-04 è¨æ¶å <--> è¨æ¶å d4 0.34521 0.034049 10.1385 0.0000e+00 æ°çç¥è½ <--> æ°çç¥è½ e1 0.34561 0.031352 11.0237 0.0000e+00 TEST1 <--> TEST1 e2 0.24478 0.033320 7.3463 2.0384e-13 TEST2 <--> TEST2 e3 0.26896 0.026163 10.2802 0.0000e+00 TEST3 <--> TEST3 e4 0.25498 0.026277 9.7034 0.0000e+00 TEST4 <--> TEST4 e5 0.32752 0.031346 10.4486 0.0000e+00 TEST5 <--> TEST5 e6 0.23553 0.033210 7.0921 1.3205e-12 TEST6 <--> TEST6 Iterations = 50
å åå¾ç¹ã®ç®åº
> fscores(TEST.sem, data=df, centering=T, scale=F) #ä»åã¯ãã¼ã¿ããªãããæªå®è¡
ãã¹å³ã®æç»ï¼graphvizã§åºåããï¼
> con <- file("TEST1.dot", encoding="UTF-8") > capture.output(file = con, path.diagram(TEST.sem, ignore.double=F, edge.labels = "both", standardize = F, node.font = c("Osaka", 12), edge.font = c("Osaka", 10), rank.direction = "TB")) > system("dot -Tpng TEST.dot -o TEST.png")
MIMICã¢ãã«
- ã¢ãã«ãèå¥ãããããã«ãæ¯æ°ãåºå®ãã
- f1: å çå¤æ°ãªã®ã§ãαb41,αb51,αb61ã®ãã¡ã©ããä¸ã¤ãåºå®
- ãã¼ã¿
- 以ä¸ã®ãããªç¸é¢è¡å
åå ¥ | 1.00 |
å¦æ´ | 0.434 1.00 |
è·æ¥å¨ä¿¡ | 0.508 0.459 1.00 |
人è | 0.359 0.142 0.248 1.00 |
ç¥å度 | 0.220 0.234 0.215 0.816 1.00 |
社ä¼åå | 0.259 0.299 0.220 0.868 0.779 1.00 |
- å®è¡
ç¸é¢è¡åã®å ¥å
> social.cor <- read.moments(names = c("åå ¥", "å¦æ´", "è·æ¥å¨ä¿¡", "人è","ç¥å度", "社ä¼åå ")) 1.00 0.434 1.00 0.508 0.459 1.00 0.359 0.142 0.248 1.00 0.220 0.234 0.215 0.816 1.00 0.259 0.299 0.220 0.868 0.779 1.00 22: Read 21 items
ã¢ãã«ã®æå®
> social.model <- specify.model() åå ¥ -> 社ä¼çå°ä½, αd1 å¦æ´ -> 社ä¼çå°ä½,αd2 è·æ¥å¨ä¿¡ -> 社ä¼çå°ä½, αd3 社ä¼çå°ä½ -> 人è, NA, 1 社ä¼çå°ä½ -> ç¥å度,αb51, NA 社ä¼çå°ä½ -> 社ä¼åå ,αb61, NA 社ä¼çå°ä½ <-> 社ä¼çå°ä½,d1, NA åå ¥ <-> å¦æ´, Ï21, NA åå ¥ <-> è·æ¥å¨ä¿¡,Ï31, NA å¦æ´ <-> è·æ¥å¨ä¿¡,Ï32, NA 人è <-> 人è, e4, NA ç¥å度 <-> ç¥å度, e5, NA 社ä¼åå <-> 社ä¼åå , e6, NA åå ¥ <-> åå ¥, NA, 1 å¦æ´ <-> å¦æ´, NA, 1 è·æ¥å¨ä¿¡ <-> è·æ¥å¨ä¿¡, NA, 1 17: Read 16 records
ã¢ãã«æ§ç¯
> social.sem <- sem(ram = social.model, S = social.cor, N = 1000) > summary(social.sem) Model Chisquare = 324.19 Df = 9 Pr(>Chisq) = 0 Chisquare (null model) = 3610.8 Df = 15 Goodness-of-fit index = 0.9131 Adjusted goodness-of-fit index = 0.79722 RMSEA index = 0.18723 90% CI: (0.17006, 0.20498) Bentler-Bonnett NFI = 0.91022 Tucker-Lewis NNFI = 0.8539 Bentler CFI = 0.91234 SRMR = 0.035230 BIC = 262.02 Normalized Residuals Min. 1st Qu. Median Mean 3rd Qu. Max. -2.0100 -0.0436 0.0000 0.0413 0.1460 3.3300 Parameter Estimates Estimate Std Error z value Pr(>|z|) αd1 0.253322 0.036540 6.9327 4.1296e-12 社ä¼çå°ä½ <--- åå ¥ αd2 0.050914 0.036033 1.4130 1.5767e-01 社ä¼çå°ä½ <--- å¦æ´ αd3 0.091187 0.035735 2.5518 1.0718e-02 社ä¼çå°ä½ <--- è·æ¥å¨ä¿¡ αb51 0.889684 0.021464 41.4504 0.0000e+00 ç¥å度 <--- 社ä¼çå°ä½ αb61 0.946008 0.019856 47.6432 0.0000e+00 社ä¼åå <--- 社ä¼çå°ä½ d1 0.804465 0.040311 19.9563 0.0000e+00 社ä¼çå°ä½ <--> 社ä¼çå°ä½ Ï21 0.434000 0.023368 18.5726 0.0000e+00 å¦æ´ <--> åå ¥ Ï31 0.508000 0.020846 24.3696 0.0000e+00 è·æ¥å¨ä¿¡ <--> åå ¥ Ï32 0.459000 0.022561 20.3446 0.0000e+00 è·æ¥å¨ä¿¡ <--> å¦æ´ e4 0.081529 0.011974 6.8089 9.8324e-12 人è <--> 人è e5 0.272995 0.015040 18.1518 0.0000e+00 ç¥å度 <--> ç¥å度 e6 0.178031 0.012924 13.7755 0.0000e+00 社ä¼åå <--> 社ä¼åå Iterations = 35
å åå¾ç¹ã®ç®åº
> fscores(social.sem, data=df, centering=T, scale=F) #ä»åã¯ãã¼ã¿ããªãããæªå®è¡
ãã¹å³ã®æç»ï¼graphvizã§åºåããï¼
> con <- file("social.dot", encoding="UTF-8") > capture.output(file = con, path.diagram(social.sem, ignore.double=F, edge.labels = "both", standardize = F, node.font = c("Osaka", 12), edge.font = c("Osaka", 10), rank.direction = "LR")) > system("dot -Tpng social.dot -o social.png")
â» è¦ãããããã«ãdotãã¡ã¤ã«ãã¡ãã£ã¨ä¿®æ£ãã¦ãã¾ãã
縦æçã¢ãã«
- ã¢ãã«ãèå¥ãããããã«ãããã¤ãã®æ¯æ°ãåºå®ãã
- f1 : å¤çå¤æ°ãªã®ã§ã, a1, a2, a3ã®ãã¡ã©ããã1ã¤ãåºå®ã
- f2 : å çå¤æ°ãªã®ã§ãαb32,αb42ã®ã©ã¡ãã1ã¤ãåºå®ã
- f3 : å çå¤æ°ãªã®ã§ãαb53,αb63ã®ã©ã¡ãã1ã¤ãåºå®ã
- ãã¼ã¿
- 以ä¸ã®ãããªç¸é¢è¡å
æ¤æ»1 | 1.00 |
é¢æ¥1 | 0.610 1.00 |
æ¤æ»2 | 0.422 0.297 1.00 |
é¢æ¥2 | 0.268 0.419 0.660 1.00 |
æ¤æ»3 | 0.466 0.223 0.400 0.228 1.00 |
é¢æ¥3 | 0.221 0.458 0.241 0.412 0.585 1.00 |
- å®è¡
ç¸é¢è¡åãå ¥å
> kensa.cor <- read.moments(names = c("æ¤æ»1", "é¢æ¥1", "æ¤æ»2", "é¢æ¥2","æ¤æ»3", "é¢æ¥3")) 1.00 0.610 1.00 0.422 0.297 1.00 0.268 0.419 0.660 1.00 0.466 0.223 0.400 0.228 1.00 0.221 0.458 0.241 0.412 0.585 1.00 22: Read 21 items
ã¢ãã«ãæå®
> kensa.model <- specify.model() åæèªå·±å -> æ¤æ»1, NA, 1 åæèªå·±å -> é¢æ¥1, αb21, NA ä¸æèªå·±å -> æ¤æ»2, NA, 1 ä¸æèªå·±å -> é¢æ¥2, αb41, NA çµæèªå·±å -> æ¤æ»3, NA, 1 çµæèªå·±å -> é¢æ¥3, αb61, NA åæèªå·±å -> ä¸æèªå·±å, αa21, NA ä¸æèªå·±å -> çµæèªå·±å, αa32, NA åæèªå·±å <-> åæèªå·±å, NA, 1 ä¸æèªå·±å <-> ä¸æèªå·±å, d2, NA çµæèªå·±å <-> çµæèªå·±å, d3, NA æ¤æ»1 <-> æ¤æ»1, e1, NA é¢æ¥1 <-> é¢æ¥1, e2, NA æ¤æ»2 <-> æ¤æ»2, e3, NA é¢æ¥2 <-> é¢æ¥2, e4, NA æ¤æ»3 <-> æ¤æ»3, e5, NA é¢æ¥3 <-> é¢æ¥3, e6, NA 18: Read 17 records
ã¢ãã«æ§ç¯
> kensa.sem <- sem(ram = kensa.model, S = kensa.cor, N = 1000) > summary(kensa.sem) Model Chisquare = 788.47 Df = 8 Pr(>Chisq) = 0 Chisquare (null model) = 2627.1 Df = 15 Goodness-of-fit index = 0.7859 Adjusted goodness-of-fit index = 0.43798 RMSEA index = 0.3125 90% CI: (0.29426, 0.33114) Bentler-Bonnett NFI = 0.69987 Tucker-Lewis NNFI = 0.43976 Bentler CFI = 0.7012 SRMR = 0.11342 BIC = 733.21 Normalized Residuals Min. 1st Qu. Median Mean 3rd Qu. Max. -3.330 -1.620 -0.209 0.766 1.820 10.200 Parameter Estimates Estimate Std Error z value Pr(>|z|) αb21 0.68102 0.044440 15.3243 0.0000e+00 é¢æ¥1 <--- åæèªå·±å αb41 0.80549 0.050278 16.0209 0.0000e+00 é¢æ¥2 <--- ä¸æèªå·±å αb61 0.76603 0.078965 9.7009 0.0000e+00 é¢æ¥3 <--- çµæèªå·±å αa21 0.48021 0.038657 12.4223 0.0000e+00 ä¸æèªå·±å <--- åæèªå·±å αa32 0.49902 0.041492 12.0269 0.0000e+00 çµæèªå·±å <--- ä¸æèªå·±å d2 0.59471 0.061660 9.6449 0.0000e+00 ä¸æèªå·±å <--> ä¸æèªå·±å d3 0.56325 0.081439 6.9162 4.6381e-12 çµæèªå·±å <--> çµæèªå·±å e1 0.10789 0.052846 2.0416 4.1189e-02 æ¤æ»1 <--> æ¤æ»1 e2 0.57738 0.038787 14.8860 0.0000e+00 é¢æ¥1 <--> é¢æ¥1 e3 0.19515 0.047282 4.1274 3.6685e-05 æ¤æ»2 <--> æ¤æ»2 e4 0.47780 0.034629 13.7979 0.0000e+00 é¢æ¥2 <--> é¢æ¥2 e5 0.23632 0.075062 3.1484 1.6418e-03 æ¤æ»3 <--> æ¤æ»3 e6 0.55187 0.050110 11.0133 0.0000e+00 é¢æ¥3 <--> é¢æ¥3 Iterations = 33
å åå¾ç¹ã®ç®åº
> fscores(kensa.sem, data=df, centering=T, scale=F) #ä»åã¯ãã¼ã¿ããªãããæªå®è¡
ãã¹å³ã®æç»ï¼graphvizã§åºåããï¼
> con <- file("kensa.dot", encoding="UTF-8") > capture.output(file = con, path.diagram(kensa.sem, ignore.double=F, edge.labels = "both", standardize = F, node.font = c("Osaka", 12), edge.font = c("Osaka", 10), rank.direction = "TB")) > system("dot -Tpng kensa.dot -o kensa.png")
â» è¦ãããããã«ãdotãã¡ã¤ã«ãã¡ãã£ã¨ä¿®æ£ãã¦ãã¾ãã