> #f_karkimuutt_fa(d=Lat2, max=3, crit=.5, selitys="Sel"); > ##table(D$ELTYY) > ##table(D$KOULRYH) > ##table(D$KOULAST) > > ### Rakenneyhtälömallit .... [TRUNCATED] ELAKETUb SAIPV ELAKETUb 413808.711 -4324.717 SAIPV -4324.717 3886.632 > #?cov() > > > fa1 <- ' + # Eläkkeelle siirtymisolot + # faktori 1 + # poi1 =~ TOLOT01 + TOLOT02 + TOLOT03 + TOLOT04 + TOLOT05 + TOLOT06 + + # .... [TRUNCATED] > ## yhdistellään > sem.model1 <- fa1; #c(fa1, reg1); > #fit <- cfa(model1, data=D) > #summary(fit); > Nboot <- 100; > ##sem1 <-lavaan(sem.model1, data=D, auto.var=TRUE); > sem1 <-sem(sem.model1, data=D, meanstructure=TRUE, + se="boot", bootstrap=Nboot, + # auto. .... [TRUNCATED] > summary(sem1, fit.measures=TRUE, standardized=TRUE); lavaan (0.5-16) converged normally after 149 iterations Used Total Number of observations 2211 3360 Estimator ML Minimum Function Test Statistic 2652.413 Degrees of freedom 139 P-value (Chi-square) 0.000 Model test baseline model: Minimum Function Test Statistic 18200.350 Degrees of freedom 174 P-value 0.000 User model versus baseline model: Comparative Fit Index (CFI) 0.861 Tucker-Lewis Index (TLI) 0.825 Loglikelihood and Information Criteria: Loglikelihood user model (H0) -55637.327 Loglikelihood unrestricted model (H1) -54311.120 Number of free parameters 59 Akaike (AIC) 111392.654 Bayesian (BIC) 111729.024 Sample-size adjusted Bayesian (BIC) 111541.573 Root Mean Square Error of Approximation: RMSEA 0.090 90 Percent Confidence Interval 0.087 0.093 P-value RMSEA <= 0.05 0.000 Standardized Root Mean Square Residual: SRMR 0.047 Parameter estimates: Information Observed Standard Errors Bootstrap Number of requested bootstrap draws 100 Number of successful bootstrap draws 100 Estimate Std.err Z-value P(>|z|) Std.lv Std.all Latent variables: TALMAHD =~ TALMAH01 0.628 0.017 36.412 0.000 0.683 0.811 TALMAH02 0.688 0.018 38.930 0.000 0.748 0.828 TALMAH03 0.715 0.018 40.084 0.000 0.778 0.823 TALMAH04 0.635 0.016 40.470 0.000 0.691 0.799 TALMAH05 0.747 0.015 49.250 0.000 0.812 0.828 TALMAH06 0.933 0.016 57.163 0.000 1.015 0.798 TALMAH07 0.728 0.021 34.042 0.000 0.792 0.759 TALMAH08 0.929 0.022 42.039 0.000 1.011 0.746 TALMAH09 0.741 0.022 34.304 0.000 0.806 0.729 Regressions: DURURA ~ LAHTO1 1.404 0.128 10.963 0.000 1.404 0.200 LAHTO2 -0.826 0.122 -6.754 0.000 -0.826 -0.109 MIES 0.989 0.225 4.399 0.000 0.989 0.078 AIKA 0.585 0.072 8.082 0.000 0.585 0.100 EDUCI -0.856 0.076 -11.211 0.000 -0.856 -0.202 logELAKE ~ MIES 0.205 0.019 11.012 0.000 0.205 0.314 DURURA 0.049 0.004 11.261 0.000 0.049 0.952 JOB1 -0.014 0.007 -2.041 0.041 -0.014 -0.037 JOB2 0.014 0.007 2.071 0.038 0.014 0.035 JOB3 0.034 0.008 4.462 0.000 0.034 0.089 JOB4 -0.031 0.006 -5.512 0.000 -0.031 -0.100 EDUCI 0.071 0.006 11.343 0.000 0.071 0.324 logVARALL ~ MIES 0.335 0.056 6.018 0.000 0.335 0.155 DURURA -0.018 0.006 -2.840 0.005 -0.018 -0.104 JOB1 -0.023 0.026 -0.877 0.381 -0.023 -0.018 JOB2 -0.017 0.027 -0.638 0.524 -0.017 -0.014 JOB3 0.089 0.030 2.960 0.003 0.089 0.070 JOB4 -0.110 0.025 -4.365 0.000 -0.110 -0.107 EDUCI -0.010 0.018 -0.557 0.577 -0.010 -0.014 TALMAHD ~ logELAKE 0.875 0.092 9.467 0.000 0.804 0.244 logVARALL 0.300 0.024 12.317 0.000 0.275 0.277 MIES -0.207 0.061 -3.387 0.001 -0.190 -0.088 AIKA -0.038 0.022 -1.710 0.087 -0.035 -0.035 Covariances: DURURA ~~ logVARALL 1.279 0.140 9.146 0.000 1.279 0.230 logELAKE -1.285 0.134 -9.564 0.000 -1.285 -0.685 Intercepts: DURURA 41.294 0.279 148.236 0.000 41.294 7.026 logELAKE 5.317 0.183 29.091 0.000 5.317 17.556 logVARALL 5.550 0.275 20.168 0.000 5.550 5.514 TALMAHD -2.620 0.214 -12.234 0.000 -2.409 -2.409 TALMAH01 0.875 0.304 2.880 0.004 0.875 1.039 TALMAH02 0.353 0.324 1.090 0.276 0.353 0.391 TALMAH03 0.220 0.343 0.640 0.522 0.220 0.232 TALMAH04 0.717 0.308 2.330 0.020 0.717 0.829 TALMAH05 -0.104 0.364 -0.287 0.774 -0.104 -0.106 TALMAH06 -1.705 0.431 -3.954 0.000 -1.705 -1.341 TALMAH07 -0.060 0.345 -0.173 0.863 -0.060 -0.057 TALMAH08 -1.646 0.429 -3.839 0.000 -1.646 -1.214 TALMAH09 -0.141 0.356 -0.395 0.693 -0.141 -0.127 Variances: TALMAH01 0.243 0.011 0.243 0.342 TALMAH02 0.257 0.012 0.257 0.315 TALMAH03 0.289 0.014 0.289 0.323 TALMAH04 0.270 0.012 0.270 0.361 TALMAH05 0.302 0.013 0.302 0.314 TALMAH06 0.586 0.029 0.586 0.363 TALMAH07 0.462 0.025 0.462 0.424 TALMAH08 0.816 0.039 0.816 0.444 TALMAH09 0.573 0.026 0.573 0.469 DURURA 31.019 1.543 31.019 0.898 logELAKE 0.113 0.012 0.113 1.236 logVARALL 0.997 0.036 0.997 0.984 TALMAHD 1.000 0.846 0.846 > Est <- parameterEstimates(sem1) > subset(Est, op == "~") lhs op rhs est se z pvalue ci.lower ci.upper 1 DURURA ~ LAHTO1 1.404 0.128 10.963 0.000 1.078 1.655 2 DURURA ~ LAHTO2 -0.826 0.122 -6.754 0.000 -1.073 -0.576 3 DURURA ~ MIES 0.989 0.225 4.399 0.000 0.531 1.441 4 DURURA ~ AIKA 0.585 0.072 8.082 0.000 0.407 0.695 5 DURURA ~ EDUCI -0.856 0.076 -11.211 0.000 -1.035 -0.705 6 logELAKE ~ MIES 0.205 0.019 11.012 0.000 0.169 0.254 7 logELAKE ~ DURURA 0.049 0.004 11.261 0.000 0.042 0.060 8 logELAKE ~ JOB1 -0.014 0.007 -2.041 0.041 -0.023 0.003 9 logELAKE ~ JOB2 0.014 0.007 2.071 0.038 -0.001 0.026 10 logELAKE ~ JOB3 0.034 0.008 4.462 0.000 0.013 0.047 11 logELAKE ~ JOB4 -0.031 0.006 -5.512 0.000 -0.043 -0.020 12 logELAKE ~ EDUCI 0.071 0.006 11.343 0.000 0.060 0.087 13 logVARALL ~ MIES 0.335 0.056 6.018 0.000 0.228 0.456 14 logVARALL ~ DURURA -0.018 0.006 -2.840 0.005 -0.032 -0.007 15 logVARALL ~ JOB1 -0.023 0.026 -0.877 0.381 -0.073 0.028 16 logVARALL ~ JOB2 -0.017 0.027 -0.638 0.524 -0.079 0.030 17 logVARALL ~ JOB3 0.089 0.030 2.960 0.003 0.040 0.148 18 logVARALL ~ JOB4 -0.110 0.025 -4.365 0.000 -0.152 -0.043 19 logVARALL ~ EDUCI -0.010 0.018 -0.557 0.577 -0.050 0.026 20 TALMAHD ~ logELAKE 0.875 0.092 9.467 0.000 0.678 1.075 21 TALMAHD ~ logVARALL 0.300 0.024 12.317 0.000 0.239 0.348 22 TALMAHD ~ MIES -0.207 0.061 -3.387 0.001 -0.344 -0.087 23 TALMAHD ~ AIKA -0.038 0.022 -1.710 0.087 -0.085 0.009 > print(Sys.time()); [1] "2014-10-21 10:58:55 EEST" > ### ¦ /OPEN netplot_sem_model1_tmt4.pdf > pdf(file.path(pngpath, "netplot_sem_model1_tmt4.pdf")); > semPaths(sem1, "model", "std", sizeMan=3, sizeInt=1, sizeLat=4, curve=0.5, + intercepts=FALSE, label.prop=0.8, + # structural = TRUE + + ) > dev.off(); windows 2 > save.image(file.path(dwpath,"Sem_models1.RData")); > ##summary(sem1)$coef > #save.image("Sem_models1.RData"); > ### END CFA or SEM ### > ##?sem() > ###http://sachaepskamp.com/semPlot/examples > # Plot .... [TRUNCATED]