Figure 11.1 Two Factor Oblique Model Simulated Alcohol Use Data

Load Simulated Alcohol Data

<a href=“https://docs.google.com/document/d/1SZ44w8P1oq6C_kMhAdBE8WX9z14-u3NNKQDCVkNmNK4/edit?usp=sharing>

Oblique Two Factor Model Figure11.1
Oblique Two Factor Model Figure11.1
require(lavaan)
## Loading required package: lavaan
## This is lavaan 0.6-19
## lavaan is FREE software! Please report any bugs.
AlcUseData <- read.table("singlegroupalcsim.txt", header = TRUE) ;

Fig11.1Model<-"
! regressions 
   TypAlc=~L2*qpls5mw1
   TypAlc=~L1*alcf3mw1
   LstWkAlc=~L5*typqsaw1
   LstWkAlc=~L4*typqfrw1
   LstWkAlc=~L3*typqthw1
! residuals, variances and covariances
   alcf3mw1 ~~ VAlc*alcf3mw1
   typqfrw1 ~~ VFr*typqfrw1
   typqsaw1 ~~ VSa*typqsaw1
   typqthw1 ~~ VTh*typqthw1
   qpls5mw1 ~~ VPls5*qpls5mw1
   TypAlc ~~ 1.0*TypAlc
   LstWkAlc ~~ 1.0*LstWkAlc
   TypAlc ~~ r*LstWkAlc
! observed means
   alcf3mw1~1;
   typqfrw1~1;
   typqsaw1~1;
   typqthw1~1;
   qpls5mw1~1;
"
Fig11.1Result<-lavaan(Fig11.1Model, data=AlcUseData, fixed.x=FALSE, missing="FIML")
summary(Fig11.1Result, fit.measures=TRUE,standardized=TRUE);
## lavaan 0.6-19 ended normally after 26 iterations
## 
##   Estimator                                         ML
##   Optimization method                           NLMINB
##   Number of model parameters                        16
## 
##   Number of observations                          2558
##   Number of missing patterns                         1
## 
## Model Test User Model:
##                                                       
##   Test statistic                                96.222
##   Degrees of freedom                                 4
##   P-value (Chi-square)                           0.000
## 
## Model Test Baseline Model:
## 
##   Test statistic                              5285.686
##   Degrees of freedom                                10
##   P-value                                        0.000
## 
## User Model versus Baseline Model:
## 
##   Comparative Fit Index (CFI)                    0.983
##   Tucker-Lewis Index (TLI)                       0.956
##                                                       
##   Robust Comparative Fit Index (CFI)             0.983
##   Robust Tucker-Lewis Index (TLI)                0.956
## 
## Loglikelihood and Information Criteria:
## 
##   Loglikelihood user model (H0)             -28383.767
##   Loglikelihood unrestricted model (H1)     -28335.655
##                                                       
##   Akaike (AIC)                               56799.533
##   Bayesian (BIC)                             56893.085
##   Sample-size adjusted Bayesian (SABIC)      56842.248
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.095
##   90 Percent confidence interval - lower         0.079
##   90 Percent confidence interval - upper         0.112
##   P-value H_0: RMSEA <= 0.050                    0.000
##   P-value H_0: RMSEA >= 0.080                    0.939
##                                                       
##   Robust RMSEA                                   0.095
##   90 Percent confidence interval - lower         0.079
##   90 Percent confidence interval - upper         0.112
##   P-value H_0: Robust RMSEA <= 0.050             0.000
##   P-value H_0: Robust RMSEA >= 0.080             0.939
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.021
## 
## Parameter Estimates:
## 
##   Standard errors                             Standard
##   Information                                 Observed
##   Observed information based on                Hessian
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   TypAlc =~                                                             
##     qpls5mw1  (L2)    0.897    0.020   45.559    0.000    0.897    0.810
##     alcf3mw1  (L1)    2.380    0.056   42.802    0.000    2.380    0.770
##   LstWkAlc =~                                                           
##     typqsaw1  (L5)    3.246    0.075   43.123    0.000    3.246    0.775
##     typqfrw1  (L4)    2.931    0.069   42.475    0.000    2.931    0.766
##     typqthw1  (L3)    1.591    0.054   29.682    0.000    1.591    0.578
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   TypAlc ~~                                                             
##     LstWkAlc   (r)    0.966    0.011   90.243    0.000    0.966    0.966
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .alcf3mw1          3.976    0.061   65.047    0.000    3.976    1.286
##    .typqfrw1          2.267    0.076   29.992    0.000    2.267    0.593
##    .typqsaw1          2.653    0.083   32.049    0.000    2.653    0.634
##    .typqthw1          1.077    0.054   19.783    0.000    1.077    0.391
##    .qpls5mw1          0.666    0.022   30.426    0.000    0.666    0.602
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .alcf3m1 (VAlc)    3.891    0.150   26.020    0.000    3.891    0.407
##    .typqfr1  (VFr)    6.031    0.231   26.123    0.000    6.031    0.413
##    .typqsw1  (VSa)    6.992    0.274   25.534    0.000    6.992    0.399
##    .typqth1  (VTh)    5.051    0.155   32.585    0.000    5.051    0.666
##    .qpls5m1 (VPl5)    0.420    0.019   22.467    0.000    0.420    0.343
##     TypAlc            1.000                               1.000    1.000
##     LstWkAl           1.000                               1.000    1.000
require(lavaangui)
## Loading required package: lavaangui
## Warning: package 'lavaangui' was built under R version 4.5.1
## This is lavaangui 0.2.5
## lavaangui is BETA software! Please report any bugs at https://github.com/karchjd/lavaangui/issues
#plot_lavaan(Fig11.1Result)