See this link: http://lavaan.ugent.be/tutorial/growth.html
### Model
LG.mod.full <- '
int=~1*ALAQSUM+1*CLAQSUM+1*DLAQSUM
slope=~-2*ALAQSUM+-1*CLAQSUM+0*DLAQSUM
int+slope~rndcode.binary
int+slope~ED.binary
int+slope~AYPSTAVG.gmc
#int+slope~AAUDITTot.gmc
int+slope~AFEMALE.binary
#int+slope~Tx_Audit_Int
#int+slope~Tx_AYPST_INT
#ALAQSUM~~CLAQSUM
#CLAQSUM~~DLAQSUM
'
fit.full <- growth(LG.mod.full, data=A1.tm, missing="ml")
summary(fit.full, fit.measures=TRUE, standardized=TRUE)
## lavaan (0.5-22) converged normally after 156 iterations
##
## Number of observations 1181
##
## Number of missing patterns 11
##
## Estimator ML
## Minimum Function Test Statistic 7.039
## Degrees of freedom 5
## P-value (Chi-square) 0.218
##
## Model test baseline model:
##
## Minimum Function Test Statistic 746.487
## Degrees of freedom 15
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.997
## Tucker-Lewis Index (TLI) 0.992
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) NA
## Loglikelihood unrestricted model (H1) NA
##
## Number of free parameters 16
## Akaike (AIC) NA
## Bayesian (BIC) NA
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.019
## 90 Percent Confidence Interval 0.000 0.047
## P-value RMSEA <= 0.05 0.966
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.012
##
## Parameter Estimates:
##
## Information Observed
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## ALAQSUM 1.000 8.438 0.942
## CLAQSUM 1.000 8.438 0.815
## DLAQSUM 1.000 8.438 0.880
## slope =~
## ALAQSUM -2.000 -7.441 -0.831
## CLAQSUM -1.000 -3.721 -0.359
## DLAQSUM 0.000 0.000 0.000
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~
## rndcode.binary 1.074 0.624 1.720 0.085 0.127 0.059
## slope ~
## rndcode.binary -0.090 0.335 -0.269 0.788 -0.024 -0.011
## int ~
## ED.binary 8.985 0.808 11.121 0.000 1.065 0.401
## slope ~
## ED.binary 3.058 0.436 7.020 0.000 0.822 0.309
## int ~
## AYPSTAVG.gmc -0.614 1.037 -0.592 0.554 -0.073 -0.025
## slope ~
## AYPSTAVG.gmc -1.232 0.548 -2.249 0.024 -0.331 -0.112
## int ~
## AFEMALE.binary -1.731 0.604 -2.864 0.004 -0.205 -0.101
## slope ~
## AFEMALE.binary -0.142 0.324 -0.438 0.661 -0.038 -0.019
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .int ~~
## .slope 13.203 2.949 4.477 0.000 0.489 0.489
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 0.000 0.000 0.000
## .CLAQSUM 0.000 0.000 0.000
## .DLAQSUM 0.000 0.000 0.000
## .int 44.919 0.829 54.194 0.000 5.324 5.324
## .slope -4.519 0.445 -10.147 0.000 -1.215 -1.215
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 22.154 4.889 4.531 0.000 22.154 0.276
## .CLAQSUM 56.436 3.341 16.891 0.000 56.436 0.526
## .DLAQSUM 20.773 5.104 4.070 0.000 20.773 0.226
## .int 59.134 5.751 10.283 0.000 0.831 0.831
## .slope 12.347 2.395 5.156 0.000 0.892 0.892
#parTable(fit.full)
# Simple Slopes Model
LG.mod.ed.ss <- '
int=~1*ALAQSUM+1*CLAQSUM+1*DLAQSUM
slope=~-2*ALAQSUM+-1*CLAQSUM+0*DLAQSUM
'
fit.ed.ss <- growth(LG.mod.ed.ss, data=A1.tm, missing="ml",group="ED.binary")
summary(fit.ed.ss, fit.measures=TRUE, standardized=TRUE)
## lavaan (0.5-22) converged normally after 182 iterations
##
## Number of observations per group
## 1 709
## 0 146
##
## Number of missing patterns per group
## 1 4
## 0 2
##
## Estimator ML
## Minimum Function Test Statistic 0.267
## Degrees of freedom 2
## P-value (Chi-square) 0.875
##
## Chi-square for each group:
##
## 1 0.259
## 0 0.008
##
## Model test baseline model:
##
## Minimum Function Test Statistic 561.335
## Degrees of freedom 6
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 1.000
## Tucker-Lewis Index (TLI) 1.009
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -8884.625
## Loglikelihood unrestricted model (H1) -8884.491
##
## Number of free parameters 16
## Akaike (AIC) 17801.249
## Bayesian (BIC) 17877.267
## Sample-size adjusted Bayesian (BIC) 17826.455
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000
## 90 Percent Confidence Interval 0.000 0.048
## P-value RMSEA <= 0.05 0.954
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.004
##
## Parameter Estimates:
##
## Information Observed
## Standard Errors Standard
##
##
## Group 1 [1]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## ALAQSUM 1.000 7.518 0.869
## CLAQSUM 1.000 7.518 0.773
## DLAQSUM 1.000 7.518 0.839
## slope =~
## ALAQSUM -2.000 -6.925 -0.801
## CLAQSUM -1.000 -3.463 -0.356
## DLAQSUM 0.000 0.000 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## slope 11.020 2.986 3.690 0.000 0.423 0.423
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 0.000 0.000 0.000
## .CLAQSUM 0.000 0.000 0.000
## .DLAQSUM 0.000 0.000 0.000
## int 53.230 0.333 159.986 0.000 7.080 7.080
## slope -1.633 0.175 -9.354 0.000 -0.472 -0.472
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 14.431 5.106 2.827 0.005 14.431 0.193
## .CLAQSUM 48.138 3.384 14.224 0.000 48.138 0.509
## .DLAQSUM 23.834 5.297 4.500 0.000 23.834 0.297
## int 56.525 5.958 9.486 0.000 1.000 1.000
## slope 11.990 2.490 4.815 0.000 1.000 1.000
##
##
## Group 2 [0]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## ALAQSUM 1.000 8.012 0.787
## CLAQSUM 1.000 8.012 0.722
## DLAQSUM 1.000 8.012 0.901
## slope =~
## ALAQSUM -2.000 -6.028 -0.592
## CLAQSUM -1.000 -3.014 -0.272
## DLAQSUM 0.000 0.000 0.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~~
## slope 18.592 9.980 1.863 0.062 0.770 0.770
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 0.000 0.000 0.000
## .CLAQSUM 0.000 0.000 0.000
## .DLAQSUM 0.000 0.000 0.000
## int 44.488 0.734 60.604 0.000 5.553 5.553
## slope -4.644 0.454 -10.220 0.000 -1.541 -1.541
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 77.445 19.404 3.991 0.000 77.445 0.747
## .CLAQSUM 86.988 12.565 6.923 0.000 86.988 0.707
## .DLAQSUM 14.948 15.903 0.940 0.347 14.948 0.189
## int 64.193 17.501 3.668 0.000 1.000 1.000
## slope 9.085 7.924 1.147 0.252 1.000 1.000
## 'data.frame': 6 obs. of 4 variables:
## $ group1: Factor w/ 2 levels "Non-student",..: 1 1 1 2 2 2
## $ mean : num 53.8 49.2 44.5 56.5 54.8 ...
## $ se : num 0.845 0.969 0.739 0.325 0.373 ...
## $ Time : num 0 6 12 0 6 12
## lavaan (0.5-22) converged normally after 168 iterations
##
## Number of observations 1181
##
## Number of missing patterns 16
##
## Estimator ML
## Minimum Function Test Statistic 8.545
## Degrees of freedom 7
## P-value (Chi-square) 0.287
##
## Model test baseline model:
##
## Minimum Function Test Statistic 763.006
## Degrees of freedom 21
## P-value 0.000
##
## User model versus baseline model:
##
## Comparative Fit Index (CFI) 0.998
## Tucker-Lewis Index (TLI) 0.994
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) NA
## Loglikelihood unrestricted model (H1) NA
##
## Number of free parameters 20
## Akaike (AIC) NA
## Bayesian (BIC) NA
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.014
## 90 Percent Confidence Interval 0.000 0.040
## P-value RMSEA <= 0.05 0.993
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.010
##
## Parameter Estimates:
##
## Information Observed
## Standard Errors Standard
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int =~
## ALAQSUM 1.000 8.432 0.941
## CLAQSUM 1.000 8.432 0.815
## DLAQSUM 1.000 8.432 0.879
## slope =~
## ALAQSUM -2.000 -7.431 -0.830
## CLAQSUM -1.000 -3.715 -0.359
## DLAQSUM 0.000 0.000 0.000
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## int ~
## rndcode.binary 1.032 0.626 1.649 0.099 0.122 0.057
## slope ~
## rndcode.binary -0.122 0.336 -0.364 0.716 -0.033 -0.015
## int ~
## ED.binary 8.990 0.807 11.137 0.000 1.066 0.401
## slope ~
## ED.binary 3.056 0.435 7.030 0.000 0.823 0.310
## int ~
## AYPSTAVG.gmc -1.088 1.184 -0.919 0.358 -0.129 -0.043
## slope ~
## AYPSTAVG.gmc -1.384 0.626 -2.212 0.027 -0.373 -0.126
## int ~
## AAUDITTot.gmc 0.171 0.115 1.492 0.136 0.020 0.074
## slope ~
## AAUDITTot.gmc 0.089 0.062 1.434 0.152 0.024 0.088
## int ~
## AFEMALE.binary -1.727 0.604 -2.860 0.004 -0.205 -0.101
## slope ~
## AFEMALE.binary -0.152 0.323 -0.471 0.637 -0.041 -0.020
## int ~
## Tx_AYPST_INT -0.227 0.187 -1.217 0.223 -0.027 -0.057
## slope ~
## Tx_AYPST_INT -0.196 0.101 -1.948 0.051 -0.053 -0.111
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .int ~~
## .slope 13.008 2.946 4.416 0.000 0.486 0.486
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 0.000 0.000 0.000
## .CLAQSUM 0.000 0.000 0.000
## .DLAQSUM 0.000 0.000 0.000
## .int 44.918 0.828 54.232 0.000 5.327 5.327
## .slope -4.503 0.444 -10.130 0.000 -1.212 -1.212
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .ALAQSUM 22.275 4.886 4.559 0.000 22.275 0.278
## .CLAQSUM 56.366 3.338 16.884 0.000 56.366 0.526
## .DLAQSUM 20.904 5.103 4.096 0.000 20.904 0.227
## .int 58.827 5.742 10.245 0.000 0.827 0.827
## .slope 12.167 2.393 5.084 0.000 0.881 0.881