dat.raw <- read_dta(paste0(data.raw_path, "Katie_10Mar22.dta"))

dat <- dat.raw %>%
  dplyr::select(id = atwinid,
         sampsex,
         seswq35,
         sisoem5,  # social isolation mother report
         sisoem7,
         sisoem10,
         sisoem12,
         sisoet5,  # social isolation teacher report
         sisoet7, 
         sisoet10,
         sisoet12,
         sisoe5,
         sisoe7,
         sisoe10,
         sisoe12,
         tadhdem5,  # total ADHD mother report
         tadhdem7,
         tadhdem10,
         tadhdem12,
         tadhdet5,  # total ADHD teacher report
         tadhdet7,
         tadhdet10,
         tadhdet12,
         hyem5,     # hyperactivity ADHD mother report
         hyem7,
         hyem10,
         hyem12, 
         hyet5,     # hyperactivity ADHD teacher report
         hyet7,
         hyet10,
         hyet12,
         inem5,    # inattention ADHD mother report
         inem7,
         inem10,
         inem12,
         inet5,    # inattention ADHD teacher report
         inet7,
         inet10,
         inet12,
         proem5,    # prosocial total scores mother report
         proem7,
         proem10,
         proem12, 
         proet5,    # prosocial total scores teacher report
         proet7,
         proet10,
         proet12, 
         asbem5,   # antisocial total scores mother report
         asbem7,
         asbem10,
         asbem12, 
         asbet5,   # antisocial total scores teacher report
         asbet7,
         asbet10,
         asbet12
  )

colnames(dat)

[1] “id” “sampsex” “seswq35” “sisoem5” “sisoem7” “sisoem10” [7] “sisoem12” “sisoet5” “sisoet7” “sisoet10” “sisoet12” “sisoe5”
[13] “sisoe7” “sisoe10” “sisoe12” “tadhdem5” “tadhdem7” “tadhdem10” [19] “tadhdem12” “tadhdet5” “tadhdet7” “tadhdet10” “tadhdet12” “hyem5”
[25] “hyem7” “hyem10” “hyem12” “hyet5” “hyet7” “hyet10”
[31] “hyet12” “inem5” “inem7” “inem10” “inem12” “inet5”
[37] “inet7” “inet10” “inet12” “proem5” “proem7” “proem10”
[43] “proem12” “proet5” “proet7” “proet10” “proet12” “asbem5”
[49] “asbem7” “asbem10” “asbem12” “asbet5” “asbet7” “asbet10”
[55] “asbet12”

Functions

# Table of model fit 
table.model.fit <- function(model){
  model.fit <- as.data.frame(t(as.data.frame(model$FIT))) %>%
    dplyr::select(chisq, df, chisq.scaled, cfi.robust, tli.robust, aic, bic, bic2, rmsea.robust, rmsea.ci.lower.robust, rmsea.ci.upper.robust, srmr) #can only be used with "MLR" estimator
  return(model.fit)
}

# Table of regression and correlation (standardised covariance) - only constrained models have been made into tables. 
table.model.coef <- function(model, ses){
  if (ses == "Low"){
    model.coef <- as.tibble(model$PE[c(86:101),]) %>% dplyr::select(-block, -group, -exo, -label, -std.lv, -std.nox)
    return(model.coef)
  } else if(ses == "Middle"){
    model.coef <- as.tibble(model$PE[c(17:32),]) %>% dplyr::select(-block, -group, -exo, -label, -std.lv, -std.nox)
    return(model.coef)
  } else if(ses == "High"){
    model.coef <- as.tibble(model$PE[c(155:170),]) %>% dplyr::select(-block, -group, -exo, -label, -std.lv, -std.nox)
    return(model.coef)
  } else {model.coef <- NULL}
}

First we need to recode SES as a factor, to show which level is which.

dat <- dat %>%
  mutate(
    SES = 
      recode_factor(as_factor(seswq35),
        "1" = "Low",
        "2" = "Middle", 
        "3" = "High"))

table(dat$SES)

Low Middle High 742 738 752


Create combined ADHD variables

# age 5
dat <- dat %>%
  mutate(tadhde5 = 
           case_when(
             is.na(tadhdem5) & is.na(tadhdet5) ~ NA_real_,
             is.na(tadhdem5) & !is.na(tadhdet5) ~ as.numeric(tadhdet5),
             is.na(tadhdet5) & !is.na(tadhdem5) ~ as.numeric(tadhdem5),
             !is.na(tadhdem5) & !is.na(tadhdet5) ~ as.numeric(rowMeans(across(.cols = c(tadhdem5,tadhdet5)))))
  )
# age 7
dat <- dat %>%
  mutate(tadhde7 = 
           case_when(
             is.na(tadhdem7) & is.na(tadhdet7) ~ NA_real_,
             is.na(tadhdem7) & !is.na(tadhdet7) ~ as.numeric(tadhdet7),
             is.na(tadhdet7) & !is.na(tadhdem7) ~ as.numeric(tadhdem7),
             !is.na(tadhdem7) & !is.na(tadhdet7) ~ as.numeric(rowMeans(across(.cols = c(tadhdem7,tadhdet7)))))
  )
# age 10
dat <- dat %>%
  mutate(tadhde10 = 
           case_when(
             is.na(tadhdem10) & is.na(tadhdet10) ~ NA_real_,
             is.na(tadhdem10) & !is.na(tadhdet10) ~ as.numeric(tadhdet10),
             is.na(tadhdet10) & !is.na(tadhdem10) ~ as.numeric(tadhdem10),
             !is.na(tadhdem10) & !is.na(tadhdet10) ~ as.numeric(rowMeans(across(.cols = c(tadhdem10,tadhdet10)))))
  )
# age 12
dat <- dat %>%
  mutate(tadhde12 = 
           case_when(
             is.na(tadhdem12) & is.na(tadhdet12) ~ NA_real_,
             is.na(tadhdem12) & !is.na(tadhdet12) ~ as.numeric(tadhdet12),
             is.na(tadhdet12) & !is.na(tadhdem12) ~ as.numeric(tadhdem12),
             !is.na(tadhdem12) & !is.na(tadhdet12) ~ as.numeric(rowMeans(across(.cols = c(tadhdem12,tadhdet12)))))
  )
# age 5
dat <- dat %>%
  mutate(hye5 = 
           case_when(
             is.na(hyem5) & is.na(hyet5) ~ NA_real_,
             is.na(hyem5) & !is.na(hyet5) ~ as.numeric(hyet5),
             is.na(hyet5) & !is.na(hyem5) ~ as.numeric(hyem5),
             !is.na(hyem5) & !is.na(hyet5) ~ as.numeric(rowMeans(across(.cols = c(hyem5,hyet5)))))
  )
# age 7
dat <- dat %>%
  mutate(hye7 = 
           case_when(
             is.na(hyem7) & is.na(hyet7) ~ NA_real_,
             is.na(hyem7) & !is.na(hyet7) ~ as.numeric(hyet7),
             is.na(hyet7) & !is.na(hyem7) ~ as.numeric(hyem7),
             !is.na(hyem7) & !is.na(hyet7) ~ as.numeric(rowMeans(across(.cols = c(hyem7,hyet7)))))
  )
# age 10
dat <- dat %>%
  mutate(hye10 = 
           case_when(
             is.na(hyem10) & is.na(hyet10) ~ NA_real_,
             is.na(hyem10) & !is.na(hyet10) ~ as.numeric(hyet10),
             is.na(hyet10) & !is.na(hyem10) ~ as.numeric(hyem10),
             !is.na(hyem10) & !is.na(hyet10) ~ as.numeric(rowMeans(across(.cols = c(hyem10,hyet10)))))
  )
# age 12
dat <- dat %>%
  mutate(hye12 = 
           case_when(
             is.na(hyem12) & is.na(hyet12) ~ NA_real_,
             is.na(hyem12) & !is.na(hyet12) ~ as.numeric(hyet12),
             is.na(hyet12) & !is.na(hyem12) ~ as.numeric(hyem12),
             !is.na(hyem12) & !is.na(hyet12) ~ as.numeric(rowMeans(across(.cols = c(hyem12,hyet12)))))
  )
# age 5
dat <- dat %>%
  mutate(ine5 = 
           case_when(
             is.na(inem5) & is.na(inet5) ~ NA_real_,
             is.na(inem5) & !is.na(inet5) ~ as.numeric(inet5),
             is.na(inet5) & !is.na(inem5) ~ as.numeric(inem5),
             !is.na(inem5) & !is.na(inet5) ~ as.numeric(rowMeans(across(.cols = c(inem5,inet5)))))
  )
# age 7
dat <- dat %>%
  mutate(ine7 = 
           case_when(
             is.na(inem7) & is.na(inet7) ~ NA_real_,
             is.na(inem7) & !is.na(inet7) ~ as.numeric(inet7),
             is.na(inet7) & !is.na(inem7) ~ as.numeric(inem7),
             !is.na(inem7) & !is.na(inet7) ~ as.numeric(rowMeans(across(.cols = c(inem7,inet7)))))
  )
# age 10
dat <- dat %>%
  mutate(ine10 = 
           case_when(
             is.na(inem10) & is.na(inet10) ~ NA_real_,
             is.na(inem10) & !is.na(inet10) ~ as.numeric(inet10),
             is.na(inet10) & !is.na(inem10) ~ as.numeric(inem10),
             !is.na(inem10) & !is.na(inet10) ~ as.numeric(rowMeans(across(.cols = c(inem10,inet10)))))
  )
# age 12
dat <- dat %>%
  mutate(ine12 = 
           case_when(
             is.na(inem12) & is.na(inet12) ~ NA_real_,
             is.na(inem12) & !is.na(inet12) ~ as.numeric(inet12),
             is.na(inet12) & !is.na(inem12) ~ as.numeric(inem12),
             !is.na(inem12) & !is.na(inet12) ~ as.numeric(rowMeans(across(.cols = c(inem12,inet12)))))
  )

Combined report prosocial variables

# age 5
dat <- dat %>%
  mutate(proe5 = 
           case_when(
             is.na(proem5) & is.na(proet5) ~ NA_real_,
             is.na(proem5) & !is.na(proet5) ~ as.numeric(proet5),
             is.na(proet5) & !is.na(proem5) ~ as.numeric(proem5),
             !is.na(proem5) & !is.na(proet5) ~ as.numeric(rowMeans(across(.cols = c(proem5,proet5)))))
  )
# age 7
dat <- dat %>%
  mutate(proe7 = 
           case_when(
             is.na(proem7) & is.na(proet7) ~ NA_real_,
             is.na(proem7) & !is.na(proet7) ~ as.numeric(proet7),
             is.na(proet7) & !is.na(proem7) ~ as.numeric(proem7),
             !is.na(proem7) & !is.na(proet7) ~ as.numeric(rowMeans(across(.cols = c(proem7,proet7)))))
  )
# age 10
dat <- dat %>%
  mutate(proe10 = 
           case_when(
             is.na(proem10) & is.na(proet10) ~ NA_real_,
             is.na(proem10) & !is.na(proet10) ~ as.numeric(proet10),
             is.na(proet10) & !is.na(proem10) ~ as.numeric(proem10),
             !is.na(proem10) & !is.na(proet10) ~ as.numeric(rowMeans(across(.cols = c(proem10,proet10)))))
  )
# age 12
dat <- dat %>%
  mutate(proe12 = 
           case_when(
             is.na(proem12) & is.na(proet12) ~ NA_real_,
             is.na(proem12) & !is.na(proet12) ~ as.numeric(proet12),
             is.na(proet12) & !is.na(proem12) ~ as.numeric(proem12),
             !is.na(proem12) & !is.na(proet12) ~ as.numeric(rowMeans(across(.cols = c(proem12,proet12)))))
  )

Combined report antisocial variables

# age 5
dat <- dat %>%
  mutate(asbe5 = 
           case_when(
             is.na(asbem5) & is.na(asbet5) ~ NA_real_,
             is.na(asbem5) & !is.na(asbet5) ~ as.numeric(asbet5),
             is.na(asbet5) & !is.na(asbem5) ~ as.numeric(asbem5),
             !is.na(asbem5) & !is.na(asbet5) ~ as.numeric(rowMeans(across(.cols = c(asbem5,asbet5)))))
  )
# age 7
dat <- dat %>%
  mutate(asbe7 = 
           case_when(
             is.na(asbem7) & is.na(asbet7) ~ NA_real_,
             is.na(asbem7) & !is.na(asbet7) ~ as.numeric(asbet7),
             is.na(asbet7) & !is.na(asbem7) ~ as.numeric(asbem7),
             !is.na(asbem7) & !is.na(asbet7) ~ as.numeric(rowMeans(across(.cols = c(asbem7,asbet7)))))
  )
# age 10
dat <- dat %>%
  mutate(asbe10 = 
           case_when(
             is.na(asbem10) & is.na(asbet10) ~ NA_real_,
             is.na(asbem10) & !is.na(asbet10) ~ as.numeric(asbet10),
             is.na(asbet10) & !is.na(asbem10) ~ as.numeric(asbem10),
             !is.na(asbem10) & !is.na(asbet10) ~ as.numeric(rowMeans(across(.cols = c(asbem10,asbet10)))))
  )
# age 12
dat <- dat %>%
  mutate(asbe12 = 
           case_when(
             is.na(asbem12) & is.na(asbet12) ~ NA_real_,
             is.na(asbem12) & !is.na(asbet12) ~ as.numeric(asbet12),
             is.na(asbet12) & !is.na(asbem12) ~ as.numeric(asbem12),
             !is.na(asbem12) & !is.na(asbet12) ~ as.numeric(rowMeans(across(.cols = c(asbem12,asbet12)))))
  )

Constrained model with SES differences

In the script “RICLPM_isolation_adhd.Rmd” and “RICLPMcomb_isolation_adhd.Rmd”, we decided that combined and mother report models will be constrained to have equal cross lags onlly, and teacher report models will be constrained to have equal autoregressive and crosslags.

Here, we will apply sex difference testing to each of these reporter models.

All models are using robust test statistics and standard errors.

Imposing constraints to the model can be achieved through pre-multiplication. It means that we have to prepend the number that we want to fix the parameter to, and an asterisk, to the parameter in the model specification. For example, F =~ 0*x1 fixes the factor loading of item x1 to factor F to 0. Using pre-multiplication we can also constrain parameters to be the same by giving them the same label. Below we specify an RI-CLPM with the following constraints:

Naming: a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad

sex.c = sex differences in constrained model lag.c = lag constrained model sex.lag.c = sex and lag constrained model

We will text for sex differences in two steps: 1) Estimate a model where constraints are applied across lags but not for each of the groups (low/middle/high) 2) Estimate a model where constraints are applied across both lags and the groups (low/middle/high)

An example of the constraining: For lag c, I have constrained each lag to be set to c1 for females and c2 for males. They layout for group specification is c(group 1, group 2, group 3). This provides the same estimates across each lag, but that they differ for different SES groups.

Combined report

RI-CLPM - total ADHD symptoms

RICLPMcomb.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y

  # Create within-person centered variables
  wad5 =~ 1*tadhde5
  wad7 =~ 1*tadhde7
  wad10 =~ 1*tadhde10 
  wad12 =~ 1*tadhde12
  wsi5 =~ 1*sisoe5
  wsi7 =~ 1*sisoe7
  wsi10 =~ 1*sisoe10
  wsi12 =~ 1*sisoe12
  
  # Constrained lagged effects between the within-person centered variables. c(group1, group2) - different values across groups, but the same values within groups and across lags. 
  wad7 ~ wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + wsi5
  
  wad10 ~ wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + wsi7
  
  wad12 ~ wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPMcomb.lag.c.fit <- lavaan(RICLPMcomb.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPMcomb.lag.c.fit.summary <- summary(RICLPMcomb.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 221 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 12

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 140.303 86.124 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.629 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 43.051 26.427 Low 24.532 15.059 High 72.720 44.638

Model Test Baseline Model:

Test statistic 6083.243 3268.692 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 1.861

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.983 0.985 Tucker-Lewis Index (TLI) 0.964 0.968

Robust Comparative Fit Index (CFI) 0.987 Robust Tucker-Lewis Index (TLI) 0.972

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -31303.851 -31303.851 Scaling correction factor 2.172 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.209 for the MLR correction

Akaike (AIC) 62793.701 62793.701 Bayesian (BIC) 63324.792 63324.792 Sample-size adjusted Bayesian (BIC) 63029.316 63029.316

Root Mean Square Error of Approximation:

RMSEA 0.059 0.040 90 Percent confidence interval - lower 0.049 0.031 90 Percent confidence interval - upper 0.070 0.049 P-value RMSEA <= 0.05 0.074 0.962

Robust RMSEA 0.051 90 Percent confidence interval - lower 0.037 90 Percent confidence interval - upper 0.066

Standardized Root Mean Square Residual:

SRMR 0.039 0.039

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.615 0.622 tadhde7 1.000 1.615 0.650 tadhde10 1.000 1.615 0.711 tadhde12 1.000 1.615 0.673 RIsi =~
sisoe5 1.000 0.584 0.585 sisoe7 1.000 0.584 0.565 sisoe10 1.000 0.584 0.479 sisoe12 1.000 0.584 0.483 wad5 =~
tadhde5 1.000 2.032 0.783 wad7 =~
tadhde7 1.000 1.890 0.760 wad10 =~
tadhde10 1.000 1.596 0.703 wad12 =~
tadhde12 1.000 1.773 0.739 wsi5 =~
sisoe5 1.000 0.810 0.811 wsi7 =~
sisoe7 1.000 0.853 0.825 wsi10 =~
sisoe10 1.000 1.071 0.878 wsi12 =~
sisoe12 1.000 1.060 0.876

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.318 0.067 4.762 0.000 0.342 0.342 wsi5 (d1) -0.055 0.081 -0.674 0.500 -0.023 -0.023 wsi7 ~
wad5 (c1) 0.071 0.021 3.310 0.001 0.169 0.169 wsi5 0.056 0.097 0.575 0.565 0.053 0.053 wad10 ~
wad7 0.127 0.105 1.210 0.226 0.150 0.150 wsi7 (d1) -0.055 0.081 -0.674 0.500 -0.029 -0.029 wsi10 ~
wad7 (c1) 0.071 0.021 3.310 0.001 0.126 0.126 wsi7 0.167 0.089 1.871 0.061 0.133 0.133 wad12 ~
wad10 0.347 0.125 2.767 0.006 0.312 0.312 wsi10 (d1) -0.055 0.081 -0.674 0.500 -0.033 -0.033 wsi12 ~
wad10 (c1) 0.071 0.021 3.310 0.001 0.107 0.107 wsi10 0.459 0.058 7.896 0.000 0.463 0.463

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.480 0.139 3.449 0.001 0.292 0.292 .wad7 ~~
.wsi7 0.422 0.147 2.875 0.004 0.283 0.283 .wad10 ~~
.wsi10 0.410 0.112 3.662 0.000 0.248 0.248 .wad12 ~~
.wsi12 0.382 0.099 3.865 0.000 0.247 0.247 RIad ~~
RIsi 0.471 0.100 4.704 0.000 0.499 0.499

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.042 0.095 21.549 0.000 2.042 0.787 .tadhde7 1.791 0.094 18.967 0.000 1.791 0.720 .tadhde10 1.373 0.084 16.333 0.000 1.373 0.605 .tadhde12 1.386 0.090 15.450 0.000 1.386 0.578 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.728 .sisoe7 0.743 0.039 19.085 0.000 0.743 0.719 .sisoe10 0.813 0.046 17.833 0.000 0.813 0.666 .sisoe12 0.871 0.046 19.131 0.000 0.871 0.719 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 2.609 0.386 6.761 0.000 1.000 1.000 RIsi 0.341 0.070 4.866 0.000 1.000 1.000 wad5 4.128 0.492 8.391 0.000 1.000 1.000 wsi5 0.656 0.103 6.353 0.000 1.000 1.000 .wad7 3.171 0.394 8.048 0.000 0.887 0.887 .wsi7 0.702 0.096 7.312 0.000 0.963 0.963 .wad10 2.494 0.485 5.139 0.000 0.979 0.979 .wsi10 1.097 0.154 7.102 0.000 0.956 0.956 .wad12 2.851 0.387 7.374 0.000 0.907 0.907 .wsi12 0.841 0.076 11.001 0.000 0.748 0.748 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.991 0.645 tadhde7 1.000 1.991 0.686 tadhde10 1.000 1.991 0.702 tadhde12 1.000 1.991 0.660 RIsi =~
sisoe5 1.000 0.840 0.612 sisoe7 1.000 0.840 0.622 sisoe10 1.000 0.840 0.582 sisoe12 1.000 0.840 0.500 wad5 =~
tadhde5 1.000 2.357 0.764 wad7 =~
tadhde7 1.000 2.111 0.727 wad10 =~
tadhde10 1.000 2.023 0.713 wad12 =~
tadhde12 1.000 2.264 0.751 wsi5 =~
sisoe5 1.000 1.086 0.791 wsi7 =~
sisoe7 1.000 1.057 0.783 wsi10 =~
sisoe10 1.000 1.173 0.813 wsi12 =~
sisoe12 1.000 1.454 0.866

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.161 0.071 2.257 0.024 0.179 0.179 wsi5 (d2) 0.138 0.106 1.304 0.192 0.071 0.071 wsi7 ~
wad5 (c2) 0.055 0.025 2.211 0.027 0.123 0.123 wsi5 0.237 0.093 2.543 0.011 0.243 0.243 wad10 ~
wad7 0.099 0.097 1.016 0.309 0.103 0.103 wsi7 (d2) 0.138 0.106 1.304 0.192 0.072 0.072 wsi10 ~
wad7 (c2) 0.055 0.025 2.211 0.027 0.100 0.100 wsi7 0.222 0.099 2.235 0.025 0.200 0.200 wad12 ~
wad10 0.371 0.094 3.962 0.000 0.331 0.331 wsi10 (d2) 0.138 0.106 1.304 0.192 0.072 0.072 wsi12 ~
wad10 (c2) 0.055 0.025 2.211 0.027 0.077 0.077 wsi10 0.480 0.074 6.507 0.000 0.387 0.387

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.752 0.263 2.858 0.004 0.294 0.294 .wad7 ~~
.wsi7 0.687 0.211 3.262 0.001 0.331 0.331 .wad10 ~~
.wsi10 0.826 0.222 3.722 0.000 0.364 0.364 .wad12 ~~
.wsi12 0.849 0.203 4.192 0.000 0.306 0.306 RIad ~~
RIsi 0.867 0.169 5.136 0.000 0.519 0.519

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.974 0.112 26.461 0.000 2.974 0.964 .tadhde7 2.340 0.108 21.612 0.000 2.340 0.806 .tadhde10 2.130 0.106 20.188 0.000 2.130 0.751 .tadhde12 2.061 0.113 18.313 0.000 2.061 0.684 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.739 .sisoe7 1.042 0.050 20.853 0.000 1.042 0.772 .sisoe10 1.181 0.054 21.756 0.000 1.181 0.819 .sisoe12 1.252 0.063 19.967 0.000 1.252 0.745 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 3.964 0.466 8.515 0.000 1.000 1.000 RIsi 0.705 0.127 5.559 0.000 1.000 1.000 wad5 5.557 0.615 9.039 0.000 1.000 1.000 wsi5 1.179 0.252 4.669 0.000 1.000 1.000 .wad7 4.256 0.572 7.444 0.000 0.955 0.955 .wsi7 1.015 0.143 7.108 0.000 0.908 0.908 .wad10 4.003 0.534 7.500 0.000 0.979 0.979 .wsi10 1.286 0.158 8.135 0.000 0.936 0.936 .wad12 4.442 0.518 8.573 0.000 0.867 0.867 .wsi12 1.737 0.200 8.694 0.000 0.822 0.822 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.562 0.618 tadhde7 1.000 1.562 0.729 tadhde10 1.000 1.562 0.722 tadhde12 1.000 1.562 0.788 RIsi =~
sisoe5 1.000 0.531 0.528 sisoe7 1.000 0.531 0.498 sisoe10 1.000 0.531 0.461 sisoe12 1.000 0.531 0.506 wad5 =~
tadhde5 1.000 1.985 0.786 wad7 =~
tadhde7 1.000 1.468 0.685 wad10 =~
tadhde10 1.000 1.499 0.692 wad12 =~
tadhde12 1.000 1.222 0.616 wsi5 =~
sisoe5 1.000 0.855 0.849 wsi7 =~
sisoe7 1.000 0.923 0.867 wsi10 =~
sisoe10 1.000 1.021 0.887 wsi12 =~
sisoe12 1.000 0.905 0.863

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.192 0.065 2.968 0.003 0.260 0.260 wsi5 (d3) 0.046 0.088 0.529 0.597 0.027 0.027 wsi7 ~
wad5 (c3) -0.030 0.025 -1.201 0.230 -0.065 -0.065 wsi5 0.308 0.082 3.751 0.000 0.285 0.285 wad10 ~
wad7 0.015 0.110 0.134 0.893 0.015 0.015 wsi7 (d3) 0.046 0.088 0.529 0.597 0.029 0.029 wsi10 ~
wad7 (c3) -0.030 0.025 -1.201 0.230 -0.043 -0.043 wsi7 0.371 0.079 4.672 0.000 0.335 0.335 wad12 ~
wad10 0.020 0.117 0.168 0.867 0.024 0.024 wsi10 (d3) 0.046 0.088 0.529 0.597 0.039 0.039 wsi12 ~
wad10 (c3) -0.030 0.025 -1.201 0.230 -0.050 -0.050 wsi10 0.289 0.066 4.395 0.000 0.325 0.325

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.428 0.119 3.591 0.000 0.252 0.252 .wad7 ~~
.wsi7 0.052 0.090 0.574 0.566 0.041 0.041 .wad10 ~~
.wsi10 0.298 0.113 2.645 0.008 0.207 0.207 .wad12 ~~
.wsi12 0.109 0.077 1.427 0.153 0.104 0.104 RIad ~~
RIsi 0.433 0.090 4.794 0.000 0.522 0.522

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 1.741 0.090 19.313 0.000 1.741 0.689 .tadhde7 1.319 0.080 16.526 0.000 1.319 0.615 .tadhde10 1.193 0.081 14.732 0.000 1.193 0.551 .tadhde12 0.924 0.073 12.724 0.000 0.924 0.466 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.695 .sisoe7 0.709 0.040 17.906 0.000 0.709 0.666 .sisoe10 0.824 0.043 19.163 0.000 0.824 0.716 .sisoe12 0.700 0.040 17.621 0.000 0.700 0.668 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 2.439 0.382 6.380 0.000 1.000 1.000 RIsi 0.282 0.065 4.356 0.000 1.000 1.000 wad5 3.939 0.559 7.046 0.000 1.000 1.000 wsi5 0.730 0.096 7.642 0.000 1.000 1.000 .wad7 1.999 0.296 6.748 0.000 0.928 0.928 .wsi7 0.788 0.110 7.154 0.000 0.924 0.924 .wad10 2.243 0.545 4.119 0.000 0.999 0.999 .wsi10 0.924 0.103 8.969 0.000 0.887 0.887 .wad12 1.490 0.381 3.915 0.000 0.998 0.998 .wsi12 0.736 0.084 8.794 0.000 0.898 0.898 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

#Table of model fit 
RICLPMcomb.lag.c.fit.summary.fit <- table.model.fit(RICLPMcomb.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPMcomb.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPMcomb.lag.c.fit.summary, ses = "Low")
RICLPMcomb.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPMcomb.lag.c.fit.summary, ses = "Middle")
RICLPMcomb.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPMcomb.lag.c.fit.summary, ses = "High")

RICLPMcomb.lag.c.fit.summary.reg.high %>% select(lhs, op, rhs, std.all, pvalue) %>% mutate_if(is.numeric, round, 4)

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPMcomb.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y

  # Create within-person centered variables
  wad5 =~ 1*tadhde5
  wad7 =~ 1*tadhde7
  wad10 =~ 1*tadhde10 
  wad12 =~ 1*tadhde12
  wsi5 =~ 1*sisoe5
  wsi7 =~ 1*sisoe7
  wsi10 =~ 1*sisoe10
  wsi12 =~ 1*sisoe12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a1,a1,a1)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b1,b1,b1)*wsi5
  
  wad10 ~ c(a2,a2,a2)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b2,b2,b2)*wsi7
  
  wad12 ~ c(a3,a3,a3)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b3,b3,b3)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPMcomb.ses.lag.c.fit <- lavaan(RICLPMcomb.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPMcomb.lag.c.fit, RICLPMcomb.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust test statistics (MLR estimation and satorra.bentler.2010 LRT method): The chi-square difference test of these two nested models is significant (p=0.003083).

RI-CLPM - Hyperactivity ADHD symptoms

RICLPMcomb_hyp.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y

  # Create within-person centered variables
  wad5 =~ 1*hye5
  wad7 =~ 1*hye7
  wad10 =~ 1*hye10 
  wad12 =~ 1*hye12
  wsi5 =~ 1*sisoe5
  wsi7 =~ 1*sisoe7
  wsi10 =~ 1*sisoe10
  wsi12 =~ 1*sisoe12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags. 
  wad7 ~ wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + wsi5
  
  wad10 ~ wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + wsi7
  
  wad12 ~ wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPMcomb_hyp.lag.c.fit <- lavaan(RICLPMcomb_hyp.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPMcomb_hyp.lag.c.fit.summary <- summary(RICLPMcomb_hyp.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 75 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 12

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 123.393 81.934 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.506 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 40.574 26.942 Low 17.292 11.482 High 65.527 43.510

Model Test Baseline Model:

Test statistic 5550.649 3150.159 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 1.762

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.985 0.986 Tucker-Lewis Index (TLI) 0.967 0.970

Robust Comparative Fit Index (CFI) 0.988 Robust Tucker-Lewis Index (TLI) 0.974

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -26663.352 -26663.352 Scaling correction factor 2.073 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.094 for the MLR correction

Akaike (AIC) 53512.704 53512.704 Bayesian (BIC) 54043.794 54043.794 Sample-size adjusted Bayesian (BIC) 53748.319 53748.319

Root Mean Square Error of Approximation:

RMSEA 0.054 0.038 90 Percent confidence interval - lower 0.043 0.029 90 Percent confidence interval - upper 0.065 0.048 P-value RMSEA <= 0.05 0.259 0.978

Robust RMSEA 0.047 90 Percent confidence interval - lower 0.033 90 Percent confidence interval - upper 0.062

Standardized Root Mean Square Residual:

SRMR 0.036 0.036

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.873 0.588 hye7 1.000 0.873 0.583 hye10 1.000 0.873 0.688 hye12 1.000 0.873 0.660 RIsi =~
sisoe5 1.000 0.587 0.589 sisoe7 1.000 0.587 0.568 sisoe10 1.000 0.587 0.480 sisoe12 1.000 0.587 0.484 wad5 =~
hye5 1.000 1.202 0.809 wad7 =~
hye7 1.000 1.216 0.812 wad10 =~
hye10 1.000 0.921 0.726 wad12 =~
hye12 1.000 0.993 0.751 wsi5 =~
sisoe5 1.000 0.805 0.808 wsi7 =~
sisoe7 1.000 0.851 0.823 wsi10 =~
sisoe10 1.000 1.072 0.877 wsi12 =~
sisoe12 1.000 1.061 0.875

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.329 0.065 5.050 0.000 0.325 0.325 wsi5 (d1) -0.025 0.040 -0.631 0.528 -0.017 -0.017 wsi7 ~
wad5 (c1) 0.129 0.034 3.790 0.000 0.182 0.182 wsi5 0.048 0.101 0.474 0.635 0.045 0.045 wad10 ~
wad7 0.163 0.083 1.956 0.050 0.216 0.216 wsi7 (d1) -0.025 0.040 -0.631 0.528 -0.023 -0.023 wsi10 ~
wad7 (c1) 0.129 0.034 3.790 0.000 0.146 0.146 wsi7 0.155 0.088 1.769 0.077 0.123 0.123 wad12 ~
wad10 0.341 0.112 3.055 0.002 0.316 0.316 wsi10 (d1) -0.025 0.040 -0.631 0.528 -0.027 -0.027 wsi12 ~
wad10 (c1) 0.129 0.034 3.790 0.000 0.112 0.112 wsi10 0.465 0.056 8.238 0.000 0.470 0.470

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.251 0.074 3.399 0.001 0.260 0.260 .wad7 ~~
.wsi7 0.254 0.090 2.830 0.005 0.265 0.265 .wad10 ~~
.wsi10 0.181 0.057 3.177 0.001 0.192 0.192 .wad12 ~~
.wsi12 0.159 0.059 2.684 0.007 0.184 0.184 RIad ~~
RIsi 0.199 0.049 4.069 0.000 0.389 0.389

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.272 0.054 23.564 0.000 1.272 0.857 .hye7 1.109 0.057 19.393 0.000 1.109 0.741 .hye10 0.731 0.047 15.645 0.000 0.731 0.576 .hye12 0.722 0.049 14.601 0.000 0.722 0.546 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.730 .sisoe7 0.744 0.039 19.090 0.000 0.744 0.719 .sisoe10 0.813 0.046 17.807 0.000 0.813 0.665 .sisoe12 0.871 0.045 19.150 0.000 0.871 0.718 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.762 0.113 6.760 0.000 1.000 1.000 RIsi 0.344 0.072 4.766 0.000 1.000 1.000 wad5 1.445 0.142 10.154 0.000 1.000 1.000 wsi5 0.647 0.104 6.221 0.000 1.000 1.000 .wad7 1.326 0.172 7.702 0.000 0.897 0.897 .wsi7 0.696 0.097 7.201 0.000 0.961 0.961 .wad10 0.811 0.144 5.653 0.000 0.956 0.956 .wsi10 1.095 0.155 7.064 0.000 0.952 0.952 .wad12 0.891 0.133 6.697 0.000 0.903 0.903 .wsi12 0.838 0.076 11.084 0.000 0.744 0.744 .hye5 0.000 0.000 0.000 .hye7 0.000 0.000 0.000 .hye10 0.000 0.000 0.000 .hye12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 1.066 0.605 hye7 1.000 1.066 0.656 hye10 1.000 1.066 0.659 hye12 1.000 1.066 0.629 RIsi =~
sisoe5 1.000 0.846 0.617 sisoe7 1.000 0.846 0.626 sisoe10 1.000 0.846 0.586 sisoe12 1.000 0.846 0.503 wad5 =~
hye5 1.000 1.402 0.796 wad7 =~
hye7 1.000 1.226 0.755 wad10 =~
hye10 1.000 1.217 0.752 wad12 =~
hye12 1.000 1.319 0.778 wsi5 =~
sisoe5 1.000 1.080 0.787 wsi7 =~
sisoe7 1.000 1.053 0.780 wsi10 =~
sisoe10 1.000 1.170 0.810 wsi12 =~
sisoe12 1.000 1.453 0.864

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.172 0.061 2.828 0.005 0.196 0.196 wsi5 (d2) 0.073 0.060 1.221 0.222 0.065 0.065 wsi7 ~
wad5 (c2) 0.067 0.039 1.737 0.082 0.089 0.089 wsi5 0.249 0.094 2.637 0.008 0.255 0.255 wad10 ~
wad7 0.103 0.084 1.219 0.223 0.103 0.103 wsi7 (d2) 0.073 0.060 1.221 0.222 0.063 0.063 wsi10 ~
wad7 (c2) 0.067 0.039 1.737 0.082 0.070 0.070 wsi7 0.239 0.098 2.438 0.015 0.215 0.215 wad12 ~
wad10 0.319 0.083 3.836 0.000 0.294 0.294 wsi10 (d2) 0.073 0.060 1.221 0.222 0.065 0.065 wsi12 ~
wad10 (c2) 0.067 0.039 1.737 0.082 0.056 0.056 wsi10 0.491 0.075 6.498 0.000 0.395 0.395

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.232 0.114 2.043 0.041 0.153 0.153 .wad7 ~~
.wsi7 0.337 0.115 2.937 0.003 0.279 0.279 .wad10 ~~
.wsi10 0.467 0.119 3.912 0.000 0.341 0.341 .wad12 ~~
.wsi12 0.411 0.109 3.763 0.000 0.249 0.249 RIad ~~
RIsi 0.401 0.090 4.451 0.000 0.445 0.445

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.773 0.064 27.520 0.000 1.773 1.006 .hye7 1.382 0.060 22.844 0.000 1.382 0.850 .hye10 1.177 0.060 19.483 0.000 1.177 0.727 .hye12 1.151 0.063 18.177 0.000 1.151 0.678 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.739 .sisoe7 1.042 0.050 20.853 0.000 1.042 0.772 .sisoe10 1.181 0.054 21.770 0.000 1.181 0.818 .sisoe12 1.252 0.063 19.969 0.000 1.252 0.745 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.137 0.128 8.890 0.000 1.000 1.000 RIsi 0.715 0.124 5.788 0.000 1.000 1.000 wad5 1.966 0.186 10.554 0.000 1.000 1.000 wsi5 1.166 0.251 4.653 0.000 1.000 1.000 .wad7 1.433 0.165 8.706 0.000 0.953 0.953 .wsi7 1.021 0.144 7.109 0.000 0.920 0.920 .wad10 1.454 0.177 8.216 0.000 0.981 0.981 .wsi10 1.286 0.160 8.062 0.000 0.940 0.940 .wad12 1.559 0.170 9.162 0.000 0.896 0.896 .wsi12 1.740 0.199 8.754 0.000 0.825 0.825 .hye5 0.000 0.000 0.000 .hye7 0.000 0.000 0.000 .hye10 0.000 0.000 0.000 .hye12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.887 0.582 hye7 1.000 0.887 0.698 hye10 1.000 0.887 0.772 hye12 1.000 0.887 0.804 RIsi =~
sisoe5 1.000 0.520 0.522 sisoe7 1.000 0.520 0.490 sisoe10 1.000 0.520 0.450 sisoe12 1.000 0.520 0.492 wad5 =~
hye5 1.000 1.241 0.814 wad7 =~
hye7 1.000 0.909 0.716 wad10 =~
hye10 1.000 0.729 0.635 wad12 =~
hye12 1.000 0.656 0.594 wsi5 =~
sisoe5 1.000 0.850 0.853 wsi7 =~
sisoe7 1.000 0.925 0.872 wsi10 =~
sisoe10 1.000 1.032 0.893 wsi12 =~
sisoe12 1.000 0.919 0.870

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.248 0.050 4.954 0.000 0.339 0.339 wsi5 (d3) 0.029 0.054 0.527 0.598 0.027 0.027 wsi7 ~
wad5 (c3) -0.026 0.035 -0.741 0.459 -0.035 -0.035 wsi5 0.299 0.085 3.529 0.000 0.274 0.274 wad10 ~
wad7 0.034 0.077 0.439 0.661 0.042 0.042 wsi7 (d3) 0.029 0.054 0.527 0.598 0.036 0.036 wsi10 ~
wad7 (c3) -0.026 0.035 -0.741 0.459 -0.023 -0.023 wsi7 0.385 0.080 4.809 0.000 0.346 0.346 wad12 ~
wad10 -0.052 0.174 -0.300 0.765 -0.058 -0.058 wsi10 (d3) 0.029 0.054 0.527 0.598 0.045 0.045 wsi12 ~
wad10 (c3) -0.026 0.035 -0.741 0.459 -0.021 -0.021 wsi10 0.297 0.066 4.485 0.000 0.333 0.333

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.243 0.071 3.424 0.001 0.230 0.230 .wad7 ~~
.wsi7 0.009 0.047 0.200 0.841 0.012 0.012 .wad10 ~~
.wsi10 0.123 0.061 2.011 0.044 0.174 0.174 .wad12 ~~
.wsi12 0.033 0.040 0.832 0.405 0.058 0.058 RIad ~~
RIsi 0.206 0.045 4.592 0.000 0.446 0.446

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.073 0.054 19.792 0.000 1.073 0.703 .hye7 0.796 0.047 16.946 0.000 0.796 0.627 .hye10 0.600 0.043 14.027 0.000 0.600 0.522 .hye12 0.470 0.041 11.542 0.000 0.470 0.426 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.702 .sisoe7 0.709 0.040 17.897 0.000 0.709 0.668 .sisoe10 0.824 0.043 19.155 0.000 0.824 0.713 .sisoe12 0.700 0.040 17.624 0.000 0.700 0.663 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.787 0.116 6.783 0.000 1.000 1.000 RIsi 0.270 0.065 4.170 0.000 1.000 1.000 wad5 1.541 0.177 8.684 0.000 1.000 1.000 wsi5 0.723 0.096 7.513 0.000 1.000 1.000 .wad7 0.728 0.091 8.022 0.000 0.880 0.880 .wsi7 0.795 0.114 6.988 0.000 0.928 0.928 .wad10 0.530 0.140 3.776 0.000 0.997 0.997 .wsi10 0.937 0.104 9.041 0.000 0.880 0.880 .wad12 0.428 0.114 3.762 0.000 0.996 0.996 .wsi12 0.752 0.085 8.882 0.000 0.891 0.891 .hye5 0.000 0.000 0.000 .hye7 0.000 0.000 0.000 .hye10 0.000 0.000 0.000 .hye12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

#Table of model fit 
RICLPMcomb_hyp.lag.c.fit.summary.fit <- table.model.fit(RICLPMcomb_hyp.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPMcomb_hyp.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPMcomb_hyp.lag.c.fit.summary, ses = "Low")
RICLPMcomb_hyp.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPMcomb_hyp.lag.c.fit.summary, ses = "Middle")
RICLPMcomb_hyp.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPMcomb_hyp.lag.c.fit.summary, ses = "High")

RICLPMcomb_hyp.lag.c.fit.summary.reg.high %>% select(lhs, op, rhs, std.all, pvalue) %>% mutate_if(is.numeric, round, 4)

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPMcomb_hyp.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y

  # Create within-person centered variables
  wad5 =~ 1*hye5
  wad7 =~ 1*hye7
  wad10 =~ 1*hye10 
  wad12 =~ 1*hye12
  wsi5 =~ 1*sisoe5
  wsi7 =~ 1*sisoe7
  wsi10 =~ 1*sisoe10
  wsi12 =~ 1*sisoe12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a1,a1,a1)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b1,b1,b1)*wsi5
  
  wad10 ~ c(a2,a2,a2)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b2,b2,b2)*wsi7
  
  wad12 ~ c(a3,a3,a3)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b3,b3,b3)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPMcomb_hyp.ses.lag.c.fit <- lavaan(RICLPMcomb_hyp.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPMcomb_hyp.lag.c.fit, RICLPMcomb_hyp.ses.lag.c.fit, method = "satorra.bentler.2010")

The chi-square difference test of these two nested models is significant (p=0.003312).

RI-CLPM - Inattention ADHD symptoms

RICLPMcomb_inat.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y

  # Create within-person centered variables
  wad5 =~ 1*ine5
  wad7 =~ 1*ine7
  wad10 =~ 1*ine10 
  wad12 =~ 1*ine12
  wsi5 =~ 1*sisoe5
  wsi7 =~ 1*sisoe7
  wsi10 =~ 1*sisoe10
  wsi12 =~ 1*sisoe12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags. 
  wad7 ~ wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + wsi5
  
  wad10 ~ wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + wsi7
  
  wad12 ~ wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPMcomb_inat.lag.c.fit <- lavaan(RICLPMcomb_inat.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPMcomb_inat.lag.c.fit.summary <- summary(RICLPMcomb_inat.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 77 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 12

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 142.574 86.791 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.643 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 36.612 22.288 Low 33.694 20.511 High 72.268 43.993

Model Test Baseline Model:

Test statistic 5507.670 2909.524 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 1.893

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.981 0.983 Tucker-Lewis Index (TLI) 0.959 0.964

Robust Comparative Fit Index (CFI) 0.985 Robust Tucker-Lewis Index (TLI) 0.968

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -26068.939 -26068.939 Scaling correction factor 2.220 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.251 for the MLR correction

Akaike (AIC) 52323.877 52323.877 Bayesian (BIC) 52854.968 52854.968 Sample-size adjusted Bayesian (BIC) 52559.492 52559.492

Root Mean Square Error of Approximation:

RMSEA 0.060 0.041 90 Percent confidence interval - lower 0.049 0.032 90 Percent confidence interval - upper 0.070 0.050 P-value RMSEA <= 0.05 0.060 0.958

Robust RMSEA 0.052 90 Percent confidence interval - lower 0.037 90 Percent confidence interval - upper 0.067

Standardized Root Mean Square Residual:

SRMR 0.038 0.038

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.815 0.614 ine7 1.000 0.815 0.642 ine10 1.000 0.815 0.644 ine12 1.000 0.815 0.605 RIsi =~
sisoe5 1.000 0.599 0.596 sisoe7 1.000 0.599 0.577 sisoe10 1.000 0.599 0.493 sisoe12 1.000 0.599 0.497 wad5 =~
ine5 1.000 1.048 0.790 wad7 =~
ine7 1.000 0.973 0.767 wad10 =~
ine10 1.000 0.969 0.765 wad12 =~
ine12 1.000 1.071 0.796 wsi5 =~
sisoe5 1.000 0.807 0.803 wsi7 =~
sisoe7 1.000 0.848 0.817 wsi10 =~
sisoe10 1.000 1.057 0.870 wsi12 =~
sisoe12 1.000 1.046 0.868

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.266 0.090 2.953 0.003 0.287 0.287 wsi5 (d1) -0.040 0.044 -0.898 0.369 -0.033 -0.033 wsi7 ~
wad5 (c1) 0.070 0.039 1.777 0.076 0.086 0.086 wsi5 0.085 0.094 0.905 0.365 0.081 0.081 wad10 ~
wad7 0.091 0.105 0.865 0.387 0.091 0.091 wsi7 (d1) -0.040 0.044 -0.898 0.369 -0.035 -0.035 wsi10 ~
wad7 (c1) 0.070 0.039 1.777 0.076 0.064 0.064 wsi7 0.174 0.088 1.966 0.049 0.139 0.139 wad12 ~
wad10 0.357 0.101 3.549 0.000 0.323 0.323 wsi10 (d1) -0.040 0.044 -0.898 0.369 -0.039 -0.039 wsi12 ~
wad10 (c1) 0.070 0.039 1.777 0.076 0.065 0.065 wsi10 0.458 0.060 7.653 0.000 0.463 0.463

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.202 0.071 2.843 0.004 0.238 0.238 .wad7 ~~
.wsi7 0.163 0.068 2.402 0.016 0.208 0.208 .wad10 ~~
.wsi10 0.221 0.076 2.903 0.004 0.219 0.219 .wad12 ~~
.wsi12 0.231 0.058 3.960 0.000 0.248 0.248 RIad ~~
RIsi 0.286 0.058 4.961 0.000 0.587 0.587

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.769 0.049 15.593 0.000 0.769 0.579 .ine7 0.683 0.048 14.331 0.000 0.683 0.538 .ine10 0.633 0.047 13.388 0.000 0.633 0.500 .ine12 0.662 0.050 13.270 0.000 0.662 0.492 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.723 .sisoe7 0.743 0.039 19.078 0.000 0.743 0.715 .sisoe10 0.812 0.045 17.861 0.000 0.812 0.668 .sisoe12 0.871 0.045 19.145 0.000 0.871 0.723 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.664 0.107 6.185 0.000 1.000 1.000 RIsi 0.359 0.071 5.027 0.000 1.000 1.000 wad5 1.099 0.152 7.210 0.000 1.000 1.000 wsi5 0.652 0.100 6.507 0.000 1.000 1.000 .wad7 0.871 0.114 7.633 0.000 0.921 0.921 .wsi7 0.707 0.098 7.211 0.000 0.983 0.983 .wad10 0.931 0.161 5.801 0.000 0.992 0.992 .wsi10 1.087 0.153 7.081 0.000 0.972 0.972 .wad12 1.033 0.141 7.340 0.000 0.900 0.900 .wsi12 0.841 0.077 10.890 0.000 0.769 0.769 .ine5 0.000 0.000 0.000 .ine7 0.000 0.000 0.000 .ine10 0.000 0.000 0.000 .ine12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 1.029 0.633 ine7 1.000 1.029 0.672 ine10 1.000 1.029 0.691 ine12 1.000 1.029 0.649 RIsi =~
sisoe5 1.000 0.829 0.606 sisoe7 1.000 0.829 0.616 sisoe10 1.000 0.829 0.573 sisoe12 1.000 0.829 0.493 wad5 =~
ine5 1.000 1.258 0.774 wad7 =~
ine7 1.000 1.133 0.740 wad10 =~
ine10 1.000 1.076 0.723 wad12 =~
ine12 1.000 1.207 0.761 wsi5 =~
sisoe5 1.000 1.090 0.796 wsi7 =~
sisoe7 1.000 1.062 0.788 wsi10 =~
sisoe10 1.000 1.185 0.819 wsi12 =~
sisoe12 1.000 1.462 0.870

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.087 0.076 1.145 0.252 0.097 0.097 wsi5 (d2) 0.090 0.053 1.704 0.088 0.086 0.086 wsi7 ~
wad5 (c2) 0.106 0.046 2.302 0.021 0.126 0.126 wsi5 0.233 0.101 2.306 0.021 0.239 0.239 wad10 ~
wad7 0.054 0.094 0.573 0.566 0.057 0.057 wsi7 (d2) 0.090 0.053 1.704 0.088 0.089 0.089 wsi10 ~
wad7 (c2) 0.106 0.046 2.302 0.021 0.102 0.102 wsi7 0.239 0.106 2.247 0.025 0.214 0.214 wad12 ~
wad10 0.328 0.089 3.678 0.000 0.292 0.292 wsi10 (d2) 0.090 0.053 1.704 0.088 0.088 0.088 wsi12 ~
wad10 (c2) 0.106 0.046 2.302 0.021 0.078 0.078 wsi10 0.492 0.072 6.799 0.000 0.399 0.399

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.519 0.169 3.074 0.002 0.378 0.378 .wad7 ~~
.wsi7 0.364 0.107 3.414 0.001 0.322 0.322 .wad10 ~~
.wsi10 0.369 0.116 3.187 0.001 0.302 0.302 .wad12 ~~
.wsi12 0.452 0.107 4.229 0.000 0.301 0.301 RIad ~~
RIsi 0.466 0.087 5.382 0.000 0.546 0.546

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 1.197 0.059 20.267 0.000 1.197 0.737 .ine7 0.958 0.057 16.744 0.000 0.958 0.626 .ine10 0.951 0.055 17.304 0.000 0.951 0.639 .ine12 0.906 0.059 15.281 0.000 0.906 0.571 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.741 .sisoe7 1.042 0.050 20.840 0.000 1.042 0.773 .sisoe10 1.181 0.054 21.741 0.000 1.181 0.816 .sisoe12 1.252 0.063 19.963 0.000 1.252 0.745 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.058 0.133 7.955 0.000 1.000 1.000 RIsi 0.688 0.133 5.165 0.000 1.000 1.000 wad5 1.583 0.203 7.814 0.000 1.000 1.000 wsi5 1.187 0.258 4.608 0.000 1.000 1.000 .wad7 1.254 0.177 7.080 0.000 0.977 0.977 .wsi7 1.019 0.147 6.943 0.000 0.904 0.904 .wad10 1.140 0.171 6.679 0.000 0.985 0.985 .wsi10 1.305 0.158 8.256 0.000 0.929 0.929 .wad12 1.298 0.148 8.772 0.000 0.890 0.890 .wsi12 1.741 0.201 8.647 0.000 0.815 0.815 .ine5 0.000 0.000 0.000 .ine7 0.000 0.000 0.000 .ine10 0.000 0.000 0.000 .ine12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.776 0.621 ine7 1.000 0.776 0.702 ine10 1.000 0.776 0.626 ine12 1.000 0.776 0.726 RIsi =~
sisoe5 1.000 0.544 0.542 sisoe7 1.000 0.544 0.509 sisoe10 1.000 0.544 0.472 sisoe12 1.000 0.544 0.517 wad5 =~
ine5 1.000 0.979 0.784 wad7 =~
ine7 1.000 0.787 0.712 wad10 =~
ine10 1.000 0.966 0.780 wad12 =~
ine12 1.000 0.735 0.688 wsi5 =~
sisoe5 1.000 0.844 0.840 wsi7 =~
sisoe7 1.000 0.921 0.861 wsi10 =~
sisoe10 1.000 1.016 0.881 wsi12 =~
sisoe12 1.000 0.901 0.856

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.109 0.079 1.381 0.167 0.136 0.136 wsi5 (d3) 0.031 0.044 0.688 0.492 0.033 0.033 wsi7 ~
wad5 (c3) -0.052 0.050 -1.046 0.296 -0.056 -0.056 wsi5 0.295 0.083 3.558 0.000 0.271 0.271 wad10 ~
wad7 -0.028 0.135 -0.207 0.836 -0.023 -0.023 wsi7 (d3) 0.031 0.044 0.688 0.492 0.029 0.029 wsi10 ~
wad7 (c3) -0.052 0.050 -1.046 0.296 -0.041 -0.041 wsi7 0.367 0.082 4.488 0.000 0.333 0.333 wad12 ~
wad10 0.094 0.067 1.393 0.164 0.123 0.123 wsi10 (d3) 0.031 0.044 0.688 0.492 0.042 0.042 wsi12 ~
wad10 (c3) -0.052 0.050 -1.046 0.296 -0.056 -0.056 wsi10 0.284 0.067 4.232 0.000 0.320 0.320

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.176 0.059 3.007 0.003 0.213 0.213 .wad7 ~~
.wsi7 0.034 0.053 0.655 0.512 0.050 0.050 .wad10 ~~
.wsi10 0.193 0.071 2.717 0.007 0.209 0.209 .wad12 ~~
.wsi12 0.102 0.043 2.388 0.017 0.163 0.163 RIad ~~
RIsi 0.215 0.048 4.476 0.000 0.510 0.510

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.666 0.045 14.671 0.000 0.666 0.533 .ine7 0.517 0.041 12.596 0.000 0.517 0.468 .ine10 0.593 0.047 12.664 0.000 0.593 0.478 .ine12 0.455 0.039 11.737 0.000 0.455 0.426 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.696 .sisoe7 0.709 0.040 17.923 0.000 0.709 0.663 .sisoe10 0.824 0.043 19.159 0.000 0.824 0.715 .sisoe12 0.701 0.040 17.610 0.000 0.701 0.666 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.602 0.096 6.270 0.000 1.000 1.000 RIsi 0.296 0.065 4.538 0.000 1.000 1.000 wad5 0.958 0.146 6.565 0.000 1.000 1.000 wsi5 0.713 0.094 7.572 0.000 1.000 1.000 .wad7 0.606 0.105 5.757 0.000 0.979 0.979 .wsi7 0.789 0.114 6.921 0.000 0.930 0.930 .wad10 0.931 0.176 5.288 0.000 0.999 0.999 .wsi10 0.917 0.103 8.921 0.000 0.889 0.889 .wad12 0.530 0.107 4.970 0.000 0.981 0.981 .wsi12 0.731 0.085 8.654 0.000 0.902 0.902 .ine5 0.000 0.000 0.000 .ine7 0.000 0.000 0.000 .ine10 0.000 0.000 0.000 .ine12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000

#Table of model fit 
RICLPMcomb_inat.lag.c.fit.summary.fit <- table.model.fit(RICLPMcomb_inat.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPMcomb_inat.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPMcomb_inat.lag.c.fit.summary, ses = "Low")
RICLPMcomb_inat.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPMcomb_inat.lag.c.fit.summary, ses = "Middle")
RICLPMcomb_inat.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPMcomb_inat.lag.c.fit.summary, ses = "High")

RICLPMcomb_hyp.lag.c.fit.summary.reg.high %>% select(lhs, op, rhs, std.all, pvalue) %>% mutate_if(is.numeric, round, 4)

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPMcomb_inat.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y

  # Create within-person centered variables
  wad5 =~ 1*ine5
  wad7 =~ 1*ine7
  wad10 =~ 1*ine10 
  wad12 =~ 1*ine12
  wsi5 =~ 1*sisoe5
  wsi7 =~ 1*sisoe7
  wsi10 =~ 1*sisoe10
  wsi12 =~ 1*sisoe12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a1,a1,a1)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b1,b1,b1)*wsi5
  
  wad10 ~ c(a2,a2,a2)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b2,b2,b2)*wsi7
  
  wad12 ~ c(a3,a3,a3)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b3,b3,b3)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPMcomb_inat.ses.lag.c.fit <- lavaan(RICLPMcomb_inat.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPMcomb_inat.lag.c.fit, RICLPMcomb_inat.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust statistics: The chi-square difference test of these two nested models is significant (p=0.01348),

Mother report

RI-CLPM - total ADHD symptoms

RICLPM.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x
  RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y

  # Create within-person centered variables
  wad5 =~ 1*tadhdem5
  wad7 =~ 1*tadhdem7
  wad10 =~ 1*tadhdem10 
  wad12 =~ 1*tadhdem12
  wsi5 =~ 1*sisoem5
  wsi7 =~ 1*sisoem7
  wsi10 =~ 1*sisoem10
  wsi12 =~ 1*sisoem12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags. 
  wad7 ~ wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + wsi5
  
  wad10 ~ wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + wsi7
  
  wad12 ~ wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPM.lag.c.fit <- lavaan(RICLPM.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPM.lag.c.fit.summary <- summary(RICLPM.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 328 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 12

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 10 High 8

Model Test User Model: Standard Robust Test Statistic 131.241 85.355 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.538 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 45.902 29.853 Low 62.316 40.528 High 23.024 14.974

Model Test Baseline Model:

Test statistic 6402.441 3691.661 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 1.734

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.985 0.987 Tucker-Lewis Index (TLI) 0.969 0.972

Robust Comparative Fit Index (CFI) 0.989 Robust Tucker-Lewis Index (TLI) 0.975

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -36006.915 -36006.915 Scaling correction factor 1.847 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.923 for the MLR correction

Akaike (AIC) 72199.830 72199.830 Bayesian (BIC) 72730.921 72730.921 Sample-size adjusted Bayesian (BIC) 72435.445 72435.445

Root Mean Square Error of Approximation:

RMSEA 0.056 0.040 90 Percent confidence interval - lower 0.046 0.031 90 Percent confidence interval - upper 0.067 0.049 P-value RMSEA <= 0.05 0.152 0.962

Robust RMSEA 0.050 90 Percent confidence interval - lower 0.035 90 Percent confidence interval - upper 0.064

Standardized Root Mean Square Residual:

SRMR 0.034 0.034

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhdem5 1.000 2.489 0.635 tadhdem7 1.000 2.489 0.696 tadhdem10 1.000 2.489 0.771 tadhdem12 1.000 2.489 0.744 RIsi =~
sisoem5 1.000 0.723 0.537 sisoem7 1.000 0.723 0.524 sisoem10 1.000 0.723 0.493 sisoem12 1.000 0.723 0.487 wad5 =~
tadhdem5 1.000 3.029 0.773 wad7 =~
tadhdem7 1.000 2.566 0.718 wad10 =~
tadhdem10 1.000 2.054 0.636 wad12 =~
tadhdem12 1.000 2.233 0.668 wsi5 =~
sisoem5 1.000 1.135 0.843 wsi7 =~
sisoem7 1.000 1.175 0.852 wsi10 =~
sisoem10 1.000 1.275 0.870 wsi12 =~
sisoem12 1.000 1.296 0.873

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.264 0.068 3.880 0.000 0.311 0.311 wsi5 (d1) 0.005 0.097 0.049 0.961 0.002 0.002 wsi7 ~
wad5 (c1) 0.020 0.021 0.964 0.335 0.052 0.052 wsi5 0.257 0.092 2.807 0.005 0.248 0.248 wad10 ~
wad7 0.004 0.106 0.037 0.971 0.005 0.005 wsi7 (d1) 0.005 0.097 0.049 0.961 0.003 0.003 wsi10 ~
wad7 (c1) 0.020 0.021 0.964 0.335 0.041 0.041 wsi7 0.308 0.096 3.219 0.001 0.284 0.284 wad12 ~
wad10 0.303 0.123 2.465 0.014 0.278 0.278 wsi10 (d1) 0.005 0.097 0.049 0.961 0.003 0.003 wsi12 ~
wad10 (c1) 0.020 0.021 0.964 0.335 0.032 0.032 wsi10 0.509 0.063 8.135 0.000 0.500 0.500

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.947 0.279 3.391 0.001 0.275 0.275 .wad7 ~~
.wsi7 0.309 0.214 1.448 0.148 0.112 0.112 .wad10 ~~
.wsi10 0.411 0.183 2.254 0.024 0.164 0.164 .wad12 ~~
.wsi12 0.374 0.145 2.570 0.010 0.156 0.156 RIad ~~
RIsi 0.929 0.184 5.050 0.000 0.516 0.516

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem5 3.190 0.142 22.499 0.000 3.190 0.814 .tadhdem7 2.604 0.136 19.111 0.000 2.604 0.728 .tadhdem10 1.926 0.120 16.046 0.000 1.926 0.597 .tadhdem12 1.949 0.123 15.833 0.000 1.949 0.583 .sisoem5 0.902 0.049 18.330 0.000 0.902 0.671 .sisoem7 0.857 0.052 16.477 0.000 0.857 0.621 .sisoem10 0.967 0.055 17.688 0.000 0.967 0.660 .sisoem12 0.969 0.056 17.347 0.000 0.969 0.653 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 6.196 0.795 7.790 0.000 1.000 1.000 RIsi 0.522 0.105 4.984 0.000 1.000 1.000 wad5 9.173 0.912 10.061 0.000 1.000 1.000 wsi5 1.287 0.178 7.213 0.000 1.000 1.000 .wad7 5.945 0.687 8.648 0.000 0.903 0.903 .wsi7 1.282 0.171 7.483 0.000 0.929 0.929 .wad10 4.219 0.926 4.557 0.000 1.000 1.000 .wsi10 1.486 0.177 8.393 0.000 0.914 0.914 .wad12 4.600 0.604 7.622 0.000 0.922 0.922 .wsi12 1.249 0.116 10.741 0.000 0.744 0.744 .tadhdem5 0.000 0.000 0.000 .tadhdem7 0.000 0.000 0.000 .tadhdem10 0.000 0.000 0.000 .tadhdem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhdem5 1.000 2.676 0.626 tadhdem7 1.000 2.676 0.666 tadhdem10 1.000 2.676 0.688 tadhdem12 1.000 2.676 0.690 RIsi =~
sisoem5 1.000 1.202 0.701 sisoem7 1.000 1.202 0.679 sisoem10 1.000 1.202 0.619 sisoem12 1.000 1.202 0.588 wad5 =~
tadhdem5 1.000 3.331 0.780 wad7 =~
tadhdem7 1.000 2.998 0.746 wad10 =~
tadhdem10 1.000 2.821 0.726 wad12 =~
tadhdem12 1.000 2.806 0.724 wsi5 =~
sisoem5 1.000 1.222 0.713 wsi7 =~
sisoem7 1.000 1.301 0.734 wsi10 =~
sisoem10 1.000 1.527 0.786 wsi12 =~
sisoem12 1.000 1.652 0.809

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.224 0.069 3.230 0.001 0.249 0.249 wsi5 (d2) 0.121 0.117 1.032 0.302 0.049 0.049 wsi7 ~
wad5 (c2) 0.056 0.025 2.292 0.022 0.144 0.144 wsi5 0.166 0.108 1.545 0.122 0.156 0.156 wad10 ~
wad7 0.130 0.102 1.275 0.202 0.138 0.138 wsi7 (d2) 0.121 0.117 1.032 0.302 0.056 0.056 wsi10 ~
wad7 (c2) 0.056 0.025 2.292 0.022 0.110 0.110 wsi7 0.118 0.121 0.978 0.328 0.101 0.101 wad12 ~
wad10 0.395 0.083 4.748 0.000 0.397 0.397 wsi10 (d2) 0.121 0.117 1.032 0.302 0.066 0.066 wsi12 ~
wad10 (c2) 0.056 0.025 2.292 0.022 0.096 0.096 wsi10 0.405 0.079 5.102 0.000 0.374 0.374

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.622 0.249 2.497 0.013 0.153 0.153 .wad7 ~~
.wsi7 0.925 0.305 3.029 0.002 0.252 0.252 .wad10 ~~
.wsi10 1.273 0.313 4.063 0.000 0.304 0.304 .wad12 ~~
.wsi12 1.238 0.261 4.736 0.000 0.324 0.324 RIad ~~
RIsi 1.398 0.321 4.355 0.000 0.434 0.434

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem5 4.326 0.156 27.785 0.000 4.326 1.013 .tadhdem7 3.405 0.150 22.724 0.000 3.405 0.847 .tadhdem10 2.993 0.145 20.689 0.000 2.993 0.770 .tadhdem12 2.804 0.146 19.221 0.000 2.804 0.723 .sisoem5 1.228 0.061 19.977 0.000 1.228 0.716 .sisoem7 1.291 0.067 19.299 0.000 1.291 0.729 .sisoem10 1.379 0.073 18.939 0.000 1.379 0.710 .sisoem12 1.385 0.076 18.272 0.000 1.385 0.678 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 7.159 0.906 7.900 0.000 1.000 1.000 RIsi 1.446 0.236 6.120 0.000 1.000 1.000 wad5 11.093 0.840 13.210 0.000 1.000 1.000 wsi5 1.493 0.260 5.741 0.000 1.000 1.000 .wad7 8.379 0.938 8.935 0.000 0.932 0.932 .wsi7 1.604 0.221 7.247 0.000 0.948 0.948 .wad10 7.746 0.925 8.376 0.000 0.973 0.973 .wsi10 2.265 0.252 8.999 0.000 0.971 0.971 .wad12 6.464 0.559 11.558 0.000 0.821 0.821 .wsi12 2.259 0.227 9.969 0.000 0.827 0.827 .tadhdem5 0.000 0.000 0.000 .tadhdem7 0.000 0.000 0.000 .tadhdem10 0.000 0.000 0.000 .tadhdem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhdem5 1.000 2.225 0.611 tadhdem7 1.000 2.225 0.710 tadhdem10 1.000 2.225 0.769 tadhdem12 1.000 2.225 0.798 RIsi =~
sisoem5 1.000 0.609 0.487 sisoem7 1.000 0.609 0.472 sisoem10 1.000 0.609 0.452 sisoem12 1.000 0.609 0.479 wad5 =~
tadhdem5 1.000 2.886 0.792 wad7 =~
tadhdem7 1.000 2.206 0.704 wad10 =~
tadhdem10 1.000 1.852 0.640 wad12 =~
tadhdem12 1.000 1.678 0.602 wsi5 =~
sisoem5 1.000 1.093 0.873 wsi7 =~
sisoem7 1.000 1.136 0.881 wsi10 =~
sisoem10 1.000 1.202 0.892 wsi12 =~
sisoem12 1.000 1.117 0.878

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.256 0.060 4.247 0.000 0.335 0.335 wsi5 (d3) 0.081 0.091 0.892 0.372 0.040 0.040 wsi7 ~
wad5 (c3) 0.005 0.018 0.289 0.772 0.013 0.013 wsi5 0.310 0.085 3.652 0.000 0.298 0.298 wad10 ~
wad7 -0.040 0.098 -0.407 0.684 -0.047 -0.047 wsi7 (d3) 0.081 0.091 0.892 0.372 0.050 0.050 wsi10 ~
wad7 (c3) 0.005 0.018 0.289 0.772 0.010 0.010 wsi7 0.363 0.078 4.683 0.000 0.343 0.343 wad12 ~
wad10 0.176 0.133 1.317 0.188 0.194 0.194 wsi10 (d3) 0.081 0.091 0.892 0.372 0.058 0.058 wsi12 ~
wad10 (c3) 0.005 0.018 0.289 0.772 0.009 0.009 wsi10 0.378 0.068 5.590 0.000 0.407 0.407

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.688 0.260 2.645 0.008 0.218 0.218 .wad7 ~~
.wsi7 0.085 0.128 0.666 0.505 0.038 0.038 .wad10 ~~
.wsi10 0.519 0.167 3.105 0.002 0.249 0.249 .wad12 ~~
.wsi12 0.207 0.108 1.911 0.056 0.124 0.124 RIad ~~
RIsi 0.559 0.145 3.859 0.000 0.412 0.412

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem5 2.600 0.131 19.827 0.000 2.600 0.714 .tadhdem7 1.886 0.115 16.334 0.000 1.886 0.602 .tadhdem10 1.661 0.108 15.340 0.000 1.661 0.574 .tadhdem12 1.354 0.103 13.133 0.000 1.354 0.486 .sisoem5 0.794 0.045 17.622 0.000 0.794 0.635 .sisoem7 0.813 0.048 17.000 0.000 0.813 0.631 .sisoem10 0.946 0.050 18.852 0.000 0.946 0.702 .sisoem12 0.790 0.048 16.611 0.000 0.790 0.621 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 4.951 0.752 6.587 0.000 1.000 1.000 RIsi 0.371 0.107 3.480 0.001 1.000 1.000 wad5 8.327 0.951 8.759 0.000 1.000 1.000 wsi5 1.194 0.184 6.480 0.000 1.000 1.000 .wad7 4.285 0.555 7.719 0.000 0.881 0.881 .wsi7 1.174 0.143 8.218 0.000 0.909 0.909 .wad10 3.414 0.721 4.734 0.000 0.996 0.996 .wsi10 1.273 0.129 9.880 0.000 0.881 0.881 .wad12 2.683 0.447 5.998 0.000 0.954 0.954 .wsi12 1.039 0.127 8.176 0.000 0.833 0.833 .tadhdem5 0.000 0.000 0.000 .tadhdem7 0.000 0.000 0.000 .tadhdem10 0.000 0.000 0.000 .tadhdem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

#Table of model fit 
RICLPM.lag.c.fit.summary.fit <- table.model.fit(RICLPM.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPM.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPM.lag.c.fit.summary, ses = "Low")
RICLPM.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPM.lag.c.fit.summary, ses = "Middle")
RICLPM.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPM.lag.c.fit.summary, ses = "High")

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPM.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x
  RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y

  # Create within-person centered variables
  wad5 =~ 1*tadhdem5
  wad7 =~ 1*tadhdem7
  wad10 =~ 1*tadhdem10 
  wad12 =~ 1*tadhdem12
  wsi5 =~ 1*sisoem5
  wsi7 =~ 1*sisoem7
  wsi10 =~ 1*sisoem10
  wsi12 =~ 1*sisoem12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a1,a1,a1)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b1,b1,b1)*wsi5
  
  wad10 ~ c(a2,a2,a2)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b2,b2,b2)*wsi7
  
  wad12 ~ c(a3,a3,a3)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b3,b3,b3)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPM.ses.lag.c.fit <- lavaan(RICLPM.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPM.lag.c.fit, RICLPM.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust test statistics (MLR estimation and satorra.bentler.2010 LRT method): The chi-square difference test of these two nested models is non significant (p=0.5758).

For non-rubust statistics: The chi-square difference test of these two nested models is significant (p=0.009818), which implies that the lagged effects appear to be the different for different levels of SES

SES differences found: - Low SES has significant ADHD -> social isolation cross-lag (p=0.022) - Non-significant cross-lags in middle SES. - Non-significant cross-lags in high SES. - Some differences in atuoregressive paths - but need to see what this means

RI-CLPM - Hyperactivity ADHD symptoms

RICLPM_hyp.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*hyem5 + 1*hyem7 + 1*hyem10 + 1*hyem12 #x
  RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y

  # Create within-person centered variables
  wad5 =~ 1*hyem5
  wad7 =~ 1*hyem7
  wad10 =~ 1*hyem10 
  wad12 =~ 1*hyem12
  wsi5 =~ 1*sisoem5
  wsi7 =~ 1*sisoem7
  wsi10 =~ 1*sisoem10
  wsi12 =~ 1*sisoem12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags. 
  wad7 ~ wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + wsi5
  
  wad10 ~ wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + wsi7
  
  wad12 ~ wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPM_hyp.lag.c.fit <- lavaan(RICLPM_hyp.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPM_hyp.lag.c.fit.summary <- summary(RICLPM_hyp.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 166 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 12

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 10 High 8

Model Test User Model: Standard Robust Test Statistic 117.523 81.050 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.450 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 42.052 29.001 Low 50.062 34.525 High 25.410 17.524

Model Test Baseline Model:

Test statistic 6013.687 3674.936 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 1.636

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.987 0.988 Tucker-Lewis Index (TLI) 0.971 0.975

Robust Comparative Fit Index (CFI) 0.990 Robust Tucker-Lewis Index (TLI) 0.978

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -31652.274 -31652.274 Scaling correction factor 1.727 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.802 for the MLR correction

Akaike (AIC) 63490.548 63490.548 Bayesian (BIC) 64021.639 64021.639 Sample-size adjusted Bayesian (BIC) 63726.163 63726.163

Root Mean Square Error of Approximation:

RMSEA 0.052 0.038 90 Percent confidence interval - lower 0.041 0.028 90 Percent confidence interval - upper 0.063 0.048 P-value RMSEA <= 0.05 0.361 0.980

Robust RMSEA 0.046 90 Percent confidence interval - lower 0.032 90 Percent confidence interval - upper 0.060

Standardized Root Mean Square Residual:

SRMR 0.032 0.032

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyem5 1.000 1.411 0.606 hyem7 1.000 1.411 0.628 hyem10 1.000 1.411 0.741 hyem12 1.000 1.411 0.739 RIsi =~
sisoem5 1.000 0.739 0.551 sisoem7 1.000 0.739 0.538 sisoem10 1.000 0.739 0.502 sisoem12 1.000 0.739 0.496 wad5 =~
hyem5 1.000 1.854 0.796 wad7 =~
hyem7 1.000 1.749 0.778 wad10 =~
hyem10 1.000 1.280 0.672 wad12 =~
hyem12 1.000 1.286 0.674 wsi5 =~
sisoem5 1.000 1.120 0.835 wsi7 =~
sisoem7 1.000 1.159 0.843 wsi10 =~
sisoem10 1.000 1.272 0.865 wsi12 =~
sisoem12 1.000 1.293 0.868

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.317 0.064 4.960 0.000 0.336 0.336 wsi5 (d1) 0.034 0.058 0.586 0.558 0.022 0.022 wsi7 ~
wad5 (c1) 0.049 0.031 1.565 0.118 0.079 0.079 wsi5 0.234 0.093 2.501 0.012 0.226 0.226 wad10 ~
wad7 0.089 0.085 1.053 0.293 0.122 0.122 wsi7 (d1) 0.034 0.058 0.586 0.558 0.031 0.031 wsi10 ~
wad7 (c1) 0.049 0.031 1.565 0.118 0.068 0.068 wsi7 0.295 0.093 3.155 0.002 0.269 0.269 wad12 ~
wad10 0.297 0.114 2.603 0.009 0.295 0.295 wsi10 (d1) 0.034 0.058 0.586 0.558 0.034 0.034 wsi12 ~
wad10 (c1) 0.049 0.031 1.565 0.118 0.049 0.049 wsi10 0.501 0.060 8.347 0.000 0.493 0.493

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.473 0.146 3.236 0.001 0.228 0.228 .wad7 ~~
.wsi7 0.186 0.118 1.568 0.117 0.101 0.101 .wad10 ~~
.wsi10 0.289 0.114 2.549 0.011 0.187 0.187 .wad12 ~~
.wsi12 0.131 0.082 1.600 0.110 0.096 0.096 RIad ~~
RIsi 0.424 0.102 4.179 0.000 0.407 0.407

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyem5 2.071 0.084 24.532 0.000 2.071 0.889 .hyem7 1.711 0.086 19.960 0.000 1.711 0.761 .hyem10 1.103 0.071 15.566 0.000 1.103 0.579 .hyem12 1.044 0.070 14.856 0.000 1.044 0.547 .sisoem5 0.902 0.049 18.330 0.000 0.902 0.672 .sisoem7 0.856 0.052 16.478 0.000 0.856 0.623 .sisoem10 0.967 0.055 17.666 0.000 0.967 0.658 .sisoem12 0.970 0.056 17.360 0.000 0.970 0.651 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.991 0.258 7.710 0.000 1.000 1.000 RIsi 0.546 0.108 5.042 0.000 1.000 1.000 wad5 3.436 0.285 12.047 0.000 1.000 1.000 wsi5 1.254 0.177 7.104 0.000 1.000 1.000 .wad7 2.703 0.253 10.666 0.000 0.883 0.883 .wsi7 1.256 0.172 7.309 0.000 0.935 0.935 .wad10 1.612 0.293 5.500 0.000 0.983 0.983 .wsi10 1.485 0.177 8.411 0.000 0.918 0.918 .wad12 1.501 0.192 7.835 0.000 0.908 0.908 .wsi12 1.246 0.115 10.821 0.000 0.745 0.745 .hyem5 0.000 0.000 0.000 .hyem7 0.000 0.000 0.000 .hyem10 0.000 0.000 0.000 .hyem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyem5 1.000 1.569 0.604 hyem7 1.000 1.569 0.663 hyem10 1.000 1.569 0.685 hyem12 1.000 1.569 0.691 RIsi =~
sisoem5 1.000 1.208 0.704 sisoem7 1.000 1.208 0.683 sisoem10 1.000 1.208 0.620 sisoem12 1.000 1.208 0.591 wad5 =~
hyem5 1.000 2.070 0.797 wad7 =~
hyem7 1.000 1.773 0.749 wad10 =~
hyem10 1.000 1.667 0.728 wad12 =~
hyem12 1.000 1.640 0.722 wsi5 =~
sisoem5 1.000 1.219 0.710 wsi7 =~
sisoem7 1.000 1.291 0.730 wsi10 =~
sisoem10 1.000 1.527 0.784 wsi12 =~
sisoem12 1.000 1.648 0.806

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.215 0.054 4.010 0.000 0.251 0.251 wsi5 (d2) 0.059 0.065 0.905 0.366 0.041 0.041 wsi7 ~
wad5 (c2) 0.058 0.035 1.653 0.098 0.094 0.094 wsi5 0.173 0.107 1.618 0.106 0.164 0.164 wad10 ~
wad7 0.118 0.078 1.500 0.134 0.125 0.125 wsi7 (d2) 0.059 0.065 0.905 0.366 0.046 0.046 wsi10 ~
wad7 (c2) 0.058 0.035 1.653 0.098 0.068 0.068 wsi7 0.136 0.121 1.130 0.259 0.115 0.115 wad12 ~
wad10 0.288 0.076 3.784 0.000 0.293 0.293 wsi10 (d2) 0.059 0.065 0.905 0.366 0.055 0.055 wsi12 ~
wad10 (c2) 0.058 0.035 1.653 0.098 0.059 0.059 wsi10 0.415 0.079 5.263 0.000 0.385 0.385

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.128 0.131 0.972 0.331 0.051 0.051 .wad7 ~~
.wsi7 0.401 0.154 2.608 0.009 0.185 0.185 .wad10 ~~
.wsi10 0.712 0.192 3.701 0.000 0.285 0.285 .wad12 ~~
.wsi12 0.687 0.151 4.536 0.000 0.293 0.293 RIad ~~
RIsi 0.703 0.168 4.194 0.000 0.371 0.371

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyem5 2.767 0.096 28.963 0.000 2.767 1.065 .hyem7 2.143 0.088 24.448 0.000 2.143 0.905 .hyem10 1.714 0.085 20.081 0.000 1.714 0.748 .hyem12 1.607 0.085 18.806 0.000 1.607 0.708 .sisoem5 1.228 0.061 19.978 0.000 1.228 0.716 .sisoem7 1.292 0.067 19.297 0.000 1.292 0.731 .sisoem10 1.380 0.073 18.947 0.000 1.380 0.709 .sisoem12 1.386 0.076 18.276 0.000 1.386 0.679 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 2.463 0.243 10.142 0.000 1.000 1.000 RIsi 1.459 0.233 6.275 0.000 1.000 1.000 wad5 4.284 0.284 15.078 0.000 1.000 1.000 wsi5 1.485 0.260 5.716 0.000 1.000 1.000 .wad7 2.937 0.263 11.153 0.000 0.934 0.934 .wsi7 1.605 0.215 7.451 0.000 0.963 0.963 .wad10 2.724 0.274 9.946 0.000 0.980 0.980 .wsi10 2.282 0.252 9.039 0.000 0.979 0.979 .wad12 2.424 0.203 11.954 0.000 0.902 0.902 .wsi12 2.266 0.225 10.063 0.000 0.835 0.835 .hyem5 0.000 0.000 0.000 .hyem7 0.000 0.000 0.000 .hyem10 0.000 0.000 0.000 .hyem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyem5 1.000 1.286 0.574 hyem7 1.000 1.286 0.665 hyem10 1.000 1.286 0.783 hyem12 1.000 1.286 0.826 RIsi =~
sisoem5 1.000 0.603 0.482 sisoem7 1.000 0.603 0.469 sisoem10 1.000 0.603 0.448 sisoem12 1.000 0.603 0.474 wad5 =~
hyem5 1.000 1.836 0.819 wad7 =~
hyem7 1.000 1.442 0.746 wad10 =~
hyem10 1.000 1.023 0.623 wad12 =~
hyem12 1.000 0.877 0.563 wsi5 =~
sisoem5 1.000 1.096 0.876 wsi7 =~
sisoem7 1.000 1.136 0.883 wsi10 =~
sisoem10 1.000 1.204 0.894 wsi12 =~
sisoem12 1.000 1.120 0.880

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.313 0.048 6.465 0.000 0.398 0.398 wsi5 (d3) 0.028 0.058 0.491 0.624 0.022 0.022 wsi7 ~
wad5 (c3) 0.009 0.028 0.317 0.751 0.015 0.015 wsi5 0.311 0.086 3.626 0.000 0.301 0.301 wad10 ~
wad7 0.018 0.084 0.216 0.829 0.026 0.026 wsi7 (d3) 0.028 0.058 0.491 0.624 0.031 0.031 wsi10 ~
wad7 (c3) 0.009 0.028 0.317 0.751 0.011 0.011 wsi7 0.366 0.080 4.544 0.000 0.345 0.345 wad12 ~
wad10 0.087 0.165 0.529 0.597 0.102 0.102 wsi10 (d3) 0.028 0.058 0.491 0.624 0.039 0.039 wsi12 ~
wad10 (c3) 0.009 0.028 0.317 0.751 0.008 0.008 wsi10 0.379 0.068 5.561 0.000 0.408 0.408

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.379 0.155 2.448 0.014 0.188 0.188 .wad7 ~~
.wsi7 0.039 0.081 0.481 0.631 0.027 0.027 .wad10 ~~
.wsi10 0.236 0.094 2.507 0.012 0.204 0.204 .wad12 ~~
.wsi12 0.062 0.059 1.036 0.300 0.069 0.069 RIad ~~
RIsi 0.328 0.084 3.913 0.000 0.423 0.423

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyem5 1.650 0.080 20.546 0.000 1.650 0.736 .hyem7 1.201 0.071 16.862 0.000 1.201 0.622 .hyem10 0.872 0.062 14.148 0.000 0.872 0.530 .hyem12 0.668 0.057 11.663 0.000 0.668 0.429 .sisoem5 0.794 0.045 17.622 0.000 0.794 0.635 .sisoem7 0.813 0.048 17.007 0.000 0.813 0.632 .sisoem10 0.946 0.050 18.843 0.000 0.946 0.702 .sisoem12 0.790 0.048 16.623 0.000 0.790 0.621 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.653 0.240 6.892 0.000 1.000 1.000 RIsi 0.364 0.107 3.408 0.001 1.000 1.000 wad5 3.369 0.314 10.735 0.000 1.000 1.000 wsi5 1.202 0.185 6.497 0.000 1.000 1.000 .wad7 1.743 0.168 10.387 0.000 0.838 0.838 .wsi7 1.171 0.145 8.066 0.000 0.908 0.908 .wad10 1.045 0.243 4.308 0.000 0.998 0.998 .wsi10 1.276 0.130 9.807 0.000 0.880 0.880 .wad12 0.758 0.151 5.024 0.000 0.987 0.987 .wsi12 1.043 0.126 8.267 0.000 0.832 0.832 .hyem5 0.000 0.000 0.000 .hyem7 0.000 0.000 0.000 .hyem10 0.000 0.000 0.000 .hyem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

#Table of model fit 
RICLPM_hyp.lag.c.fit.summary.fit <- table.model.fit(RICLPM_hyp.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPM_hyp.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPM_hyp.lag.c.fit.summary, ses = "Low")
RICLPM_hyp.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPM_hyp.lag.c.fit.summary, ses = "Middle")
RICLPM_hyp.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPM_hyp.lag.c.fit.summary, ses = "High")

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPM_hyp.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*hyem5 + 1*hyem7 + 1*hyem10 + 1*hyem12 #x
  RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y

  # Create within-person centered variables
  wad5 =~ 1*hyem5
  wad7 =~ 1*hyem7
  wad10 =~ 1*hyem10 
  wad12 =~ 1*hyem12
  wsi5 =~ 1*sisoem5
  wsi7 =~ 1*sisoem7
  wsi10 =~ 1*sisoem10
  wsi12 =~ 1*sisoem12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a1,a1,a1)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b1,b1,b1)*wsi5
  
  wad10 ~ c(a2,a2,a2)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b2,b2,b2)*wsi7
  
  wad12 ~ c(a3,a3,a3)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b3,b3,b3)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPM_hyp.ses.lag.c.fit <- lavaan(RICLPM_hyp.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPM_hyp.lag.c.fit, RICLPM_hyp.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust statistics: The chi-square difference test of these two nested models is non significant (p=0.6128).

Fro non-robust statistics: The chi-square difference test of these two nested models is significant (p=0.02456), which implies that the lagged effects appear to be the different for different levels of SES

SES differences found: - Low SES has non-sig (p=0.098) ADHD -> social isolation cross-lag - Non-significant cross-lags in middle and high SES.

Can conclude here that there are no SES differences - no differences in significance of the cross-lags

RI-CLPM - Inattention ADHD symptoms

RICLPM_inat.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*inem5 + 1*inem7 + 1*inem10 + 1*inem12 #x
  RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y

  # Create within-person centered variables
  wad5 =~ 1*inem5
  wad7 =~ 1*inem7
  wad10 =~ 1*inem10 
  wad12 =~ 1*inem12
  wsi5 =~ 1*sisoem5
  wsi7 =~ 1*sisoem7
  wsi10 =~ 1*sisoem10
  wsi12 =~ 1*sisoem12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags. 
  wad7 ~ wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + wsi5
  
  wad10 ~ wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + wsi7
  
  wad12 ~ wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPM_inat.lag.c.fit <- lavaan(RICLPM_inat.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPM_inat.lag.c.fit.summary <- summary(RICLPM_inat.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 139 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 12

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 9 High 8

Model Test User Model: Standard Robust Test Statistic 128.447 81.025 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.585 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 38.272 24.142 Low 71.939 45.380 High 18.235 11.503

Model Test Baseline Model:

Test statistic 5654.024 3192.320 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 1.771

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.984 0.986 Tucker-Lewis Index (TLI) 0.965 0.971

Robust Comparative Fit Index (CFI) 0.988 Robust Tucker-Lewis Index (TLI) 0.974

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -30594.374 -30594.374 Scaling correction factor 1.937 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.009 for the MLR correction

Akaike (AIC) 61374.748 61374.748 Bayesian (BIC) 61905.838 61905.838 Sample-size adjusted Bayesian (BIC) 61610.363 61610.363

Root Mean Square Error of Approximation:

RMSEA 0.056 0.038 90 Percent confidence interval - lower 0.045 0.029 90 Percent confidence interval - upper 0.066 0.047 P-value RMSEA <= 0.05 0.186 0.984

Robust RMSEA 0.048 90 Percent confidence interval - lower 0.033 90 Percent confidence interval - upper 0.063

Standardized Root Mean Square Residual:

SRMR 0.033 0.033

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
inem5 1.000 1.198 0.609 inem7 1.000 1.198 0.686 inem10 1.000 1.198 0.710 inem12 1.000 1.198 0.671 RIsi =~
sisoem5 1.000 0.730 0.540 sisoem7 1.000 0.730 0.528 sisoem10 1.000 0.730 0.501 sisoem12 1.000 0.730 0.495 wad5 =~
inem5 1.000 1.559 0.793 wad7 =~
inem7 1.000 1.270 0.727 wad10 =~
inem10 1.000 1.186 0.704 wad12 =~
inem12 1.000 1.325 0.742 wsi5 =~
sisoem5 1.000 1.139 0.842 wsi7 =~
sisoem7 1.000 1.173 0.849 wsi10 =~
sisoem10 1.000 1.262 0.866 wsi12 =~
sisoem12 1.000 1.282 0.869

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.199 0.071 2.779 0.005 0.244 0.244 wsi5 (d1) -0.039 0.049 -0.805 0.421 -0.035 -0.035 wsi7 ~
wad5 (c1) 0.002 0.037 0.059 0.953 0.003 0.003 wsi5 0.273 0.091 3.010 0.003 0.265 0.265 wad10 ~
wad7 -0.009 0.109 -0.087 0.931 -0.010 -0.010 wsi7 (d1) -0.039 0.049 -0.805 0.421 -0.039 -0.039 wsi10 ~
wad7 (c1) 0.002 0.037 0.059 0.953 0.002 0.002 wsi7 0.300 0.100 3.005 0.003 0.279 0.279 wad12 ~
wad10 0.325 0.105 3.096 0.002 0.291 0.291 wsi10 (d1) -0.039 0.049 -0.805 0.421 -0.037 -0.037 wsi12 ~
wad10 (c1) 0.002 0.037 0.059 0.953 0.002 0.002 wsi10 0.502 0.064 7.787 0.000 0.494 0.494

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.448 0.148 3.028 0.002 0.252 0.252 .wad7 ~~
.wsi7 0.109 0.112 0.979 0.328 0.078 0.078 .wad10 ~~
.wsi10 0.121 0.093 1.303 0.193 0.084 0.084 .wad12 ~~
.wsi12 0.248 0.083 2.991 0.003 0.176 0.176 RIad ~~
RIsi 0.506 0.099 5.104 0.000 0.579 0.579

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inem5 1.119 0.072 15.591 0.000 1.119 0.569 .inem7 0.893 0.066 13.475 0.000 0.893 0.512 .inem10 0.822 0.063 13.085 0.000 0.822 0.487 .inem12 0.908 0.066 13.781 0.000 0.908 0.508 .sisoem5 0.902 0.049 18.330 0.000 0.902 0.667 .sisoem7 0.857 0.052 16.484 0.000 0.857 0.620 .sisoem10 0.967 0.055 17.719 0.000 0.967 0.663 .sisoem12 0.970 0.056 17.351 0.000 0.970 0.657 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.435 0.219 6.546 0.000 1.000 1.000 RIsi 0.533 0.103 5.171 0.000 1.000 1.000 wad5 2.431 0.257 9.445 0.000 1.000 1.000 wsi5 1.298 0.175 7.396 0.000 1.000 1.000 .wad7 1.522 0.209 7.284 0.000 0.944 0.944 .wsi7 1.280 0.172 7.443 0.000 0.929 0.929 .wad10 1.405 0.280 5.021 0.000 0.998 0.998 .wsi10 1.469 0.179 8.223 0.000 0.922 0.922 .wad12 1.607 0.190 8.435 0.000 0.915 0.915 .wsi12 1.242 0.115 10.782 0.000 0.755 0.755 .inem5 0.000 0.000 0.000 .inem7 0.000 0.000 0.000 .inem10 0.000 0.000 0.000 .inem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
inem5 1.000 1.269 0.600 inem7 1.000 1.269 0.624 inem10 1.000 1.269 0.637 inem12 1.000 1.269 0.628 RIsi =~
sisoem5 1.000 1.198 0.701 sisoem7 1.000 1.198 0.677 sisoem10 1.000 1.198 0.616 sisoem12 1.000 1.198 0.585 wad5 =~
inem5 1.000 1.694 0.800 wad7 =~
inem7 1.000 1.591 0.782 wad10 =~
inem10 1.000 1.535 0.771 wad12 =~
inem12 1.000 1.571 0.778 wsi5 =~
sisoem5 1.000 1.221 0.714 wsi7 =~
sisoem7 1.000 1.304 0.736 wsi10 =~
sisoem10 1.000 1.532 0.788 wsi12 =~
sisoem12 1.000 1.661 0.811

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.168 0.082 2.045 0.041 0.178 0.178 wsi5 (d2) 0.079 0.060 1.322 0.186 0.060 0.060 wsi7 ~
wad5 (c2) 0.124 0.045 2.744 0.006 0.161 0.161 wsi5 0.154 0.108 1.431 0.152 0.144 0.144 wad10 ~
wad7 0.132 0.103 1.282 0.200 0.137 0.137 wsi7 (d2) 0.079 0.060 1.322 0.186 0.067 0.067 wsi10 ~
wad7 (c2) 0.124 0.045 2.744 0.006 0.129 0.129 wsi7 0.122 0.122 1.003 0.316 0.104 0.104 wad12 ~
wad10 0.427 0.080 5.362 0.000 0.417 0.417 wsi10 (d2) 0.079 0.060 1.322 0.186 0.077 0.077 wsi12 ~
wad10 (c2) 0.124 0.045 2.744 0.006 0.114 0.114 wsi10 0.409 0.079 5.181 0.000 0.377 0.377

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.477 0.155 3.084 0.002 0.231 0.231 .wad7 ~~
.wsi7 0.539 0.171 3.156 0.002 0.273 0.273 .wad10 ~~
.wsi10 0.562 0.148 3.808 0.000 0.247 0.247 .wad12 ~~
.wsi12 0.578 0.136 4.239 0.000 0.273 0.273 RIad ~~
RIsi 0.701 0.167 4.205 0.000 0.461 0.461

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inem5 1.559 0.077 20.373 0.000 1.559 0.737 .inem7 1.262 0.077 16.488 0.000 1.262 0.620 .inem10 1.281 0.074 17.322 0.000 1.281 0.643 .inem12 1.195 0.076 15.813 0.000 1.195 0.592 .sisoem5 1.228 0.061 19.976 0.000 1.228 0.718 .sisoem7 1.291 0.067 19.293 0.000 1.291 0.729 .sisoem10 1.379 0.073 18.932 0.000 1.379 0.709 .sisoem12 1.385 0.076 18.266 0.000 1.385 0.676 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.610 0.270 5.961 0.000 1.000 1.000 RIsi 1.436 0.234 6.131 0.000 1.000 1.000 wad5 2.868 0.271 10.568 0.000 1.000 1.000 wsi5 1.490 0.258 5.773 0.000 1.000 1.000 .wad7 2.429 0.313 7.764 0.000 0.960 0.960 .wsi7 1.604 0.220 7.295 0.000 0.943 0.943 .wad10 2.288 0.270 8.478 0.000 0.971 0.971 .wsi10 2.263 0.253 8.935 0.000 0.965 0.965 .wad12 1.982 0.186 10.645 0.000 0.803 0.803 .wsi12 2.267 0.230 9.838 0.000 0.822 0.822 .inem5 0.000 0.000 0.000 .inem7 0.000 0.000 0.000 .inem10 0.000 0.000 0.000 .inem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
inem5 1.000 1.097 0.620 inem7 1.000 1.097 0.713 inem10 1.000 1.097 0.680 inem12 1.000 1.097 0.704 RIsi =~
sisoem5 1.000 0.619 0.497 sisoem7 1.000 0.619 0.479 sisoem10 1.000 0.619 0.457 sisoem12 1.000 0.619 0.484 wad5 =~
inem5 1.000 1.390 0.785 wad7 =~
inem7 1.000 1.079 0.701 wad10 =~
inem10 1.000 1.182 0.733 wad12 =~
inem12 1.000 1.107 0.710 wsi5 =~
sisoem5 1.000 1.081 0.868 wsi7 =~
sisoem7 1.000 1.135 0.878 wsi10 =~
sisoem10 1.000 1.204 0.890 wsi12 =~
sisoem12 1.000 1.117 0.875

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.140 0.074 1.901 0.057 0.181 0.181 wsi5 (d3) 0.060 0.038 1.548 0.122 0.060 0.060 wsi7 ~
wad5 (c3) 0.011 0.032 0.355 0.722 0.014 0.014 wsi5 0.304 0.085 3.571 0.000 0.290 0.290 wad10 ~
wad7 -0.068 0.108 -0.628 0.530 -0.062 -0.062 wsi7 (d3) 0.060 0.038 1.548 0.122 0.057 0.057 wsi10 ~
wad7 (c3) 0.011 0.032 0.355 0.722 0.010 0.010 wsi7 0.371 0.079 4.682 0.000 0.350 0.350 wad12 ~
wad10 0.268 0.086 3.098 0.002 0.286 0.286 wsi10 (d3) 0.060 0.038 1.548 0.122 0.065 0.065 wsi12 ~
wad10 (c3) 0.011 0.032 0.355 0.722 0.012 0.012 wsi10 0.377 0.067 5.596 0.000 0.407 0.407

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.293 0.122 2.411 0.016 0.195 0.195 .wad7 ~~
.wsi7 0.049 0.065 0.760 0.447 0.043 0.043 .wad10 ~~
.wsi10 0.291 0.092 3.166 0.002 0.219 0.219 .wad12 ~~
.wsi12 0.156 0.065 2.412 0.016 0.145 0.145 RIad ~~
RIsi 0.229 0.072 3.166 0.002 0.337 0.337

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inem5 0.950 0.065 14.635 0.000 0.950 0.536 .inem7 0.684 0.057 12.085 0.000 0.684 0.444 .inem10 0.790 0.060 13.087 0.000 0.790 0.490 .inem12 0.687 0.058 11.905 0.000 0.687 0.440 .sisoem5 0.794 0.045 17.622 0.000 0.794 0.637 .sisoem7 0.813 0.048 16.992 0.000 0.813 0.629 .sisoem10 0.945 0.050 18.848 0.000 0.945 0.698 .sisoem12 0.791 0.048 16.597 0.000 0.791 0.619 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.204 0.190 6.328 0.000 1.000 1.000 RIsi 0.383 0.105 3.629 0.000 1.000 1.000 wad5 1.933 0.267 7.254 0.000 1.000 1.000 wsi5 1.169 0.181 6.449 0.000 1.000 1.000 .wad7 1.117 0.181 6.162 0.000 0.960 0.960 .wsi7 1.177 0.142 8.290 0.000 0.914 0.914 .wad10 1.388 0.233 5.956 0.000 0.993 0.993 .wsi10 1.272 0.129 9.876 0.000 0.877 0.877 .wad12 1.111 0.152 7.298 0.000 0.906 0.906 .wsi12 1.039 0.128 8.092 0.000 0.832 0.832 .inem5 0.000 0.000 0.000 .inem7 0.000 0.000 0.000 .inem10 0.000 0.000 0.000 .inem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000

#Table of model fit 
RICLPM_inat.lag.c.fit.summary.fit <- table.model.fit(RICLPM_inat.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPM_inat.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPM_inat.lag.c.fit.summary, ses = "Low")
RICLPM_inat.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPM_inat.lag.c.fit.summary, ses = "Middle")
RICLPM_inat.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPM_inat.lag.c.fit.summary, ses = "High")

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPM_inat.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*inem5 + 1*inem7 + 1*inem10 + 1*inem12 #x
  RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y

  # Create within-person centered variables
  wad5 =~ 1*inem5
  wad7 =~ 1*inem7
  wad10 =~ 1*inem10 
  wad12 =~ 1*inem12
  wsi5 =~ 1*sisoem5
  wsi7 =~ 1*sisoem7
  wsi10 =~ 1*sisoem10
  wsi12 =~ 1*sisoem12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a1,a1,a1)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b1,b1,b1)*wsi5
  
  wad10 ~ c(a2,a2,a2)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b2,b2,b2)*wsi7
  
  wad12 ~ c(a3,a3,a3)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b3,b3,b3)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPM_inat.ses.lag.c.fit <- lavaan(RICLPM_inat.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPM_inat.lag.c.fit, RICLPM_inat.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust statistics: The chi-square difference test of these two nested models is non significant (p=0.4287),

For non-robust statistics: The chi-square difference test of these two nested models is significant (p=0.002148), which implies that the lagged effects appear to be the different for different levels of SES

SES differences found: - Low SES has significant (p=0.006) ADHD -> social isolation cross-lag - Non-significant cross-lags in middle and high SES.

Can conclude here that there are SES differences - low SES association remains only.


Teacher report

RI-CLPM - total ADHD symptoms

RICLPMt.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*tadhdet5 + 1*tadhdet7 + 1*tadhdet10 + 1*tadhdet12 #x
  RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y

  # Create within-person centered variables
  wad5 =~ 1*tadhdet5
  wad7 =~ 1*tadhdet7
  wad10 =~ 1*tadhdet10 
  wad12 =~ 1*tadhdet12
  wsi5 =~ 1*sisoet5
  wsi7 =~ 1*sisoet7
  wsi10 =~ 1*sisoet10
  wsi12 =~ 1*sisoet12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/middle, group2/low, group3/high) - different values across groups, but the same values within groups and across lags (all lags constrained). 
  wad7 ~ c(a1,a2,a3)*wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + c(b1,b2,b3)*wsi5
  
  wad10 ~ c(a1,a2,a3)*wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + c(b1,b2,b3)*wsi7
  
  wad12 ~ c(a1,a2,a3)*wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + c(b1,b2,b3)*wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPMt.lag.c.fit <- lavaan(RICLPMt.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPMt.lag.c.fit.summary <- summary(RICLPMt.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 177 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 24

Number of observations per group: Used Total Middle 732 738 Low 742 742 High 750 752 Number of missing patterns per group:
Middle 21
Low 28
High 23

Model Test User Model: Standard Robust Test Statistic 175.977 79.873 Degrees of freedom 51 51 P-value (Chi-square) 0.000 0.006 Scaling correction factor 2.203 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 33.914 15.393 Low 49.357 22.402 High 92.706 42.078

Model Test Baseline Model:

Test statistic 2370.816 1031.395 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 2.299

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.945 0.970 Tucker-Lewis Index (TLI) 0.910 0.950

Robust Comparative Fit Index (CFI) 0.971 Robust Tucker-Lewis Index (TLI) 0.952

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -29649.212 -29649.212 Scaling correction factor 2.785 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.067 for the MLR correction

Akaike (AIC) 59460.424 59460.424 Bayesian (BIC) 59922.696 59922.696 Sample-size adjusted Bayesian (BIC) 59665.347 59665.347

Root Mean Square Error of Approximation:

RMSEA 0.057 0.028 90 Percent confidence interval - lower 0.048 0.019 90 Percent confidence interval - upper 0.067 0.035 P-value RMSEA <= 0.05 0.087 1.000

Robust RMSEA 0.041 90 Percent confidence interval - lower 0.022 90 Percent confidence interval - upper 0.058

Standardized Root Mean Square Residual:

SRMR 0.051 0.051

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhdet5 1.000 0.880 0.366 tadhdet7 1.000 0.880 0.366 tadhdet10 1.000 0.880 0.445 tadhdet12 1.000 0.880 0.464 RIsi =~
sisoet5 1.000 0.588 0.509 sisoet7 1.000 0.588 0.474 sisoet10 1.000 0.588 0.416 sisoet12 1.000 0.588 0.433 wad5 =~
tadhdet5 1.000 2.239 0.931 wad7 =~
tadhdet7 1.000 2.242 0.931 wad10 =~
tadhdet10 1.000 1.770 0.895 wad12 =~
tadhdet12 1.000 1.679 0.886 wsi5 =~
sisoet5 1.000 0.995 0.861 wsi7 =~
sisoet7 1.000 1.092 0.881 wsi10 =~
sisoet10 1.000 1.285 0.909 wsi12 =~
sisoet12 1.000 1.223 0.901

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a1) 0.077 0.047 1.628 0.104 0.077 0.077 wsi5 (d1) -0.088 0.067 -1.311 0.190 -0.039 -0.039 wsi7 ~
wad5 (c1) 0.048 0.024 2.060 0.039 0.099 0.099 wsi5 (b1) 0.029 0.055 0.535 0.593 0.027 0.027 wad10 ~
wad7 (a1) 0.077 0.047 1.628 0.104 0.097 0.097 wsi7 (d1) -0.088 0.067 -1.311 0.190 -0.054 -0.054 wsi10 ~
wad7 (c1) 0.048 0.024 2.060 0.039 0.084 0.084 wsi7 (b1) 0.029 0.055 0.535 0.593 0.025 0.025 wad12 ~
wad10 (a1) 0.077 0.047 1.628 0.104 0.081 0.081 wsi10 (d1) -0.088 0.067 -1.311 0.190 -0.067 -0.067 wsi12 ~
wad10 (c1) 0.048 0.024 2.060 0.039 0.070 0.070 wsi10 (b1) 0.029 0.055 0.535 0.593 0.031 0.031

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.505 0.169 2.980 0.003 0.227 0.227 .wad7 ~~
.wsi7 0.369 0.164 2.250 0.024 0.152 0.152 .wad10 ~~
.wsi10 0.685 0.216 3.177 0.001 0.304 0.304 .wad12 ~~
.wsi12 0.619 0.217 2.856 0.004 0.304 0.304 RIad ~~
RIsi 0.291 0.080 3.618 0.000 0.562 0.562

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdet5 0.840 0.092 9.085 0.000 0.840 0.349 .tadhdet7 0.876 0.095 9.240 0.000 0.876 0.364 .tadhdet10 0.591 0.079 7.457 0.000 0.591 0.299 .tadhdet12 0.520 0.076 6.869 0.000 0.520 0.274 .sisoet5 0.560 0.044 12.729 0.000 0.560 0.485 .sisoet7 0.621 0.048 13.077 0.000 0.621 0.501 .sisoet10 0.601 0.056 10.759 0.000 0.601 0.425 .sisoet12 0.700 0.056 12.509 0.000 0.700 0.516 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.775 0.244 3.177 0.001 1.000 1.000 RIsi 0.346 0.074 4.696 0.000 1.000 1.000 wad5 5.012 0.940 5.335 0.000 1.000 1.000 wsi5 0.991 0.142 6.982 0.000 1.000 1.000 .wad7 4.995 0.742 6.728 0.000 0.994 0.994 .wsi7 1.179 0.151 7.826 0.000 0.988 0.988 .wad10 3.098 0.718 4.314 0.000 0.989 0.989 .wsi10 1.637 0.308 5.317 0.000 0.992 0.992 .wad12 2.799 0.591 4.739 0.000 0.992 0.992 .wsi12 1.485 0.189 7.854 0.000 0.993 0.993 .tadhdet5 0.000 0.000 0.000 .tadhdet7 0.000 0.000 0.000 .tadhdet10 0.000 0.000 0.000 .tadhdet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhdet5 1.000 1.448 0.481 tadhdet7 1.000 1.448 0.498 tadhdet10 1.000 1.448 0.547 tadhdet12 1.000 1.448 0.565 RIsi =~
sisoet5 1.000 0.562 0.403 sisoet7 1.000 0.562 0.376 sisoet10 1.000 0.562 0.376 sisoet12 1.000 0.562 0.340 wad5 =~
tadhdet5 1.000 2.636 0.877 wad7 =~
tadhdet7 1.000 2.520 0.867 wad10 =~
tadhdet10 1.000 2.213 0.837 wad12 =~
tadhdet12 1.000 2.115 0.825 wsi5 =~
sisoet5 1.000 1.274 0.915 wsi7 =~
sisoet7 1.000 1.385 0.927 wsi10 =~
sisoet10 1.000 1.386 0.927 wsi12 =~
sisoet12 1.000 1.555 0.941

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a2) 0.185 0.070 2.644 0.008 0.193 0.193 wsi5 (d2) -0.046 0.104 -0.446 0.656 -0.023 -0.023 wsi7 ~
wad5 (c2) 0.063 0.034 1.876 0.061 0.120 0.120 wsi5 (b2) 0.211 0.059 3.587 0.000 0.194 0.194 wad10 ~
wad7 (a2) 0.185 0.070 2.644 0.008 0.210 0.210 wsi7 (d2) -0.046 0.104 -0.446 0.656 -0.029 -0.029 wsi10 ~
wad7 (c2) 0.063 0.034 1.876 0.061 0.115 0.115 wsi7 (b2) 0.211 0.059 3.587 0.000 0.211 0.211 wad12 ~
wad10 (a2) 0.185 0.070 2.644 0.008 0.193 0.193 wsi10 (d2) -0.046 0.104 -0.446 0.656 -0.030 -0.030 wsi12 ~
wad10 (c2) 0.063 0.034 1.876 0.061 0.090 0.090 wsi10 (b2) 0.211 0.059 3.587 0.000 0.188 0.188

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 1.109 0.307 3.608 0.000 0.330 0.330 .wad7 ~~
.wsi7 0.777 0.254 3.056 0.002 0.235 0.235 .wad10 ~~
.wsi10 0.977 0.312 3.130 0.002 0.337 0.337 .wad12 ~~
.wsi12 0.608 0.250 2.432 0.015 0.194 0.194 RIad ~~
RIsi 0.650 0.203 3.197 0.001 0.799 0.799

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdet5 1.355 0.115 11.832 0.000 1.355 0.450 .tadhdet7 1.160 0.110 10.533 0.000 1.160 0.399 .tadhdet10 0.998 0.102 9.795 0.000 0.998 0.378 .tadhdet12 0.925 0.107 8.682 0.000 0.925 0.361 .sisoet5 0.723 0.053 13.584 0.000 0.723 0.519 .sisoet7 0.763 0.056 13.547 0.000 0.763 0.510 .sisoet10 0.920 0.060 15.363 0.000 0.920 0.615 .sisoet12 1.016 0.069 14.661 0.000 1.016 0.615 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 2.095 0.480 4.363 0.000 1.000 1.000 RIsi 0.316 0.103 3.069 0.002 1.000 1.000 wad5 6.951 0.951 7.307 0.000 1.000 1.000 wsi5 1.624 0.272 5.959 0.000 1.000 1.000 .wad7 6.128 0.932 6.577 0.000 0.965 0.965 .wsi7 1.789 0.249 7.186 0.000 0.933 0.933 .wad10 4.691 0.772 6.076 0.000 0.958 0.958 .wsi10 1.788 0.241 7.431 0.000 0.930 0.930 .wad12 4.321 0.855 5.055 0.000 0.966 0.966 .wsi12 2.284 0.318 7.175 0.000 0.945 0.945 .tadhdet5 0.000 0.000 0.000 .tadhdet7 0.000 0.000 0.000 .tadhdet10 0.000 0.000 0.000 .tadhdet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhdet5 1.000 0.893 0.419 tadhdet7 1.000 0.893 0.431 tadhdet10 1.000 0.893 0.468 tadhdet12 1.000 0.893 0.581 RIsi =~
sisoet5 1.000 0.550 0.456 sisoet7 1.000 0.550 0.452 sisoet10 1.000 0.550 0.382 sisoet12 1.000 0.550 0.416 wad5 =~
tadhdet5 1.000 1.937 0.908 wad7 =~
tadhdet7 1.000 1.868 0.902 wad10 =~
tadhdet10 1.000 1.686 0.884 wad12 =~
tadhdet12 1.000 1.251 0.814 wsi5 =~
sisoet5 1.000 1.071 0.890 wsi7 =~
sisoet7 1.000 1.085 0.892 wsi10 =~
sisoet10 1.000 1.329 0.924 wsi12 =~
sisoet12 1.000 1.201 0.909

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a3) 0.136 0.090 1.515 0.130 0.142 0.142 wsi5 (d3) -0.044 0.061 -0.722 0.470 -0.025 -0.025 wsi7 ~
wad5 (c3) 0.007 0.037 0.198 0.843 0.013 0.013 wsi5 (b3) 0.199 0.075 2.665 0.008 0.197 0.197 wad10 ~
wad7 (a3) 0.136 0.090 1.515 0.130 0.151 0.151 wsi7 (d3) -0.044 0.061 -0.722 0.470 -0.028 -0.028 wsi10 ~
wad7 (c3) 0.007 0.037 0.198 0.843 0.010 0.010 wsi7 (b3) 0.199 0.075 2.665 0.008 0.163 0.163 wad12 ~
wad10 (a3) 0.136 0.090 1.515 0.130 0.184 0.184 wsi10 (d3) -0.044 0.061 -0.722 0.470 -0.047 -0.047 wsi12 ~
wad10 (c3) 0.007 0.037 0.198 0.843 0.010 0.010 wsi10 (b3) 0.199 0.075 2.665 0.008 0.221 0.221

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.536 0.163 3.287 0.001 0.258 0.258 .wad7 ~~
.wsi7 0.389 0.204 1.906 0.057 0.198 0.198 .wad10 ~~
.wsi10 0.398 0.209 1.905 0.057 0.182 0.182 .wad12 ~~
.wsi12 0.224 0.130 1.721 0.085 0.155 0.155 RIad ~~
RIsi 0.304 0.104 2.913 0.004 0.619 0.619

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdet5 0.748 0.081 9.194 0.000 0.748 0.351 .tadhdet7 0.682 0.081 8.424 0.000 0.682 0.329 .tadhdet10 0.573 0.076 7.515 0.000 0.573 0.301 .tadhdet12 0.372 0.058 6.397 0.000 0.372 0.242 .sisoet5 0.584 0.045 13.053 0.000 0.584 0.485 .sisoet7 0.563 0.047 11.934 0.000 0.563 0.463 .sisoet10 0.678 0.057 11.862 0.000 0.678 0.471 .sisoet12 0.581 0.052 11.076 0.000 0.581 0.440 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.797 0.275 2.901 0.004 1.000 1.000 RIsi 0.302 0.096 3.161 0.002 1.000 1.000 wad5 3.753 0.735 5.107 0.000 1.000 1.000 wsi5 1.147 0.198 5.790 0.000 1.000 1.000 .wad7 3.424 0.689 4.969 0.000 0.981 0.981 .wsi7 1.130 0.192 5.877 0.000 0.960 0.960 .wad10 2.780 0.614 4.524 0.000 0.978 0.978 .wsi10 1.719 0.243 7.079 0.000 0.973 0.973 .wad12 1.512 0.338 4.470 0.000 0.967 0.967 .wsi12 1.370 0.221 6.205 0.000 0.950 0.950 .tadhdet5 0.000 0.000 0.000 .tadhdet7 0.000 0.000 0.000 .tadhdet10 0.000 0.000 0.000 .tadhdet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

#Table of model fit 
RICLPMt.lag.c.fit.summary.fit <- table.model.fit(RICLPMt.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPMt.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPMt.lag.c.fit.summary, ses = "Low")
RICLPMt.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPMt.lag.c.fit.summary, ses = "Middle")
RICLPMt.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPMt.lag.c.fit.summary, ses = "High")

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPMt.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*tadhdet5 + 1*tadhdet7 + 1*tadhdet10 + 1*tadhdet12 #x
  RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y

  # Create within-person centered variables
  wad5 =~ 1*tadhdet5
  wad7 =~ 1*tadhdet7
  wad10 =~ 1*tadhdet10 
  wad12 =~ 1*tadhdet12
  wsi5 =~ 1*sisoet5
  wsi7 =~ 1*sisoet7
  wsi10 =~ 1*sisoet10
  wsi12 =~ 1*sisoet12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a,a,a)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b,b,b)*wsi5
  
  wad10 ~ c(a,a,a)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b,b,b)*wsi7
  
  wad12 ~ c(a,a,a)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b,b,b)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPMt.ses.lag.c.fit <- lavaan(RICLPMt.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPMt.lag.c.fit, RICLPMt.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust statistics: The chi-square difference test of these two nested models is non significant (p=0.3931).

For non-robust statistics: The chi-square difference test of these two nested models is significant (p=0.004629), which implies that the lagged effects appear to be the different for different levels of SES

SES differences found: - Low SES has non significant but close (p=0.061) ADHD -> social isolation cross-lag - Middle SES has significant (p=0.039) ADHD -> social isolation crosslag. - No significant cross-lags in high SES.

Can conclude here that there are SES differences - middle SES association remains only (close for low SES).

RI-CLPM - hyperactivity ADHD symptoms

RICLPMt_hyp.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*hyet5 + 1*hyet7 + 1*hyet10 + 1*hyet12 #x
  RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y

  # Create within-person centered variables
  wad5 =~ 1*hyet5
  wad7 =~ 1*hyet7
  wad10 =~ 1*hyet10 
  wad12 =~ 1*hyet12
  wsi5 =~ 1*sisoet5
  wsi7 =~ 1*sisoet7
  wsi10 =~ 1*sisoet10
  wsi12 =~ 1*sisoet12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/middle, group2/low, group3/high) - different values across groups, but the same values within groups and across lags (all lags constrained). 
  wad7 ~ c(a1,a2,a3)*wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + c(b1,b2,b3)*wsi5
  
  wad10 ~ c(a1,a2,a3)*wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + c(b1,b2,b3)*wsi7
  
  wad12 ~ c(a1,a2,a3)*wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + c(b1,b2,b3)*wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPMt_hyp.lag.c.fit <- lavaan(RICLPMt_hyp.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPMt_hyp.lag.c.fit.summary <- summary(RICLPMt_hyp.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 92 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 24

Number of observations per group: Used Total Middle 732 738 Low 742 742 High 750 752 Number of missing patterns per group:
Middle 21
Low 28
High 21

Model Test User Model: Standard Robust Test Statistic 177.732 78.414 Degrees of freedom 51 51 P-value (Chi-square) 0.000 0.008 Scaling correction factor 2.267 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 41.225 18.188 Low 69.054 30.466 High 67.454 29.760

Model Test Baseline Model:

Test statistic 1934.992 864.121 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 2.239

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.932 0.965 Tucker-Lewis Index (TLI) 0.887 0.942

Robust Comparative Fit Index (CFI) 0.964 Robust Tucker-Lewis Index (TLI) 0.941

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -25085.815 -25085.815 Scaling correction factor 2.871 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.159 for the MLR correction

Akaike (AIC) 50333.629 50333.629 Bayesian (BIC) 50795.901 50795.901 Sample-size adjusted Bayesian (BIC) 50538.552 50538.552

Root Mean Square Error of Approximation:

RMSEA 0.058 0.027 90 Percent confidence interval - lower 0.049 0.019 90 Percent confidence interval - upper 0.067 0.035 P-value RMSEA <= 0.05 0.077 1.000

Robust RMSEA 0.041 90 Percent confidence interval - lower 0.021 90 Percent confidence interval - upper 0.058

Standardized Root Mean Square Residual:

SRMR 0.050 0.050

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyet5 1.000 0.332 0.248 hyet7 1.000 0.332 0.263 hyet10 1.000 0.332 0.350 hyet12 1.000 0.332 0.328 RIsi =~
sisoet5 1.000 0.583 0.504 sisoet7 1.000 0.583 0.468 sisoet10 1.000 0.583 0.413 sisoet12 1.000 0.583 0.431 wad5 =~
hyet5 1.000 1.296 0.969 wad7 =~
hyet7 1.000 1.221 0.965 wad10 =~
hyet10 1.000 0.890 0.937 wad12 =~
hyet12 1.000 0.957 0.945 wsi5 =~
sisoet5 1.000 0.998 0.863 wsi7 =~
sisoet7 1.000 1.101 0.884 wsi10 =~
sisoet10 1.000 1.285 0.911 wsi12 =~
sisoet12 1.000 1.222 0.903

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a1) 0.110 0.055 1.996 0.046 0.117 0.117 wsi5 (d1) -0.030 0.028 -1.053 0.293 -0.024 -0.024 wsi7 ~
wad5 (c1) 0.109 0.044 2.457 0.014 0.128 0.128 wsi5 (b1) 0.033 0.055 0.599 0.549 0.030 0.030 wad10 ~
wad7 (a1) 0.110 0.055 1.996 0.046 0.151 0.151 wsi7 (d1) -0.030 0.028 -1.053 0.293 -0.037 -0.037 wsi10 ~
wad7 (c1) 0.109 0.044 2.457 0.014 0.103 0.103 wsi7 (b1) 0.033 0.055 0.599 0.549 0.028 0.028 wad12 ~
wad10 (a1) 0.110 0.055 1.996 0.046 0.102 0.102 wsi10 (d1) -0.030 0.028 -1.053 0.293 -0.040 -0.040 wsi12 ~
wad10 (c1) 0.109 0.044 2.457 0.014 0.079 0.079 wsi10 (b1) 0.033 0.055 0.599 0.549 0.034 0.034

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.311 0.097 3.200 0.001 0.241 0.241 .wad7 ~~
.wsi7 0.180 0.090 2.001 0.045 0.136 0.136 .wad10 ~~
.wsi10 0.239 0.088 2.724 0.006 0.212 0.212 .wad12 ~~
.wsi12 0.280 0.129 2.166 0.030 0.242 0.242 RIad ~~
RIsi 0.093 0.035 2.695 0.007 0.481 0.481

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.427 0.051 8.350 0.000 0.427 0.319 .hyet7 0.410 0.050 8.204 0.000 0.410 0.324 .hyet10 0.240 0.039 6.216 0.000 0.240 0.253 .hyet12 0.237 0.041 5.775 0.000 0.237 0.234 .sisoet5 0.560 0.044 12.730 0.000 0.560 0.485 .sisoet7 0.621 0.048 13.068 0.000 0.621 0.499 .sisoet10 0.601 0.056 10.725 0.000 0.601 0.426 .sisoet12 0.704 0.056 12.537 0.000 0.704 0.520 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.110 0.063 1.753 0.080 1.000 1.000 RIsi 0.340 0.073 4.683 0.000 1.000 1.000 wad5 1.680 0.285 5.897 0.000 1.000 1.000 wsi5 0.995 0.143 6.937 0.000 1.000 1.000 .wad7 1.472 0.232 6.342 0.000 0.987 0.987 .wsi7 1.188 0.150 7.907 0.000 0.981 0.981 .wad10 0.775 0.199 3.883 0.000 0.977 0.977 .wsi10 1.632 0.306 5.338 0.000 0.988 0.988 .wad12 0.907 0.237 3.824 0.000 0.990 0.990 .wsi12 1.480 0.188 7.855 0.000 0.991 0.991 .hyet5 0.000 0.000 0.000 .hyet7 0.000 0.000 0.000 .hyet10 0.000 0.000 0.000 .hyet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyet5 1.000 0.703 0.455 hyet7 1.000 0.703 0.457 hyet10 1.000 0.703 0.484 hyet12 1.000 0.703 0.519 RIsi =~
sisoet5 1.000 0.567 0.408 sisoet7 1.000 0.567 0.381 sisoet10 1.000 0.567 0.378 sisoet12 1.000 0.567 0.340 wad5 =~
hyet5 1.000 1.376 0.891 wad7 =~
hyet7 1.000 1.366 0.889 wad10 =~
hyet10 1.000 1.270 0.875 wad12 =~
hyet12 1.000 1.157 0.855 wsi5 =~
sisoet5 1.000 1.270 0.913 wsi7 =~
sisoet7 1.000 1.376 0.925 wsi10 =~
sisoet10 1.000 1.389 0.926 wsi12 =~
sisoet12 1.000 1.570 0.941

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a2) 0.181 0.076 2.375 0.018 0.182 0.182 wsi5 (d2) 0.023 0.053 0.436 0.663 0.022 0.022 wsi7 ~
wad5 (c2) 0.156 0.059 2.645 0.008 0.156 0.156 wsi5 (b2) 0.206 0.060 3.429 0.001 0.190 0.190 wad10 ~
wad7 (a2) 0.181 0.076 2.375 0.018 0.195 0.195 wsi7 (d2) 0.023 0.053 0.436 0.663 0.025 0.025 wsi10 ~
wad7 (c2) 0.156 0.059 2.645 0.008 0.153 0.153 wsi7 (b2) 0.206 0.060 3.429 0.001 0.204 0.204 wad12 ~
wad10 (a2) 0.181 0.076 2.375 0.018 0.199 0.199 wsi10 (d2) 0.023 0.053 0.436 0.663 0.028 0.028 wsi12 ~
wad10 (c2) 0.156 0.059 2.645 0.008 0.126 0.126 wsi10 (b2) 0.206 0.060 3.429 0.001 0.183 0.183

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.416 0.153 2.716 0.007 0.238 0.238 .wad7 ~~
.wsi7 0.406 0.133 3.043 0.002 0.228 0.228 .wad10 ~~
.wsi10 0.443 0.155 2.863 0.004 0.268 0.268 .wad12 ~~
.wsi12 0.185 0.114 1.625 0.104 0.108 0.108 RIad ~~
RIsi 0.249 0.098 2.524 0.012 0.624 0.624

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.605 0.059 10.311 0.000 0.605 0.392 .hyet7 0.541 0.058 9.252 0.000 0.541 0.352 .hyet10 0.477 0.056 8.542 0.000 0.477 0.328 .hyet12 0.452 0.057 7.871 0.000 0.452 0.334 .sisoet5 0.724 0.053 13.541 0.000 0.724 0.521 .sisoet7 0.767 0.056 13.588 0.000 0.767 0.515 .sisoet10 0.922 0.060 15.398 0.000 0.922 0.615 .sisoet12 1.020 0.069 14.674 0.000 1.020 0.611 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.494 0.136 3.643 0.000 1.000 1.000 RIsi 0.322 0.108 2.985 0.003 1.000 1.000 wad5 1.893 0.279 6.779 0.000 1.000 1.000 wsi5 1.613 0.279 5.774 0.000 1.000 1.000 .wad7 1.801 0.291 6.189 0.000 0.964 0.964 .wsi7 1.753 0.246 7.117 0.000 0.925 0.925 .wad10 1.547 0.301 5.145 0.000 0.959 0.959 .wsi10 1.772 0.241 7.345 0.000 0.918 0.918 .wad12 1.280 0.269 4.755 0.000 0.956 0.956 .wsi12 2.311 0.325 7.114 0.000 0.937 0.937 .hyet5 0.000 0.000 0.000 .hyet7 0.000 0.000 0.000 .hyet10 0.000 0.000 0.000 .hyet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyet5 1.000 0.513 0.414 hyet7 1.000 0.513 0.444 hyet10 1.000 0.513 0.516 hyet12 1.000 0.513 0.573 RIsi =~
sisoet5 1.000 0.560 0.465 sisoet7 1.000 0.560 0.461 sisoet10 1.000 0.560 0.389 sisoet12 1.000 0.560 0.424 wad5 =~
hyet5 1.000 1.128 0.910 wad7 =~
hyet7 1.000 1.036 0.896 wad10 =~
hyet10 1.000 0.852 0.857 wad12 =~
hyet12 1.000 0.733 0.819 wsi5 =~
sisoet5 1.000 1.067 0.885 wsi7 =~
sisoet7 1.000 1.078 0.887 wsi10 =~
sisoet10 1.000 1.328 0.921 wsi12 =~
sisoet12 1.000 1.197 0.906

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a3) 0.099 0.080 1.240 0.215 0.107 0.107 wsi5 (d3) -0.026 0.038 -0.693 0.488 -0.027 -0.027 wsi7 ~
wad5 (c3) -0.012 0.059 -0.198 0.843 -0.012 -0.012 wsi5 (b3) 0.197 0.076 2.608 0.009 0.195 0.195 wad10 ~
wad7 (a3) 0.099 0.080 1.240 0.215 0.120 0.120 wsi7 (d3) -0.026 0.038 -0.693 0.488 -0.033 -0.033 wsi10 ~
wad7 (c3) -0.012 0.059 -0.198 0.843 -0.009 -0.009 wsi7 (b3) 0.197 0.076 2.608 0.009 0.160 0.160 wad12 ~
wad10 (a3) 0.099 0.080 1.240 0.215 0.115 0.115 wsi10 (d3) -0.026 0.038 -0.693 0.488 -0.048 -0.048 wsi12 ~
wad10 (c3) -0.012 0.059 -0.198 0.843 -0.008 -0.008 wsi10 (b3) 0.197 0.076 2.608 0.009 0.219 0.219

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.232 0.102 2.277 0.023 0.193 0.193 .wad7 ~~
.wsi7 0.163 0.104 1.568 0.117 0.150 0.150 .wad10 ~~
.wsi10 0.150 0.098 1.526 0.127 0.135 0.135 .wad12 ~~
.wsi12 0.074 0.075 0.983 0.325 0.087 0.087 RIad ~~
RIsi 0.149 0.066 2.251 0.024 0.517 0.517

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.394 0.047 8.403 0.000 0.394 0.318 .hyet7 0.352 0.045 7.816 0.000 0.352 0.304 .hyet10 0.266 0.039 6.867 0.000 0.266 0.267 .hyet12 0.200 0.035 5.758 0.000 0.200 0.223 .sisoet5 0.584 0.045 13.069 0.000 0.584 0.484 .sisoet7 0.564 0.047 11.934 0.000 0.564 0.464 .sisoet10 0.678 0.057 11.863 0.000 0.678 0.470 .sisoet12 0.581 0.053 11.048 0.000 0.581 0.440 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.263 0.084 3.114 0.002 1.000 1.000 RIsi 0.314 0.097 3.254 0.001 1.000 1.000 wad5 1.272 0.209 6.078 0.000 1.000 1.000 wsi5 1.138 0.199 5.710 0.000 1.000 1.000 .wad7 1.061 0.189 5.601 0.000 0.989 0.989 .wsi7 1.119 0.190 5.879 0.000 0.963 0.963 .wad10 0.715 0.160 4.480 0.000 0.986 0.986 .wsi10 1.720 0.245 7.020 0.000 0.975 0.975 .wad12 0.530 0.117 4.543 0.000 0.986 0.986 .wsi12 1.365 0.221 6.168 0.000 0.953 0.953 .hyet5 0.000 0.000 0.000 .hyet7 0.000 0.000 0.000 .hyet10 0.000 0.000 0.000 .hyet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

#Table of model fit 
RICLPMt_hyp.lag.c.fit.summary.fit <- table.model.fit(RICLPMt_hyp.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPMt_hyp.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPMt_hyp.lag.c.fit.summary, ses = "Low")
RICLPMt_hyp.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPMt_hyp.lag.c.fit.summary, ses = "Middle")
RICLPMt_hyp.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPMt_hyp.lag.c.fit.summary, ses = "High")

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPMt_hyp.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*hyet5 + 1*hyet7 + 1*hyet10 + 1*hyet12 #x
  RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y

  # Create within-person centered variables
  wad5 =~ 1*hyet5
  wad7 =~ 1*hyet7
  wad10 =~ 1*hyet10 
  wad12 =~ 1*hyet12
  wsi5 =~ 1*sisoet5
  wsi7 =~ 1*sisoet7
  wsi10 =~ 1*sisoet10
  wsi12 =~ 1*sisoet12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a,a,a)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b,b,b)*wsi5
  
  wad10 ~ c(a,a,a)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b,b,b)*wsi7
  
  wad12 ~ c(a,a,a)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b,b,b)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPMt_hyp.ses.lag.c.fit <- lavaan(RICLPMt_hyp.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPMt_hyp.lag.c.fit, RICLPMt_hyp.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust statistics: The chi-square difference test of these two nested models is non significant (p=0.3033).

For non-robust statistics The chi-square difference test of these two nested models is significant (p=0.001871), which implies that the lagged effects appear to be the different for different levels of SES

SES differences found: - Low SES has significant (p=0.008) ADHD -> social isolation cross-lag - Middle SES has significant (p=0.014) ADHD -> social isolation cross-lag. - No significant cross-lags in high SES.

Can conclude here that there are SES differences - low and middle SES association remains only.

RI-CLPM - Inattention ADHD symptoms

RICLPMt_inat.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*inet5 + 1*inet7 + 1*inet10 + 1*inet12 #x
  RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y

  # Create within-person centered variables
  wad5 =~ 1*inet5
  wad7 =~ 1*inet7
  wad10 =~ 1*inet10 
  wad12 =~ 1*inet12
  wsi5 =~ 1*sisoet5
  wsi7 =~ 1*sisoet7
  wsi10 =~ 1*sisoet10
  wsi12 =~ 1*sisoet12
  
  # Constrained lagged effects between the within-person centered variables. c(group1/middle, group2/low, group3/high) - different values across groups, but the same values within groups and across lags (all lags constrained). 
  wad7 ~ c(a1,a2,a3)*wad5 + c(d1,d2,d3)*wsi5 
  wsi7 ~ c(c1,c2,c3)*wad5 + c(b1,b2,b3)*wsi5
  
  wad10 ~ c(a1,a2,a3)*wad7 + c(d1,d2,d3)*wsi7
  wsi10 ~ c(c1,c2,c3)*wad7 + c(b1,b2,b3)*wsi7
  
  wad12 ~ c(a1,a2,a3)*wad10 + c(d1,d2,d3)*wsi10
  wsi12 ~ c(c1,c2,c3)*wad10 + c(b1,b2,b3)*wsi10
  
  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'

To check for group differences in parameter estimates between different levels of SES, we specify that we are interested to group by SES.

RICLPMt_inat.lag.c.fit <- lavaan(RICLPMt_inat.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

RICLPMt_inat.lag.c.fit.summary <- summary(RICLPMt_inat.lag.c.fit, 
                                fit.measures = TRUE,
                                standardized = TRUE)

lavaan 0.6-10 ended normally after 91 iterations

Estimator ML Optimization method NLMINB Number of model parameters 105 Number of equality constraints 24

Number of observations per group: Used Total Middle 732 738 Low 742 742 High 750 752 Number of missing patterns per group:
Middle 19
Low 23
High 20

Model Test User Model: Standard Robust Test Statistic 166.217 71.891 Degrees of freedom 51 51 P-value (Chi-square) 0.000 0.029 Scaling correction factor 2.312 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 43.465 18.799 Low 35.760 15.467 High 86.992 37.625

Model Test Baseline Model:

Test statistic 2293.173 970.890 Degrees of freedom 84 84 P-value 0.000 0.000 Scaling correction factor 2.362

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.948 0.976 Tucker-Lewis Index (TLI) 0.914 0.961

Robust Comparative Fit Index (CFI) 0.977 Robust Tucker-Lewis Index (TLI) 0.962

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -25570.458 -25570.458 Scaling correction factor 2.832 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.146 for the MLR correction

Akaike (AIC) 51302.915 51302.915 Bayesian (BIC) 51765.187 51765.187 Sample-size adjusted Bayesian (BIC) 51507.838 51507.838

Root Mean Square Error of Approximation:

RMSEA 0.055 0.024 90 Percent confidence interval - lower 0.046 0.014 90 Percent confidence interval - upper 0.065 0.031 P-value RMSEA <= 0.05 0.171 1.000

Robust RMSEA 0.036 90 Percent confidence interval - lower 0.012 90 Percent confidence interval - upper 0.054

Standardized Root Mean Square Residual:

SRMR 0.050 0.050

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
inet5 1.000 0.576 0.442 inet7 1.000 0.576 0.394 inet10 1.000 0.576 0.461 inet12 1.000 0.576 0.488 RIsi =~
sisoet5 1.000 0.595 0.514 sisoet7 1.000 0.595 0.480 sisoet10 1.000 0.595 0.422 sisoet12 1.000 0.595 0.438 wad5 =~
inet5 1.000 1.168 0.897 wad7 =~
inet7 1.000 1.343 0.919 wad10 =~
inet10 1.000 1.109 0.888 wad12 =~
inet12 1.000 1.029 0.873 wsi5 =~
sisoet5 1.000 0.994 0.858 wsi7 =~
sisoet7 1.000 1.088 0.877 wsi10 =~
sisoet10 1.000 1.280 0.907 wsi12 =~
sisoet12 1.000 1.220 0.899

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a1) 0.059 0.052 1.139 0.255 0.051 0.051 wsi5 (d1) -0.060 0.045 -1.344 0.179 -0.044 -0.044 wsi7 ~
wad5 (c1) 0.045 0.038 1.206 0.228 0.049 0.049 wsi5 (b1) 0.033 0.055 0.610 0.542 0.030 0.030 wad10 ~
wad7 (a1) 0.059 0.052 1.139 0.255 0.072 0.072 wsi7 (d1) -0.060 0.045 -1.344 0.179 -0.059 -0.059 wsi10 ~
wad7 (c1) 0.045 0.038 1.206 0.228 0.048 0.048 wsi7 (b1) 0.033 0.055 0.610 0.542 0.028 0.028 wad12 ~
wad10 (a1) 0.059 0.052 1.139 0.255 0.064 0.064 wsi10 (d1) -0.060 0.045 -1.344 0.179 -0.074 -0.074 wsi12 ~
wad10 (c1) 0.045 0.038 1.206 0.228 0.041 0.041 wsi10 (b1) 0.033 0.055 0.610 0.542 0.035 0.035

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.192 0.083 2.319 0.020 0.165 0.165 .wad7 ~~
.wsi7 0.194 0.098 1.984 0.047 0.134 0.134 .wad10 ~~
.wsi10 0.435 0.146 2.973 0.003 0.308 0.308 .wad12 ~~
.wsi12 0.348 0.116 2.991 0.003 0.278 0.278 RIad ~~
RIsi 0.201 0.050 4.023 0.000 0.585 0.585

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inet5 0.414 0.051 8.181 0.000 0.414 0.318 .inet7 0.465 0.056 8.264 0.000 0.465 0.318 .inet10 0.346 0.050 6.969 0.000 0.346 0.277 .inet12 0.289 0.046 6.236 0.000 0.289 0.245 .sisoet5 0.560 0.044 12.732 0.000 0.560 0.484 .sisoet7 0.622 0.048 13.069 0.000 0.622 0.501 .sisoet10 0.598 0.056 10.730 0.000 0.598 0.424 .sisoet12 0.699 0.056 12.514 0.000 0.699 0.515 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.332 0.089 3.726 0.000 1.000 1.000 RIsi 0.355 0.075 4.716 0.000 1.000 1.000 wad5 1.365 0.255 5.348 0.000 1.000 1.000 wsi5 0.987 0.141 6.996 0.000 1.000 1.000 .wad7 1.797 0.283 6.339 0.000 0.996 0.996 .wsi7 1.179 0.151 7.799 0.000 0.996 0.996 .wad10 1.221 0.256 4.766 0.000 0.993 0.993 .wsi10 1.633 0.307 5.314 0.000 0.997 0.997 .wad12 1.051 0.223 4.724 0.000 0.993 0.993 .wsi12 1.484 0.189 7.832 0.000 0.996 0.996 .inet5 0.000 0.000 0.000 .inet7 0.000 0.000 0.000 .inet10 0.000 0.000 0.000 .inet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
inet5 1.000 0.772 0.434 inet7 1.000 0.772 0.479 inet10 1.000 0.772 0.519 inet12 1.000 0.772 0.526 RIsi =~
sisoet5 1.000 0.577 0.415 sisoet7 1.000 0.577 0.386 sisoet10 1.000 0.577 0.386 sisoet12 1.000 0.577 0.352 wad5 =~
inet5 1.000 1.604 0.901 wad7 =~
inet7 1.000 1.414 0.878 wad10 =~
inet10 1.000 1.273 0.855 wad12 =~
inet12 1.000 1.249 0.851 wsi5 =~
sisoet5 1.000 1.267 0.910 wsi7 =~
sisoet7 1.000 1.378 0.922 wsi10 =~
sisoet10 1.000 1.380 0.922 wsi12 =~
sisoet12 1.000 1.537 0.936

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a2) 0.151 0.059 2.549 0.011 0.171 0.171 wsi5 (d2) -0.045 0.061 -0.725 0.468 -0.040 -0.040 wsi7 ~
wad5 (c2) 0.057 0.054 1.055 0.291 0.066 0.066 wsi5 (b2) 0.217 0.059 3.656 0.000 0.200 0.200 wad10 ~
wad7 (a2) 0.151 0.059 2.549 0.011 0.168 0.168 wsi7 (d2) -0.045 0.061 -0.725 0.468 -0.048 -0.048 wsi10 ~
wad7 (c2) 0.057 0.054 1.055 0.291 0.058 0.058 wsi7 (b2) 0.217 0.059 3.656 0.000 0.217 0.217 wad12 ~
wad10 (a2) 0.151 0.059 2.549 0.011 0.154 0.154 wsi10 (d2) -0.045 0.061 -0.725 0.468 -0.049 -0.049 wsi12 ~
wad10 (c2) 0.057 0.054 1.055 0.291 0.047 0.047 wsi10 (b2) 0.217 0.059 3.656 0.000 0.195 0.195

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.674 0.187 3.600 0.000 0.332 0.332 .wad7 ~~
.wsi7 0.371 0.134 2.762 0.006 0.198 0.198 .wad10 ~~
.wsi10 0.579 0.188 3.074 0.002 0.344 0.344 .wad12 ~~
.wsi12 0.448 0.162 2.771 0.006 0.242 0.242 RIad ~~
RIsi 0.387 0.110 3.511 0.000 0.868 0.868

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inet5 0.749 0.068 10.945 0.000 0.749 0.421 .inet7 0.619 0.062 10.045 0.000 0.619 0.384 .inet10 0.527 0.058 9.088 0.000 0.527 0.354 .inet12 0.476 0.060 7.986 0.000 0.476 0.324 .sisoet5 0.720 0.053 13.628 0.000 0.720 0.517 .sisoet7 0.759 0.056 13.511 0.000 0.759 0.508 .sisoet10 0.920 0.060 15.358 0.000 0.920 0.615 .sisoet12 1.013 0.069 14.662 0.000 1.013 0.617 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.596 0.139 4.289 0.000 1.000 1.000 RIsi 0.333 0.103 3.233 0.001 1.000 1.000 wad5 2.572 0.324 7.930 0.000 1.000 1.000 wsi5 1.604 0.266 6.037 0.000 1.000 1.000 .wad7 1.948 0.284 6.860 0.000 0.974 0.974 .wsi7 1.800 0.249 7.223 0.000 0.947 0.947 .wad10 1.576 0.249 6.325 0.000 0.973 0.973 .wsi10 1.798 0.240 7.482 0.000 0.944 0.944 .wad12 1.528 0.266 5.733 0.000 0.979 0.979 .wsi12 2.253 0.310 7.278 0.000 0.954 0.954 .inet5 0.000 0.000 0.000 .inet7 0.000 0.000 0.000 .inet10 0.000 0.000 0.000 .inet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
inet5 1.000 0.502 0.435 inet7 1.000 0.502 0.429 inet10 1.000 0.502 0.430 inet12 1.000 0.502 0.568 RIsi =~
sisoet5 1.000 0.570 0.473 sisoet7 1.000 0.570 0.469 sisoet10 1.000 0.570 0.396 sisoet12 1.000 0.570 0.431 wad5 =~
inet5 1.000 1.038 0.900 wad7 =~
inet7 1.000 1.056 0.903 wad10 =~
inet10 1.000 1.054 0.903 wad12 =~
inet12 1.000 0.727 0.823 wsi5 =~
sisoet5 1.000 1.063 0.881 wsi7 =~
sisoet7 1.000 1.073 0.883 wsi10 =~
sisoet10 1.000 1.321 0.918 wsi12 =~
sisoet12 1.000 1.195 0.902

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a3) 0.108 0.076 1.423 0.155 0.106 0.106 wsi5 (d3) -0.016 0.036 -0.443 0.658 -0.016 -0.016 wsi7 ~
wad5 (c3) 0.026 0.067 0.394 0.693 0.026 0.026 wsi5 (b3) 0.183 0.074 2.487 0.013 0.181 0.181 wad10 ~
wad7 (a3) 0.108 0.076 1.423 0.155 0.108 0.108 wsi7 (d3) -0.016 0.036 -0.443 0.658 -0.016 -0.016 wsi10 ~
wad7 (c3) 0.026 0.067 0.394 0.693 0.021 0.021 wsi7 (b3) 0.183 0.074 2.487 0.013 0.149 0.149 wad12 ~
wad10 (a3) 0.108 0.076 1.423 0.155 0.156 0.156 wsi10 (d3) -0.016 0.036 -0.443 0.658 -0.029 -0.029 wsi12 ~
wad10 (c3) 0.026 0.067 0.394 0.693 0.023 0.023 wsi10 (b3) 0.183 0.074 2.487 0.013 0.202 0.202

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.297 0.093 3.181 0.001 0.269 0.269 .wad7 ~~
.wsi7 0.206 0.112 1.844 0.065 0.186 0.186 .wad10 ~~
.wsi10 0.258 0.144 1.784 0.074 0.188 0.188 .wad12 ~~
.wsi12 0.185 0.083 2.227 0.026 0.220 0.220 RIad ~~
RIsi 0.174 0.061 2.823 0.005 0.607 0.607

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inet5 0.353 0.044 8.035 0.000 0.353 0.307 .inet7 0.332 0.046 7.175 0.000 0.332 0.284 .inet10 0.316 0.046 6.787 0.000 0.316 0.270 .inet12 0.184 0.033 5.586 0.000 0.184 0.208 .sisoet5 0.585 0.045 13.048 0.000 0.585 0.485 .sisoet7 0.564 0.047 11.951 0.000 0.564 0.464 .sisoet10 0.678 0.057 11.860 0.000 0.678 0.471 .sisoet12 0.582 0.053 11.082 0.000 0.582 0.440 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.252 0.091 2.767 0.006 1.000 1.000 RIsi 0.325 0.095 3.424 0.001 1.000 1.000 wad5 1.077 0.231 4.655 0.000 1.000 1.000 wsi5 1.129 0.192 5.870 0.000 1.000 1.000 .wad7 1.103 0.242 4.564 0.000 0.989 0.989 .wsi7 1.109 0.190 5.842 0.000 0.964 0.964 .wad10 1.099 0.237 4.634 0.000 0.989 0.989 .wsi10 1.704 0.242 7.035 0.000 0.976 0.976 .wad12 0.516 0.152 3.387 0.001 0.976 0.976 .wsi12 1.367 0.219 6.238 0.000 0.957 0.957 .inet5 0.000 0.000 0.000 .inet7 0.000 0.000 0.000 .inet10 0.000 0.000 0.000 .inet12 0.000 0.000 0.000 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000

#Table of model fit 
RICLPMt_inat.lag.c.fit.summary.fit <- table.model.fit(RICLPMt_inat.lag.c.fit.summary)
#Table of regression coefficients and covariances for females and males separately
RICLPMt_inat.lag.c.fit.summary.reg.low <- table.model.coef(model = RICLPMt_inat.lag.c.fit.summary, ses = "Low")
RICLPMt_inat.lag.c.fit.summary.reg.mid <- table.model.coef(model = RICLPMt_inat.lag.c.fit.summary, ses = "Middle")
RICLPMt_inat.lag.c.fit.summary.reg.high <- table.model.coef(model = RICLPMt_inat.lag.c.fit.summary, ses = "High")

Now we want to apply constraints over time to test if lagged parameters are invariant across groups, if the chi square is significant then the lagged effects for boys and girls are different.

RICLPMt_inat.ses.lag.c <- '
  # Create between components (random intercepts treated as factors here)
  RIad =~ 1*inet5 + 1*inet7 + 1*inet10 + 1*inet12 #x
  RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y

  # Create within-person centered variables
  wad5 =~ 1*inet5
  wad7 =~ 1*inet7
  wad10 =~ 1*inet10 
  wad12 =~ 1*inet12
  wsi5 =~ 1*sisoet5
  wsi7 =~ 1*sisoet7
  wsi10 =~ 1*sisoet10
  wsi12 =~ 1*sisoet12
  
 # Estimate the lagged effects between the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects between the within-person centered variables. 
  wad7 ~ c(a,a,a)*wad5 + c(d,d,d)*wsi5
  wsi7 ~ c(c,c,c)*wad5 + c(b,b,b)*wsi5
  
  wad10 ~ c(a,a,a)*wad7 + c(d,d,d)*wsi7
  wsi10 ~ c(c,c,c)*wad7 + c(b,b,b)*wsi7
  
  wad12 ~ c(a,a,a)*wad10 + c(d,d,d)*wsi10
  wsi12 ~ c(c,c,c)*wad10 + c(b,b,b)*wsi10 

  # Estimate the covariance between the within-person centered variables at the first wave
  wad5 ~~ wsi5 # Covariance
  
  # Estimate the covariances between the residuals of the within-person centered variables (the innovations)
  wad7 ~~ wsi7
  wad10 ~~ wsi10
  wad12 ~~ wsi12
  
  # Estimate the variance and covariance of the random intercepts
  RIad ~~ RIad
  RIsi ~~ RIsi
  RIad ~~ RIsi
  
  # Estimate the (residual) variance of the within-person centered variables.
  wad5 ~~ wad5 # Variances
  wsi5 ~~ wsi5 
  wad7 ~~ wad7 # Residual variances
  wsi7 ~~ wsi7 
  wad10 ~~ wad10 
  wsi10 ~~ wsi10 
  wad12 ~~ wad12 
  wsi12 ~~ wsi12
'
RICLPMt_inat.ses.lag.c.fit <- lavaan(RICLPMt_inat.ses.lag.c, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(RICLPMt_inat.lag.c.fit, RICLPMt_inat.ses.lag.c.fit, method = "satorra.bentler.2010")

For robust statistics: The chi-square difference test of these two nested models is non significant (p=0.5639).

For non-robust statistics: The chi-square difference test of these two nested models is significant (p=0.02542), which implies that the lagged effects appear to be the different for different levels of SES

SES differences found: - No significant cross lag associations for different levels of SES. - Significant autoregressive cross-lags for low SES only.

Can conclude here that there are no SES differences in inattention cross-lags


Three variable longitudinal mediation - stratified by SES

All models using total combined ADHD symptoms and cross-lags are constrained to be equal across time.

Prosocial behaviours

Constrained full cross-lag RI-CLPM mediation model

Cross-lagged paths are constrained to be equal across time, but freely estimated across SES groups. Autoregressive paths are freely estimated across time and SES groups.

ri.med.long.pro.c <- ' 
                  ###### Create random intercepts ###### 
                  RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 
                  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 
                  RIpro =~ 1*proe5 + 1*proe7 + 1*proe10  + 1*proe12
                
                  ###### Create within-person variables ######
                  ## Isolation
                  wsi5 =~ 1*sisoe5
                  wsi7 =~ 1*sisoe7
                  wsi10 =~ 1*sisoe10
                  wsi12 =~ 1*sisoe12
                  ## ADHD
                  wad5 =~ 1*tadhde5
                  wad7 =~ 1*tadhde7
                  wad10 =~ 1*tadhde10
                  wad12 =~ 1*tadhde12
                  ## Prosocial 
                  wpro5 =~ 1*proe5
                  wpro7 =~ 1*proe7
                  wpro10 =~ 1*proe10
                  wpro12 =~ 1*proe12
                  
                  ###### Autoregressive lags ###### 
                  ## Isolation
                  wsi7 ~ wsi5
                  wsi10 ~ wsi7
                  wsi12 ~ wsi10
                  ## Pro social bahviour
                  wpro7 ~ wpro5
                  wpro10 ~ wpro7
                  wpro12 ~ wpro10
                  ## ADHD
                  wad7 ~ wad5
                  wad10 ~ wad7
                  wad12 ~ wad10
                  
                  ###### Cross lag paths ######
                  ## Isolation
                  wad7 ~ c(e1,e2,e3)*wsi5
                  wad10 ~ c(e1,e2,e3)*wsi7
                  wad12 ~ c(e1,e2,e3)*wsi10
                  ## ADHD
                  wsi7 ~ c(f1,f2,f3)*wad5
                  wsi10 ~ c(f1,f2,f3)*wad7
                  wsi12 ~ c(f1,f2,f3)*wad10
                  ## Prosocial
                  wsi7 ~ c(b1,b2,b3)*wpro5
                  wad7 ~ c(d1,d2,d3)*wpro5
                  wpro12 ~ c(c1,c2,c3)*wsi10
                  wpro12 ~ c(a1,a2,a3)*wad10
                  
                  ###### Mediation paths ######
                  ## ADHD to Isolation
                  wpro7 ~ c(a1,a2,a3)*wad5 
                  wsi10 ~ c(b1,b2,b3)*wpro7
                  wpro10 ~ c(a1,a2,a3)*wad7 
                  wsi12 ~ c(b1,b2,b3)*wpro10
                  ## Isolation to ADHD
                  wpro7 ~ c(c1,c2,c3)*wsi5
                  wad10 ~ c(d1,d2,d3)*wpro7
                  wpro10 ~ c(c1,c2,c3)*wsi7
                  wad12 ~ c(d1,d2,d3)*wpro10
                  
                  ###### Covariances ######
                  wsi5 ~~ wpro5
                  wpro5 ~~ wad5
                  wsi5 ~~ wad5
                  wsi7 ~~ wpro7
                  wpro7 ~~ wad7
                  wsi7 ~~ wad7
                  wsi10 ~~ wpro10
                  wpro10 ~~ wad10
                  wsi10 ~~ wad10
                  wsi12 ~~ wpro12
                  wpro12 ~~ wad12
                  wsi12 ~~ wad12
                    
                  ###### Variances ######
                  ## Variances
                  wad5 ~~ wad5 
                  wsi5 ~~ wsi5 
                  wpro5 ~~ wpro5
                  ## Residual variances
                  wad7 ~~ wad7 
                  wsi7 ~~ wsi7 
                  wpro7 ~~ wpro7
                  wad10 ~~ wad10 
                  wsi10 ~~ wsi10 
                  wpro10 ~~ wpro10
                  wad12 ~~ wad12 
                  wsi12 ~~ wsi12
                  wpro12 ~~ wpro12
                  
                  ###### Variance and covariance of random intercepts ######
                  RIad ~~ RIad
                  RIsi ~~ RIsi
                  RIpro ~~ RIpro
                  RIad ~~ RIsi
                  RIad ~~ RIpro
                  RIsi ~~ RIpro

                  ###### Indirect effect (a*b) ######
                  indirect1mid := a1*b1
                  indirect1low := a2*b2
                  indirect1high := a3*b3
                  indirect2mid := c1*d1
                  indirect2low := c2*d2
                  indirect2high := c3*d3
         '
ri.med.long.pro.c.fit <- lavaan(model = ri.med.long.pro.c, 
                        data = dat,
                        missing = 'ML',
                        group = "SES",
                        meanstructure = TRUE, 
                        int.ov.free = TRUE,   
                        estimator = "MLR")

ri.med.long.pro.c.fit.summary <- summary(ri.med.long.pro.c.fit, standardized = TRUE, fit.measures = TRUE)

lavaan 0.6-10 ended normally after 288 iterations

Estimator ML Optimization method NLMINB Number of model parameters 207 Number of equality constraints 36

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 219.776 168.455 Degrees of freedom 99 99 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.305 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 70.884 54.331 Low 52.972 40.602 High 95.920 73.521

Model Test Baseline Model:

Test statistic 8229.986 5660.521 Degrees of freedom 198 198 P-value 0.000 0.000 Scaling correction factor 1.454

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.985 0.987 Tucker-Lewis Index (TLI) 0.970 0.975

Robust Comparative Fit Index (CFI) 0.989 Robust Tucker-Lewis Index (TLI) 0.977

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -52627.357 -52627.357 Scaling correction factor 1.540 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.659 for the MLR correction

Akaike (AIC) 105596.715 105596.715 Bayesian (BIC) 106573.236 106573.236 Sample-size adjusted Bayesian (BIC) 106029.942 106029.942

Root Mean Square Error of Approximation:

RMSEA 0.040 0.031 90 Percent confidence interval - lower 0.033 0.024 90 Percent confidence interval - upper 0.048 0.038 P-value RMSEA <= 0.05 0.986 1.000

Robust RMSEA 0.035 90 Percent confidence interval - lower 0.026 90 Percent confidence interval - upper 0.044

Standardized Root Mean Square Residual:

SRMR 0.035 0.035

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.596 0.615 tadhde7 1.000 1.596 0.641 tadhde10 1.000 1.596 0.708 tadhde12 1.000 1.596 0.667 RIsi =~
sisoe5 1.000 0.572 0.573 sisoe7 1.000 0.572 0.553 sisoe10 1.000 0.572 0.470 sisoe12 1.000 0.572 0.473 RIpro =~
proe5 1.000 1.605 0.500 proe7 1.000 1.605 0.527 proe10 1.000 1.605 0.537 proe12 1.000 1.605 0.495 wsi5 =~
sisoe5 1.000 0.817 0.819 wsi7 =~
sisoe7 1.000 0.862 0.833 wsi10 =~
sisoe10 1.000 1.075 0.883 wsi12 =~
sisoe12 1.000 1.064 0.881 wad5 =~
tadhde5 1.000 2.049 0.789 wad7 =~
tadhde7 1.000 1.912 0.768 wad10 =~
tadhde10 1.000 1.593 0.706 wad12 =~
tadhde12 1.000 1.783 0.745 wpro5 =~
proe5 1.000 2.776 0.866 wpro7 =~
proe7 1.000 2.587 0.850 wpro10 =~
proe10 1.000 2.523 0.844 wpro12 =~
proe12 1.000 2.819 0.869

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.069 0.095 0.726 0.468 0.065 0.065 wsi10 ~
wsi7 0.177 0.090 1.968 0.049 0.142 0.142 wsi12 ~
wsi10 0.458 0.058 7.901 0.000 0.462 0.462 wpro7 ~
wpro5 0.172 0.048 3.572 0.000 0.184 0.184 wpro10 ~
wpro7 0.082 0.059 1.382 0.167 0.084 0.084 wpro12 ~
wpro10 0.068 0.063 1.087 0.277 0.061 0.061 wad7 ~
wad5 0.320 0.066 4.829 0.000 0.343 0.343 wad10 ~
wad7 0.131 0.106 1.243 0.214 0.157 0.157 wad12 ~
wad10 0.348 0.130 2.672 0.008 0.310 0.310 wad7 ~
wsi5 (e1) -0.059 0.082 -0.719 0.472 -0.025 -0.025 wad10 ~
wsi7 (e1) -0.059 0.082 -0.719 0.472 -0.032 -0.032 wad12 ~
wsi10 (e1) -0.059 0.082 -0.719 0.472 -0.036 -0.036 wsi7 ~
wad5 (f1) 0.073 0.021 3.438 0.001 0.173 0.173 wsi10 ~
wad7 (f1) 0.073 0.021 3.438 0.001 0.129 0.129 wsi12 ~
wad10 (f1) 0.073 0.021 3.438 0.001 0.109 0.109 wsi7 ~
wpro5 (b1) -0.005 0.012 -0.422 0.673 -0.017 -0.017 wad7 ~
wpro5 (d1) -0.040 0.024 -1.672 0.094 -0.058 -0.058 wpro12 ~
wsi10 (c1) -0.012 0.104 -0.111 0.912 -0.004 -0.004 wad10 (a1) -0.065 0.050 -1.290 0.197 -0.037 -0.037 wpro7 ~
wad5 (a1) -0.065 0.050 -1.290 0.197 -0.051 -0.051 wsi10 ~
wpro7 (b1) -0.005 0.012 -0.422 0.673 -0.013 -0.013 wpro10 ~
wad7 (a1) -0.065 0.050 -1.290 0.197 -0.049 -0.049 wsi12 ~
wpro10 (b1) -0.005 0.012 -0.422 0.673 -0.012 -0.012 wpro7 ~
wsi5 (c1) -0.012 0.104 -0.111 0.912 -0.004 -0.004 wad10 ~
wpro7 (d1) -0.040 0.024 -1.672 0.094 -0.065 -0.065 wpro10 ~
wsi7 (c1) -0.012 0.104 -0.111 0.912 -0.004 -0.004 wad12 ~
wpro10 (d1) -0.040 0.024 -1.672 0.094 -0.057 -0.057

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.597 0.145 -4.128 0.000 -0.263 -0.263 wad5 ~~
wpro5 -1.104 0.365 -3.024 0.002 -0.194 -0.194 wsi5 ~~
wad5 0.508 0.140 3.630 0.000 0.303 0.303 .wsi7 ~~
.wpro7 -0.384 0.109 -3.520 0.000 -0.180 -0.180 .wad7 ~~
.wpro7 -0.278 0.222 -1.253 0.210 -0.061 -0.061 .wsi7 ~~
.wad7 0.435 0.146 2.982 0.003 0.288 0.288 .wsi10 ~~
.wpro10 -0.251 0.132 -1.899 0.058 -0.096 -0.096 .wad10 ~~
.wpro10 -0.243 0.230 -1.059 0.290 -0.062 -0.062 .wsi10 ~~
.wad10 0.410 0.111 3.706 0.000 0.249 0.249 .wsi12 ~~
.wpro12 -0.214 0.111 -1.936 0.053 -0.083 -0.083 .wad12 ~~
.wpro12 -0.150 0.226 -0.662 0.508 -0.031 -0.031 .wsi12 ~~
.wad12 0.393 0.101 3.907 0.000 0.253 0.253 RIad ~~
RIsi 0.442 0.099 4.479 0.000 0.484 0.484 RIpro -1.079 0.237 -4.559 0.000 -0.421 -0.421 RIsi ~~
RIpro -0.457 0.097 -4.727 0.000 -0.498 -0.498

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.042 0.095 21.549 0.000 2.042 0.786 .tadhde7 1.791 0.094 18.974 0.000 1.791 0.719 .tadhde10 1.375 0.084 16.396 0.000 1.375 0.610 .tadhde12 1.389 0.090 15.477 0.000 1.389 0.581 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.729 .sisoe7 0.743 0.039 19.075 0.000 0.743 0.718 .sisoe10 0.814 0.046 17.873 0.000 0.814 0.668 .sisoe12 0.872 0.046 19.147 0.000 0.872 0.722 .proe5 14.064 0.118 119.559 0.000 14.064 4.386 .proe7 14.855 0.116 128.516 0.000 14.855 4.879 .proe10 15.616 0.112 139.694 0.000 15.616 5.223 .proe12 15.271 0.122 125.409 0.000 15.271 4.708 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIpro 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wpro5 0.000 0.000 0.000 .wpro7 0.000 0.000 0.000 .wpro10 0.000 0.000 0.000 .wpro12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 4.199 0.496 8.459 0.000 1.000 1.000 wsi5 0.668 0.101 6.604 0.000 1.000 1.000 wpro5 7.706 0.511 15.075 0.000 1.000 1.000 .wad7 3.204 0.394 8.125 0.000 0.876 0.876 .wsi7 0.712 0.095 7.521 0.000 0.957 0.957 .wpro7 6.422 0.420 15.274 0.000 0.959 0.959 .wad10 2.466 0.483 5.100 0.000 0.972 0.972 .wsi10 1.098 0.154 7.121 0.000 0.950 0.950 .wpro10 6.297 0.458 13.739 0.000 0.989 0.989 .wad12 2.871 0.389 7.388 0.000 0.903 0.903 .wsi12 0.845 0.077 10.962 0.000 0.746 0.746 .wpro12 7.900 0.618 12.794 0.000 0.994 0.994 RIad 2.549 0.394 6.466 0.000 1.000 1.000 RIsi 0.327 0.068 4.840 0.000 1.000 1.000 RIpro 2.575 0.341 7.548 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .proe5 0.000 0.000 0.000 .proe7 0.000 0.000 0.000 .proe10 0.000 0.000 0.000 .proe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.962 0.639 tadhde7 1.000 1.962 0.673 tadhde10 1.000 1.962 0.690 tadhde12 1.000 1.962 0.654 RIsi =~
sisoe5 1.000 0.854 0.624 sisoe7 1.000 0.854 0.637 sisoe10 1.000 0.854 0.586 sisoe12 1.000 0.854 0.505 RIpro =~
proe5 1.000 2.004 0.581 proe7 1.000 2.004 0.582 proe10 1.000 2.004 0.583 proe12 1.000 2.004 0.570 wsi5 =~
sisoe5 1.000 1.069 0.781 wsi7 =~
sisoe7 1.000 1.032 0.771 wsi10 =~
sisoe10 1.000 1.180 0.810 wsi12 =~
sisoe12 1.000 1.459 0.863 wad5 =~
tadhde5 1.000 2.359 0.769 wad7 =~
tadhde7 1.000 2.157 0.740 wad10 =~
tadhde10 1.000 2.056 0.723 wad12 =~
tadhde12 1.000 2.273 0.757 wpro5 =~
proe5 1.000 2.809 0.814 wpro7 =~
proe7 1.000 2.802 0.813 wpro10 =~
proe10 1.000 2.796 0.813 wpro12 =~
proe12 1.000 2.887 0.821

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.202 0.092 2.193 0.028 0.210 0.210 wsi10 ~
wsi7 0.210 0.100 2.097 0.036 0.184 0.184 wsi12 ~
wsi10 0.472 0.072 6.546 0.000 0.382 0.382 wpro7 ~
wpro5 0.140 0.054 2.575 0.010 0.140 0.140 wpro10 ~
wpro7 0.093 0.060 1.541 0.123 0.093 0.093 wpro12 ~
wpro10 0.226 0.063 3.611 0.000 0.219 0.219 wad7 ~
wad5 0.179 0.070 2.552 0.011 0.195 0.195 wad10 ~
wad7 0.116 0.094 1.231 0.218 0.122 0.122 wad12 ~
wad10 0.369 0.093 3.960 0.000 0.334 0.334 wad7 ~
wsi5 (e2) 0.139 0.104 1.337 0.181 0.069 0.069 wad10 ~
wsi7 (e2) 0.139 0.104 1.337 0.181 0.070 0.070 wad12 ~
wsi10 (e2) 0.139 0.104 1.337 0.181 0.072 0.072 wsi7 ~
wad5 (f2) 0.060 0.024 2.532 0.011 0.137 0.137 wsi10 ~
wad7 (f2) 0.060 0.024 2.532 0.011 0.110 0.110 wsi12 ~
wad10 (f2) 0.060 0.024 2.532 0.011 0.085 0.085 wsi7 ~
wpro5 (b2) -0.007 0.014 -0.511 0.609 -0.020 -0.020 wad7 ~
wpro5 (d2) -0.033 0.024 -1.393 0.163 -0.043 -0.043 wpro12 ~
wsi10 (c2) -0.177 0.104 -1.703 0.089 -0.072 -0.072 wad10 (a2) -0.031 0.045 -0.693 0.488 -0.022 -0.022 wpro7 ~
wad5 (a2) -0.031 0.045 -0.693 0.488 -0.026 -0.026 wsi10 ~
wpro7 (b2) -0.007 0.014 -0.511 0.609 -0.017 -0.017 wpro10 ~
wad7 (a2) -0.031 0.045 -0.693 0.488 -0.024 -0.024 wsi12 ~
wpro10 (b2) -0.007 0.014 -0.511 0.609 -0.014 -0.014 wpro7 ~
wsi5 (c2) -0.177 0.104 -1.703 0.089 -0.068 -0.068 wad10 ~
wpro7 (d2) -0.033 0.024 -1.393 0.163 -0.045 -0.045 wpro10 ~
wsi7 (c2) -0.177 0.104 -1.703 0.089 -0.065 -0.065 wad12 ~
wpro10 (d2) -0.033 0.024 -1.393 0.163 -0.041 -0.041

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.035 0.193 -0.182 0.855 -0.012 -0.012 wad5 ~~
wpro5 -0.363 0.397 -0.912 0.362 -0.055 -0.055 wsi5 ~~
wad5 0.732 0.259 2.831 0.005 0.290 0.290 .wsi7 ~~
.wpro7 -0.491 0.189 -2.603 0.009 -0.180 -0.180 .wad7 ~~
.wpro7 -1.147 0.331 -3.463 0.001 -0.198 -0.198 .wsi7 ~~
.wad7 0.694 0.202 3.436 0.001 0.334 0.334 .wsi10 ~~
.wpro10 -0.894 0.171 -5.223 0.000 -0.282 -0.282 .wad10 ~~
.wpro10 -1.072 0.335 -3.203 0.001 -0.191 -0.191 .wsi10 ~~
.wad10 0.878 0.217 4.046 0.000 0.380 0.380 .wsi12 ~~
.wpro12 -0.509 0.179 -2.847 0.004 -0.138 -0.138 .wad12 ~~
.wpro12 -0.618 0.280 -2.205 0.027 -0.106 -0.106 .wsi12 ~~
.wad12 0.859 0.202 4.252 0.000 0.310 0.310 RIad ~~
RIsi 0.837 0.157 5.341 0.000 0.500 0.500 RIpro -2.057 0.336 -6.122 0.000 -0.523 -0.523 RIsi ~~
RIpro -0.891 0.176 -5.070 0.000 -0.521 -0.521

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.974 0.112 26.461 0.000 2.974 0.969 .tadhde7 2.342 0.108 21.637 0.000 2.342 0.803 .tadhde10 2.133 0.105 20.222 0.000 2.133 0.751 .tadhde12 2.063 0.113 18.325 0.000 2.063 0.687 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.741 .sisoe7 1.043 0.050 20.868 0.000 1.043 0.779 .sisoe10 1.182 0.054 21.768 0.000 1.182 0.812 .sisoe12 1.252 0.063 19.978 0.000 1.252 0.741 .proe5 13.730 0.124 110.306 0.000 13.730 3.979 .proe7 14.224 0.129 110.252 0.000 14.224 4.129 .proe10 15.137 0.128 118.502 0.000 15.137 4.400 .proe12 14.674 0.133 110.508 0.000 14.674 4.176 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIpro 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wpro5 0.000 0.000 0.000 .wpro7 0.000 0.000 0.000 .wpro10 0.000 0.000 0.000 .wpro12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 5.567 0.613 9.076 0.000 1.000 1.000 wsi5 1.142 0.242 4.728 0.000 1.000 1.000 wpro5 7.888 0.643 12.265 0.000 1.000 1.000 .wad7 4.405 0.557 7.912 0.000 0.946 0.946 .wsi7 0.980 0.141 6.923 0.000 0.920 0.920 .wpro7 7.641 0.479 15.961 0.000 0.974 0.974 .wad10 4.093 0.521 7.849 0.000 0.968 0.968 .wsi10 1.304 0.156 8.350 0.000 0.937 0.937 .wpro10 7.676 0.580 13.245 0.000 0.982 0.982 .wad12 4.414 0.510 8.649 0.000 0.855 0.855 .wsi12 1.738 0.198 8.758 0.000 0.817 0.817 .wpro12 7.780 0.434 17.944 0.000 0.933 0.933 RIad 3.851 0.449 8.578 0.000 1.000 1.000 RIsi 0.729 0.121 6.008 0.000 1.000 1.000 RIpro 4.016 0.505 7.956 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .proe5 0.000 0.000 0.000 .proe7 0.000 0.000 0.000 .proe10 0.000 0.000 0.000 .proe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.562 0.620 tadhde7 1.000 1.562 0.732 tadhde10 1.000 1.562 0.721 tadhde12 1.000 1.562 0.785 RIsi =~
sisoe5 1.000 0.541 0.535 sisoe7 1.000 0.541 0.509 sisoe10 1.000 0.541 0.472 sisoe12 1.000 0.541 0.515 RIpro =~
proe5 1.000 1.629 0.542 proe7 1.000 1.629 0.526 proe10 1.000 1.629 0.597 proe12 1.000 1.629 0.554 wsi5 =~
sisoe5 1.000 0.855 0.845 wsi7 =~
sisoe7 1.000 0.915 0.861 wsi10 =~
sisoe10 1.000 1.010 0.882 wsi12 =~
sisoe12 1.000 0.899 0.857 wad5 =~
tadhde5 1.000 1.978 0.785 wad7 =~
tadhde7 1.000 1.455 0.682 wad10 =~
tadhde10 1.000 1.503 0.693 wad12 =~
tadhde12 1.000 1.232 0.619 wpro5 =~
proe5 1.000 2.529 0.841 wpro7 =~
proe7 1.000 2.635 0.851 wpro10 =~
proe10 1.000 2.190 0.802 wpro12 =~
proe12 1.000 2.449 0.833

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.296 0.080 3.702 0.000 0.277 0.277 wsi10 ~
wsi7 0.352 0.076 4.627 0.000 0.319 0.319 wsi12 ~
wsi10 0.265 0.064 4.165 0.000 0.298 0.298 wpro7 ~
wpro5 0.138 0.054 2.553 0.011 0.133 0.133 wpro10 ~
wpro7 0.077 0.047 1.621 0.105 0.092 0.092 wpro12 ~
wpro10 0.129 0.063 2.037 0.042 0.115 0.115 wad7 ~
wad5 0.183 0.064 2.875 0.004 0.248 0.248 wad10 ~
wad7 0.013 0.108 0.118 0.906 0.012 0.012 wad12 ~
wad10 0.025 0.111 0.221 0.825 0.030 0.030 wad7 ~
wsi5 (e3) 0.012 0.086 0.145 0.885 0.007 0.007 wad10 ~
wsi7 (e3) 0.012 0.086 0.145 0.885 0.008 0.008 wad12 ~
wsi10 (e3) 0.012 0.086 0.145 0.885 0.010 0.010 wsi7 ~
wad5 (f3) -0.035 0.024 -1.434 0.151 -0.075 -0.075 wsi10 ~
wad7 (f3) -0.035 0.024 -1.434 0.151 -0.050 -0.050 wsi12 ~
wad10 (f3) -0.035 0.024 -1.434 0.151 -0.058 -0.058 wsi7 ~
wpro5 (b3) -0.015 0.015 -1.037 0.300 -0.042 -0.042 wad7 ~
wpro5 (d3) -0.037 0.023 -1.637 0.102 -0.065 -0.065 wpro12 ~
wsi10 (c3) -0.105 0.109 -0.960 0.337 -0.043 -0.043 wad10 (a3) 0.078 0.051 1.535 0.125 0.048 0.048 wpro7 ~
wad5 (a3) 0.078 0.051 1.535 0.125 0.059 0.059 wsi10 ~
wpro7 (b3) -0.015 0.015 -1.037 0.300 -0.039 -0.039 wpro10 ~
wad7 (a3) 0.078 0.051 1.535 0.125 0.052 0.052 wsi12 ~
wpro10 (b3) -0.015 0.015 -1.037 0.300 -0.037 -0.037 wpro7 ~
wsi5 (c3) -0.105 0.109 -0.960 0.337 -0.034 -0.034 wad10 ~
wpro7 (d3) -0.037 0.023 -1.637 0.102 -0.066 -0.066 wpro10 ~
wsi7 (c3) -0.105 0.109 -0.960 0.337 -0.044 -0.044 wad12 ~
wpro10 (d3) -0.037 0.023 -1.637 0.102 -0.066 -0.066

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.365 0.117 -3.124 0.002 -0.169 -0.169 wad5 ~~
wpro5 -0.610 0.255 -2.393 0.017 -0.122 -0.122 wsi5 ~~
wad5 0.419 0.118 3.560 0.000 0.248 0.248 .wsi7 ~~
.wpro7 -0.270 0.116 -2.336 0.019 -0.118 -0.118 .wad7 ~~
.wpro7 -0.143 0.200 -0.716 0.474 -0.039 -0.039 .wsi7 ~~
.wad7 0.030 0.086 0.346 0.729 0.024 0.024 .wsi10 ~~
.wpro10 -0.615 0.135 -4.553 0.000 -0.297 -0.297 .wad10 ~~
.wpro10 -0.423 0.243 -1.744 0.081 -0.130 -0.130 .wsi10 ~~
.wad10 0.280 0.112 2.495 0.013 0.196 0.196 .wsi12 ~~
.wpro12 -0.516 0.122 -4.238 0.000 -0.248 -0.248 .wad12 ~~
.wpro12 -0.281 0.190 -1.476 0.140 -0.094 -0.094 .wsi12 ~~
.wad12 0.112 0.077 1.449 0.147 0.106 0.106 RIad ~~
RIsi 0.446 0.091 4.897 0.000 0.528 0.528 RIpro -1.089 0.173 -6.299 0.000 -0.428 -0.428 RIsi ~~
RIpro -0.423 0.095 -4.453 0.000 -0.480 -0.480

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 1.741 0.090 19.313 0.000 1.741 0.691 .tadhde7 1.317 0.080 16.506 0.000 1.317 0.617 .tadhde10 1.193 0.081 14.732 0.000 1.193 0.550 .tadhde12 0.922 0.073 12.709 0.000 0.922 0.464 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.691 .sisoe7 0.709 0.040 17.876 0.000 0.709 0.667 .sisoe10 0.824 0.043 19.173 0.000 0.824 0.719 .sisoe12 0.700 0.040 17.625 0.000 0.700 0.667 .proe5 14.581 0.111 131.913 0.000 14.581 4.847 .proe7 14.872 0.113 131.128 0.000 14.872 4.800 .proe10 15.883 0.101 156.589 0.000 15.883 5.818 .proe12 15.654 0.108 144.552 0.000 15.654 5.321 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIpro 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wpro5 0.000 0.000 0.000 .wpro7 0.000 0.000 0.000 .wpro10 0.000 0.000 0.000 .wpro12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 3.913 0.555 7.051 0.000 1.000 1.000 wsi5 0.731 0.095 7.688 0.000 1.000 1.000 wpro5 6.394 0.407 15.719 0.000 1.000 1.000 .wad7 1.967 0.290 6.790 0.000 0.929 0.929 .wsi7 0.773 0.104 7.441 0.000 0.923 0.923 .wpro7 6.799 0.419 16.233 0.000 0.979 0.979 .wad10 2.248 0.534 4.212 0.000 0.995 0.995 .wsi10 0.910 0.101 8.977 0.000 0.892 0.892 .wpro10 4.733 0.373 12.704 0.000 0.986 0.986 .wad12 1.508 0.367 4.108 0.000 0.994 0.994 .wsi12 0.734 0.084 8.750 0.000 0.907 0.907 .wpro12 5.890 0.370 15.930 0.000 0.982 0.982 RIad 2.441 0.381 6.403 0.000 1.000 1.000 RIsi 0.293 0.065 4.497 0.000 1.000 1.000 RIpro 2.654 0.285 9.324 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .proe5 0.000 0.000 0.000 .proe7 0.000 0.000 0.000 .proe10 0.000 0.000 0.000 .proe12 0.000 0.000 0.000

Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1mid 0.000 0.001 0.401 0.688 0.001 0.001 indirect1low 0.000 0.001 0.407 0.684 0.000 0.000 indirect1high -0.001 0.001 -0.955 0.340 -0.002 -0.002 indirect2mid 0.000 0.004 0.111 0.912 0.000 0.000 indirect2low 0.006 0.005 1.082 0.279 0.003 0.003 indirect2high 0.004 0.005 0.831 0.406 0.003 0.003

Constrained full cross-lag RI-CLPM mediation model - SES constraints

Autoregressive paths are constrained to be equal across groups of SES but freed across time.

Cross lags are constrained to be equal across groups AND across time.

ri.med.long.pro.c.ses <- ' 
                  ###### Create random intercepts ###### 
                  RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 
                  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 
                  RIpro =~ 1*proe5 + 1*proe7 + 1*proe10  + 1*proe12
                
                  ###### Create within-person variables ######
                  ## Isolation
                  wsi5 =~ 1*sisoe5
                  wsi7 =~ 1*sisoe7
                  wsi10 =~ 1*sisoe10
                  wsi12 =~ 1*sisoe12
                  ## ADHD
                  wad5 =~ 1*tadhde5
                  wad7 =~ 1*tadhde7
                  wad10 =~ 1*tadhde10
                  wad12 =~ 1*tadhde12
                  ## Prosocial 
                  wpro5 =~ 1*proe5
                  wpro7 =~ 1*proe7
                  wpro10 =~ 1*proe10
                  wpro12 =~ 1*proe12
                  
                  ###### Autoregressive lags ######
                  ## Isolation
                  wsi7 ~ c(g1,g1,g1)*wsi5
                  wsi10 ~ c(g2,g2,g2)*wsi7
                  wsi12 ~ c(g3,g3,g3)*wsi10
                  ## Pro social behaviour
                  wpro7 ~ c(h1,h1,h1)*wpro5
                  wpro10 ~ c(h2,h2,h2)*wpro7
                  wpro12 ~ c(h3,h3,h3)*wpro10
                  ## ADHD
                  wad7 ~ c(i1,i1,i1)*wad5
                  wad10 ~ c(i2,i2,i2)*wad7
                  wad12 ~ c(i3,i3,i3)*wad10
                  
                  ###### Cross lag paths ######
                  ## Isolation
                  wad7 ~ c(e,e,e)*wsi5
                  wad10 ~ c(e,e,e)*wsi7
                  wad12 ~ c(e,e,e)*wsi10
                  ## ADHD
                  wsi7 ~ c(f,f,f)*wad5
                  wsi10 ~ c(f,f,f)*wad7
                  wsi12 ~ c(f,f,f)*wad10
                  ## Prosocial
                  wsi7 ~ c(b,b,b)*wpro5
                  wad7 ~ c(d,d,d)*wpro5
                  wpro12 ~ c(c,c,c)*wsi10
                  wpro12 ~ c(a,a,a)*wad10
                  
                  ###### Mediation paths ######
                  ## ADHD to Isolation
                  wpro7 ~ c(a,a,a)*wad5 
                  wsi10 ~ c(b,b,b)*wpro7
                  wpro10 ~ c(a,a,a)*wad7 
                  wsi12 ~ c(b,b,b)*wpro10
                  ## Isolation to ADHD
                  wpro7 ~ c(c,c,c)*wsi5
                  wad10 ~ c(d,d,d)*wpro7
                  wpro10 ~ c(c,c,c)*wsi7
                  wad12 ~ c(d,d,d)*wpro10
                  
                  ###### Covariances ######
                  wsi5 ~~ wpro5
                  wpro5 ~~ wad5
                  wsi5 ~~ wad5
                  wsi7 ~~ wpro7
                  wpro7 ~~ wad7
                  wsi7 ~~ wad7
                  wsi10 ~~ wpro10
                  wpro10 ~~ wad10
                  wsi10 ~~ wad10
                  wsi12 ~~ wpro12
                  wpro12 ~~ wad12
                  wsi12 ~~ wad12
                    
                  ###### Variances ######
                  ## Variances
                  wad5 ~~ wad5 
                  wsi5 ~~ wsi5 
                  wpro5 ~~ wpro5
                  ## Residual variances
                  wad7 ~~ wad7 
                  wsi7 ~~ wsi7 
                  wpro7 ~~ wpro7
                  wad10 ~~ wad10 
                  wsi10 ~~ wsi10 
                  wpro10 ~~ wpro10
                  wad12 ~~ wad12 
                  wsi12 ~~ wsi12
                  wpro12 ~~ wpro12
                  
                  ###### Variance and covariance of random intercepts ######
                  RIad ~~ RIad
                  RIsi ~~ RIsi
                  RIpro ~~ RIpro
                  RIad ~~ RIsi
                  RIad ~~ RIpro
                  RIsi ~~ RIpro
         '
ri.med.long.pro.c.ses.fit <- lavaan(ri.med.long.pro.c.ses, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

ri.med.long.pro.c.ses.fit.summary <- summary(ri.med.long.pro.c.ses.fit, standardized = TRUE, fit.measures = TRUE)

lavaan 0.6-10 ended normally after 265 iterations

Estimator ML Optimization method NLMINB Number of model parameters 207 Number of equality constraints 66

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 321.942 233.753 Degrees of freedom 129 129 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.377 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 101.991 74.052 Low 74.711 54.245 High 145.241 105.455

Model Test Baseline Model:

Test statistic 8229.986 5660.521 Degrees of freedom 198 198 P-value 0.000 0.000 Scaling correction factor 1.454

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.976 0.981 Tucker-Lewis Index (TLI) 0.963 0.971

Robust Comparative Fit Index (CFI) 0.982 Robust Tucker-Lewis Index (TLI) 0.972

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -52678.441 -52678.441 Scaling correction factor 1.306 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.659 for the MLR correction

Akaike (AIC) 105638.881 105638.881 Bayesian (BIC) 106444.084 106444.084 Sample-size adjusted Bayesian (BIC) 105996.104 105996.104

Root Mean Square Error of Approximation:

RMSEA 0.045 0.033 90 Percent confidence interval - lower 0.039 0.027 90 Percent confidence interval - upper 0.051 0.039 P-value RMSEA <= 0.05 0.915 1.000

Robust RMSEA 0.039 90 Percent confidence interval - lower 0.031 90 Percent confidence interval - upper 0.047

Standardized Root Mean Square Residual:

SRMR 0.042 0.042

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.665 0.637 tadhde7 1.000 1.665 0.677 tadhde10 1.000 1.665 0.735 tadhde12 1.000 1.665 0.699 RIsi =~
sisoe5 1.000 0.546 0.544 sisoe7 1.000 0.546 0.518 sisoe10 1.000 0.546 0.447 sisoe12 1.000 0.546 0.471 RIpro =~
proe5 1.000 1.586 0.498 proe7 1.000 1.586 0.524 proe10 1.000 1.586 0.527 proe12 1.000 1.586 0.482 wsi5 =~
sisoe5 1.000 0.843 0.839 wsi7 =~
sisoe7 1.000 0.903 0.856 wsi10 =~
sisoe10 1.000 1.092 0.895 wsi12 =~
sisoe12 1.000 1.022 0.882 wad5 =~
tadhde5 1.000 2.013 0.770 wad7 =~
tadhde7 1.000 1.812 0.736 wad10 =~
tadhde10 1.000 1.537 0.678 wad12 =~
tadhde12 1.000 1.703 0.715 wpro5 =~
proe5 1.000 2.763 0.867 wpro7 =~
proe7 1.000 2.579 0.852 wpro10 =~
proe10 1.000 2.554 0.850 wpro12 =~
proe12 1.000 2.881 0.876

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 (g1) 0.208 0.051 4.048 0.000 0.194 0.194 wsi10 ~
wsi7 (g2) 0.281 0.052 5.367 0.000 0.232 0.232 wsi12 ~
wsi10 (g3) 0.399 0.040 9.973 0.000 0.427 0.427 wpro7 ~
wpro5 (h1) 0.150 0.030 4.989 0.000 0.161 0.161 wpro10 ~
wpro7 (h2) 0.082 0.031 2.623 0.009 0.083 0.083 wpro12 ~
wpro10 (h3) 0.150 0.037 4.078 0.000 0.133 0.133 wad7 ~
wad5 (i1) 0.214 0.039 5.431 0.000 0.237 0.237 wad10 ~
wad7 (i2) 0.073 0.062 1.187 0.235 0.086 0.086 wad12 ~
wad10 (i3) 0.211 0.071 2.969 0.003 0.191 0.191 wad7 ~
wsi5 (e) 0.037 0.055 0.675 0.500 0.017 0.017 wad10 ~
wsi7 (e) 0.037 0.055 0.675 0.500 0.022 0.022 wad12 ~
wsi10 (e) 0.037 0.055 0.675 0.500 0.024 0.024 wsi7 ~
wad5 (f) 0.030 0.014 2.204 0.028 0.067 0.067 wsi10 ~
wad7 (f) 0.030 0.014 2.204 0.028 0.050 0.050 wsi12 ~
wad10 (f) 0.030 0.014 2.204 0.028 0.045 0.045 wsi7 ~
wpro5 (b) -0.008 0.008 -1.054 0.292 -0.025 -0.025 wad7 ~
wpro5 (d) -0.040 0.014 -2.847 0.004 -0.061 -0.061 wpro12 ~
wsi10 (c) -0.116 0.060 -1.952 0.051 -0.044 -0.044 wad10 (a) -0.016 0.029 -0.544 0.586 -0.008 -0.008 wpro7 ~
wad5 (a) -0.016 0.029 -0.544 0.586 -0.012 -0.012 wsi10 ~
wpro7 (b) -0.008 0.008 -1.054 0.292 -0.019 -0.019 wpro10 ~
wad7 (a) -0.016 0.029 -0.544 0.586 -0.011 -0.011 wsi12 ~
wpro10 (b) -0.008 0.008 -1.054 0.292 -0.020 -0.020 wpro7 ~
wsi5 (c) -0.116 0.060 -1.952 0.051 -0.038 -0.038 wad10 ~
wpro7 (d) -0.040 0.014 -2.847 0.004 -0.068 -0.068 wpro10 ~
wsi7 (c) -0.116 0.060 -1.952 0.051 -0.041 -0.041 wad12 ~
wpro10 (d) -0.040 0.014 -2.847 0.004 -0.060 -0.060

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.625 0.145 -4.317 0.000 -0.268 -0.268 wad5 ~~
wpro5 -1.035 0.331 -3.129 0.002 -0.186 -0.186 wsi5 ~~
wad5 0.500 0.130 3.859 0.000 0.295 0.295 .wsi7 ~~
.wpro7 -0.444 0.103 -4.307 0.000 -0.199 -0.199 .wad7 ~~
.wpro7 -0.252 0.204 -1.235 0.217 -0.057 -0.057 .wsi7 ~~
.wad7 0.439 0.140 3.142 0.002 0.286 0.286 .wsi10 ~~
.wpro10 -0.293 0.130 -2.253 0.024 -0.109 -0.109 .wad10 ~~
.wpro10 -0.237 0.223 -1.065 0.287 -0.061 -0.061 .wsi10 ~~
.wad10 0.411 0.107 3.845 0.000 0.255 0.255 .wsi12 ~~
.wpro12 -0.221 0.111 -2.000 0.045 -0.085 -0.085 .wad12 ~~
.wpro12 -0.149 0.225 -0.660 0.509 -0.031 -0.031 .wsi12 ~~
.wad12 0.349 0.098 3.544 0.000 0.229 0.229 RIad ~~
RIsi 0.473 0.092 5.117 0.000 0.520 0.520 RIpro -1.148 0.212 -5.411 0.000 -0.435 -0.435 RIsi ~~
RIpro -0.427 0.099 -4.292 0.000 -0.493 -0.493

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.042 0.095 21.549 0.000 2.042 0.782 .tadhde7 1.790 0.094 18.958 0.000 1.790 0.727 .tadhde10 1.374 0.084 16.424 0.000 1.374 0.606 .tadhde12 1.388 0.090 15.434 0.000 1.388 0.583 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.724 .sisoe7 0.743 0.039 19.053 0.000 0.743 0.705 .sisoe10 0.814 0.046 17.854 0.000 0.814 0.667 .sisoe12 0.872 0.046 19.115 0.000 0.872 0.753 .proe5 14.064 0.118 119.559 0.000 14.064 4.415 .proe7 14.855 0.116 128.555 0.000 14.855 4.907 .proe10 15.617 0.112 139.645 0.000 15.617 5.195 .proe12 15.271 0.122 125.359 0.000 15.271 4.644 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIpro 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wpro5 0.000 0.000 0.000 .wpro7 0.000 0.000 0.000 .wpro10 0.000 0.000 0.000 .wpro12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 4.051 0.468 8.650 0.000 1.000 1.000 wsi5 0.710 0.097 7.283 0.000 1.000 1.000 wpro5 7.634 0.487 15.673 0.000 1.000 1.000 .wad7 3.059 0.353 8.661 0.000 0.931 0.931 .wsi7 0.771 0.089 8.631 0.000 0.946 0.946 .wpro7 6.442 0.393 16.400 0.000 0.968 0.968 .wad10 2.325 0.382 6.081 0.000 0.985 0.985 .wsi10 1.114 0.148 7.546 0.000 0.934 0.934 .wpro10 6.454 0.433 14.920 0.000 0.989 0.989 .wad12 2.768 0.361 7.669 0.000 0.955 0.955 .wsi12 0.839 0.077 10.881 0.000 0.803 0.803 .wpro12 8.120 0.593 13.697 0.000 0.979 0.979 RIad 2.773 0.332 8.354 0.000 1.000 1.000 RIsi 0.298 0.066 4.524 0.000 1.000 1.000 RIpro 2.514 0.306 8.227 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .proe5 0.000 0.000 0.000 .proe7 0.000 0.000 0.000 .proe10 0.000 0.000 0.000 .proe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 2.047 0.650 tadhde7 1.000 2.047 0.690 tadhde10 1.000 2.047 0.730 tadhde12 1.000 2.047 0.697 RIsi =~
sisoe5 1.000 0.857 0.621 sisoe7 1.000 0.857 0.641 sisoe10 1.000 0.857 0.585 sisoe12 1.000 0.857 0.521 RIpro =~
proe5 1.000 2.049 0.586 proe7 1.000 2.049 0.592 proe10 1.000 2.049 0.600 proe12 1.000 2.049 0.591 wsi5 =~
sisoe5 1.000 1.081 0.784 wsi7 =~
sisoe7 1.000 1.025 0.767 wsi10 =~
sisoe10 1.000 1.188 0.811 wsi12 =~
sisoe12 1.000 1.403 0.853 wad5 =~
tadhde5 1.000 2.391 0.760 wad7 =~
tadhde7 1.000 2.147 0.724 wad10 =~
tadhde10 1.000 1.917 0.684 wad12 =~
tadhde12 1.000 2.103 0.717 wpro5 =~
proe5 1.000 2.835 0.811 wpro7 =~
proe7 1.000 2.788 0.806 wpro10 =~
proe10 1.000 2.731 0.800 wpro12 =~
proe12 1.000 2.795 0.806

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 (g1) 0.208 0.051 4.048 0.000 0.219 0.219 wsi10 ~
wsi7 (g2) 0.281 0.052 5.367 0.000 0.242 0.242 wsi12 ~
wsi10 (g3) 0.399 0.040 9.973 0.000 0.338 0.338 wpro7 ~
wpro5 (h1) 0.150 0.030 4.989 0.000 0.152 0.152 wpro10 ~
wpro7 (h2) 0.082 0.031 2.623 0.009 0.084 0.084 wpro12 ~
wpro10 (h3) 0.150 0.037 4.078 0.000 0.146 0.146 wad7 ~
wad5 (i1) 0.214 0.039 5.431 0.000 0.238 0.238 wad10 ~
wad7 (i2) 0.073 0.062 1.187 0.235 0.082 0.082 wad12 ~
wad10 (i3) 0.211 0.071 2.969 0.003 0.193 0.193 wad7 ~
wsi5 (e) 0.037 0.055 0.675 0.500 0.019 0.019 wad10 ~
wsi7 (e) 0.037 0.055 0.675 0.500 0.020 0.020 wad12 ~
wsi10 (e) 0.037 0.055 0.675 0.500 0.021 0.021 wsi7 ~
wad5 (f) 0.030 0.014 2.204 0.028 0.070 0.070 wsi10 ~
wad7 (f) 0.030 0.014 2.204 0.028 0.054 0.054 wsi12 ~
wad10 (f) 0.030 0.014 2.204 0.028 0.041 0.041 wsi7 ~
wpro5 (b) -0.008 0.008 -1.054 0.292 -0.022 -0.022 wad7 ~
wpro5 (d) -0.040 0.014 -2.847 0.004 -0.053 -0.053 wpro12 ~
wsi10 (c) -0.116 0.060 -1.952 0.051 -0.049 -0.049 wad10 (a) -0.016 0.029 -0.544 0.586 -0.011 -0.011 wpro7 ~
wad5 (a) -0.016 0.029 -0.544 0.586 -0.014 -0.014 wsi10 ~
wpro7 (b) -0.008 0.008 -1.054 0.292 -0.019 -0.019 wpro10 ~
wad7 (a) -0.016 0.029 -0.544 0.586 -0.012 -0.012 wsi12 ~
wpro10 (b) -0.008 0.008 -1.054 0.292 -0.016 -0.016 wpro7 ~
wsi5 (c) -0.116 0.060 -1.952 0.051 -0.045 -0.045 wad10 ~
wpro7 (d) -0.040 0.014 -2.847 0.004 -0.059 -0.059 wpro10 ~
wsi7 (c) -0.116 0.060 -1.952 0.051 -0.044 -0.044 wad12 ~
wpro10 (d) -0.040 0.014 -2.847 0.004 -0.052 -0.052

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.073 0.185 -0.392 0.695 -0.024 -0.024 wad5 ~~
wpro5 -0.433 0.394 -1.098 0.272 -0.064 -0.064 wsi5 ~~
wad5 0.718 0.257 2.788 0.005 0.278 0.278 .wsi7 ~~
.wpro7 -0.440 0.159 -2.759 0.006 -0.161 -0.161 .wad7 ~~
.wpro7 -1.104 0.293 -3.765 0.000 -0.193 -0.193 .wsi7 ~~
.wad7 0.582 0.160 3.640 0.000 0.283 0.283 .wsi10 ~~
.wpro10 -0.833 0.159 -5.225 0.000 -0.268 -0.268 .wad10 ~~
.wpro10 -0.921 0.317 -2.903 0.004 -0.178 -0.178 .wsi10 ~~
.wad10 0.754 0.194 3.879 0.000 0.346 0.346 .wsi12 ~~
.wpro12 -0.478 0.178 -2.682 0.007 -0.133 -0.133 .wad12 ~~
.wpro12 -0.580 0.281 -2.061 0.039 -0.103 -0.103 .wsi12 ~~
.wad12 0.816 0.205 3.989 0.000 0.304 0.304 RIad ~~
RIsi 0.972 0.137 7.111 0.000 0.554 0.554 RIpro -2.173 0.303 -7.181 0.000 -0.518 -0.518 RIsi ~~
RIpro -0.940 0.153 -6.130 0.000 -0.536 -0.536

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.974 0.112 26.461 0.000 2.974 0.945 .tadhde7 2.342 0.108 21.631 0.000 2.342 0.790 .tadhde10 2.136 0.106 20.178 0.000 2.136 0.762 .tadhde12 2.064 0.113 18.309 0.000 2.064 0.703 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.735 .sisoe7 1.043 0.050 20.874 0.000 1.043 0.781 .sisoe10 1.183 0.054 21.742 0.000 1.183 0.808 .sisoe12 1.253 0.063 19.976 0.000 1.253 0.762 .proe5 13.730 0.124 110.306 0.000 13.730 3.925 .proe7 14.224 0.129 110.234 0.000 14.224 4.111 .proe10 15.137 0.128 118.643 0.000 15.137 4.434 .proe12 14.674 0.133 110.546 0.000 14.674 4.235 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIpro 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wpro5 0.000 0.000 0.000 .wpro7 0.000 0.000 0.000 .wpro10 0.000 0.000 0.000 .wpro12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 5.715 0.583 9.803 0.000 1.000 1.000 wsi5 1.168 0.251 4.660 0.000 1.000 1.000 wpro5 8.037 0.595 13.514 0.000 1.000 1.000 .wad7 4.313 0.448 9.620 0.000 0.936 0.936 .wsi7 0.985 0.116 8.515 0.000 0.938 0.938 .wpro7 7.567 0.425 17.790 0.000 0.974 0.974 .wad10 3.626 0.502 7.225 0.000 0.986 0.986 .wsi10 1.309 0.144 9.091 0.000 0.928 0.928 .wpro10 7.374 0.520 14.189 0.000 0.989 0.989 .wad12 4.212 0.513 8.216 0.000 0.952 0.952 .wsi12 1.715 0.196 8.731 0.000 0.871 0.871 .wpro12 7.584 0.426 17.783 0.000 0.971 0.971 RIad 4.188 0.427 9.810 0.000 1.000 1.000 RIsi 0.734 0.114 6.425 0.000 1.000 1.000 RIpro 4.197 0.466 9.006 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .proe5 0.000 0.000 0.000 .proe7 0.000 0.000 0.000 .proe10 0.000 0.000 0.000 .proe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.477 0.597 tadhde7 1.000 1.477 0.701 tadhde10 1.000 1.477 0.674 tadhde12 1.000 1.477 0.734 RIsi =~
sisoe5 1.000 0.539 0.545 sisoe7 1.000 0.539 0.510 sisoe10 1.000 0.539 0.476 sisoe12 1.000 0.539 0.479 RIpro =~
proe5 1.000 1.601 0.534 proe7 1.000 1.601 0.515 proe10 1.000 1.601 0.586 proe12 1.000 1.601 0.543 wsi5 =~
sisoe5 1.000 0.829 0.838 wsi7 =~
sisoe7 1.000 0.909 0.860 wsi10 =~
sisoe10 1.000 0.997 0.880 wsi12 =~
sisoe12 1.000 0.987 0.878 wad5 =~
tadhde5 1.000 1.986 0.802 wad7 =~
tadhde7 1.000 1.503 0.713 wad10 =~
tadhde10 1.000 1.618 0.739 wad12 =~
tadhde12 1.000 1.365 0.679 wpro5 =~
proe5 1.000 2.533 0.845 wpro7 =~
proe7 1.000 2.662 0.857 wpro10 =~
proe10 1.000 2.214 0.810 wpro12 =~
proe12 1.000 2.479 0.840

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 (g1) 0.208 0.051 4.048 0.000 0.189 0.189 wsi10 ~
wsi7 (g2) 0.281 0.052 5.367 0.000 0.256 0.256 wsi12 ~
wsi10 (g3) 0.399 0.040 9.973 0.000 0.404 0.404 wpro7 ~
wpro5 (h1) 0.150 0.030 4.989 0.000 0.143 0.143 wpro10 ~
wpro7 (h2) 0.082 0.031 2.623 0.009 0.098 0.098 wpro12 ~
wpro10 (h3) 0.150 0.037 4.078 0.000 0.134 0.134 wad7 ~
wad5 (i1) 0.214 0.039 5.431 0.000 0.282 0.282 wad10 ~
wad7 (i2) 0.073 0.062 1.187 0.235 0.068 0.068 wad12 ~
wad10 (i3) 0.211 0.071 2.969 0.003 0.251 0.251 wad7 ~
wsi5 (e) 0.037 0.055 0.675 0.500 0.021 0.021 wad10 ~
wsi7 (e) 0.037 0.055 0.675 0.500 0.021 0.021 wad12 ~
wsi10 (e) 0.037 0.055 0.675 0.500 0.027 0.027 wsi7 ~
wad5 (f) 0.030 0.014 2.204 0.028 0.065 0.065 wsi10 ~
wad7 (f) 0.030 0.014 2.204 0.028 0.045 0.045 wsi12 ~
wad10 (f) 0.030 0.014 2.204 0.028 0.049 0.049 wsi7 ~
wpro5 (b) -0.008 0.008 -1.054 0.292 -0.022 -0.022 wad7 ~
wpro5 (d) -0.040 0.014 -2.847 0.004 -0.068 -0.068 wpro12 ~
wsi10 (c) -0.116 0.060 -1.952 0.051 -0.047 -0.047 wad10 (a) -0.016 0.029 -0.544 0.586 -0.010 -0.010 wpro7 ~
wad5 (a) -0.016 0.029 -0.544 0.586 -0.012 -0.012 wsi10 ~
wpro7 (b) -0.008 0.008 -1.054 0.292 -0.021 -0.021 wpro10 ~
wad7 (a) -0.016 0.029 -0.544 0.586 -0.011 -0.011 wsi12 ~
wpro10 (b) -0.008 0.008 -1.054 0.292 -0.018 -0.018 wpro7 ~
wsi5 (c) -0.116 0.060 -1.952 0.051 -0.036 -0.036 wad10 ~
wpro7 (d) -0.040 0.014 -2.847 0.004 -0.066 -0.066 wpro10 ~
wsi7 (c) -0.116 0.060 -1.952 0.051 -0.048 -0.048 wad12 ~
wpro10 (d) -0.040 0.014 -2.847 0.004 -0.065 -0.065

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.337 0.115 -2.938 0.003 -0.161 -0.161 wad5 ~~
wpro5 -0.694 0.264 -2.634 0.008 -0.138 -0.138 wsi5 ~~
wad5 0.436 0.119 3.657 0.000 0.265 0.265 .wsi7 ~~
.wpro7 -0.303 0.111 -2.723 0.006 -0.130 -0.130 .wad7 ~~
.wpro7 -0.266 0.191 -1.391 0.164 -0.071 -0.071 .wsi7 ~~
.wad7 0.113 0.084 1.335 0.182 0.089 0.089 .wsi10 ~~
.wpro10 -0.628 0.130 -4.824 0.000 -0.297 -0.297 .wad10 ~~
.wpro10 -0.546 0.247 -2.208 0.027 -0.154 -0.154 .wsi10 ~~
.wad10 0.368 0.114 3.232 0.001 0.238 0.238 .wsi12 ~~
.wpro12 -0.566 0.114 -4.958 0.000 -0.259 -0.259 .wad12 ~~
.wpro12 -0.395 0.190 -2.074 0.038 -0.123 -0.123 .wsi12 ~~
.wad12 0.214 0.076 2.830 0.005 0.183 0.183 RIad ~~
RIsi 0.347 0.078 4.428 0.000 0.436 0.436 RIpro -0.950 0.156 -6.087 0.000 -0.402 -0.402 RIsi ~~
RIpro -0.403 0.080 -5.062 0.000 -0.467 -0.467

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 1.741 0.090 19.313 0.000 1.741 0.704 .tadhde7 1.315 0.080 16.495 0.000 1.315 0.624 .tadhde10 1.192 0.081 14.729 0.000 1.192 0.544 .tadhde12 0.920 0.072 12.713 0.000 0.920 0.457 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.707 .sisoe7 0.708 0.040 17.876 0.000 0.708 0.670 .sisoe10 0.823 0.043 19.174 0.000 0.823 0.726 .sisoe12 0.700 0.040 17.554 0.000 0.700 0.622 .proe5 14.581 0.111 131.913 0.000 14.581 4.866 .proe7 14.873 0.114 131.041 0.000 14.873 4.788 .proe10 15.883 0.101 156.533 0.000 15.883 5.813 .proe12 15.655 0.108 144.388 0.000 15.655 5.304 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIpro 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wpro5 0.000 0.000 0.000 .wpro7 0.000 0.000 0.000 .wpro10 0.000 0.000 0.000 .wpro12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 3.943 0.565 6.974 0.000 1.000 1.000 wsi5 0.687 0.094 7.272 0.000 1.000 1.000 wpro5 6.417 0.394 16.295 0.000 1.000 1.000 .wad7 2.049 0.279 7.345 0.000 0.906 0.906 .wsi7 0.786 0.108 7.309 0.000 0.951 0.951 .wpro7 6.914 0.395 17.504 0.000 0.976 0.976 .wad10 2.589 0.516 5.014 0.000 0.989 0.989 .wsi10 0.923 0.101 9.170 0.000 0.927 0.927 .wpro10 4.835 0.354 13.669 0.000 0.986 0.986 .wad12 1.719 0.356 4.828 0.000 0.922 0.922 .wsi12 0.799 0.082 9.741 0.000 0.820 0.820 .wpro12 5.994 0.359 16.707 0.000 0.975 0.975 RIad 2.180 0.375 5.816 0.000 1.000 1.000 RIsi 0.291 0.066 4.393 0.000 1.000 1.000 RIpro 2.564 0.254 10.108 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .proe5 0.000 0.000 0.000 .proe7 0.000 0.000 0.000 .proe10 0.000 0.000 0.000 .proe12 0.000 0.000 0.000

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(ri.med.long.pro.c.fit, ri.med.long.pro.c.ses.fit, method = "satorra.bentler.2010")

Antisocial behaviours

Constrained full cross-lag RI-CLPM mediation model

Cross-lagged paths are constrained to be equal across time, but freely estimated across SES groups. Autoregressive paths are freely estimated across time and SES groups.

ri.med.long.asb.c <- ' 
                  ###### Create random intercepts ###### 
                  RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 
                  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 
                  RIasb =~ 1*asbe5 + 1*asbe7 + 1*asbe10  + 1*asbe12
                
                  ###### Create within-person variables ######
                  ## Isolation
                  wsi5 =~ 1*sisoe5
                  wsi7 =~ 1*sisoe7
                  wsi10 =~ 1*sisoe10
                  wsi12 =~ 1*sisoe12
                  ## ADHD
                  wad5 =~ 1*tadhde5
                  wad7 =~ 1*tadhde7
                  wad10 =~ 1*tadhde10
                  wad12 =~ 1*tadhde12
                  ## antisocial 
                  wasb5 =~ 1*asbe5
                  wasb7 =~ 1*asbe7
                  wasb10 =~ 1*asbe10
                  wasb12 =~ 1*asbe12
                  
                  ###### Autoregressive lags ###### 
                  ## Isolation
                  wsi7 ~ wsi5
                  wsi10 ~ wsi7
                  wsi12 ~ wsi10
                  ## antisocial bahviour
                  wasb7 ~ wasb5
                  wasb10 ~ wasb7
                  wasb12 ~ wasb10
                  ## ADHD
                  wad7 ~ wad5
                  wad10 ~ wad7
                  wad12 ~ wad10
                  
                  ###### Cross lag paths ######
                  ## Isolation
                  wad7 ~ c(e1,e2,e3)*wsi5
                  wad10 ~ c(e1,e2,e3)*wsi7
                  wad12 ~ c(e1,e2,e3)*wsi10
                  ## ADHD
                  wsi7 ~ c(f1,f2,f3)*wad5
                  wsi10 ~ c(f1,f2,f3)*wad7
                  wsi12 ~ c(f1,f2,f3)*wad10
                  ## antisocial
                  wsi7 ~ c(b1,b2,b3)*wasb5
                  wad7 ~ c(d1,d2,d3)*wasb5
                  wasb12 ~ c(c1,c2,c3)*wsi10
                  wasb12 ~ c(a1,a2,a3)*wad10
                  
                  ###### Mediation paths ######
                  ## ADHD to Isolation
                  wasb7 ~ c(a1,a2,a3)*wad5 
                  wsi10 ~ c(b1,b2,b3)*wasb7
                  wasb10 ~ c(a1,a2,a3)*wad7 
                  wsi12 ~ c(b1,b2,b3)*wasb10
                  ## Isolation to ADHD
                  wasb7 ~ c(c1,c2,c3)*wsi5
                  wad10 ~ c(d1,d2,d3)*wasb7
                  wasb10 ~ c(c1,c2,c3)*wsi7
                  wad12 ~ c(d1,d2,d3)*wasb10
                  
                  ###### Covariances ######
                  wsi5 ~~ wasb5
                  wasb5 ~~ wad5
                  wsi5 ~~ wad5
                  wsi7 ~~ wasb7
                  wasb7 ~~ wad7
                  wsi7 ~~ wad7
                  wsi10 ~~ wasb10
                  wasb10 ~~ wad10
                  wsi10 ~~ wad10
                  wsi12 ~~ wasb12
                  wasb12 ~~ wad12
                  wsi12 ~~ wad12
                    
                  ###### Variances ######
                  ## Variances
                  wad5 ~~ wad5 
                  wsi5 ~~ wsi5 
                  wasb5 ~~ wasb5
                  ## Residual variances
                  wad7 ~~ wad7 
                  wsi7 ~~ wsi7 
                  wasb7 ~~ wasb7
                  wad10 ~~ wad10 
                  wsi10 ~~ wsi10 
                  wasb10 ~~ wasb10
                  wad12 ~~ wad12 
                  wsi12 ~~ wsi12
                  wasb12 ~~ wasb12
                  
                  ###### Variance and covariance of random intercepts ######
                  RIad ~~ RIad
                  RIsi ~~ RIsi
                  RIasb ~~ RIasb
                  RIad ~~ RIsi
                  RIad ~~ RIasb
                  RIsi ~~ RIasb

                  ###### Indirect effect (a*b) ######
                  indirect1mid := a1*b1
                  indirect1low := a2*b2
                  indirect1high := a3*b3
                  indirect2mid := c1*d1
                  indirect2low := c2*d2
                  indirect2high := c3*d3
         '
ri.med.long.asb.c.fit <- lavaan(model = ri.med.long.asb.c, 
                        data = dat,
                        missing = 'ML',
                        group = "SES",
                        meanstructure = TRUE, 
                        int.ov.free = TRUE,   
                        estimator = "MLR")

ri.med.long.asb.c.fit.summary <- summary(ri.med.long.asb.c.fit, standardized = TRUE, fit.measures = TRUE)

lavaan 0.6-10 ended normally after 4440 iterations

Estimator ML Optimization method NLMINB Number of model parameters 207 Number of equality constraints 36

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 230.482 155.817 Degrees of freedom 99 99 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.479 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 73.730 49.845 Low 44.021 29.760 High 112.731 76.212

Model Test Baseline Model:

Test statistic 14369.124 8384.835 Degrees of freedom 198 198 P-value 0.000 0.000 Scaling correction factor 1.714

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.991 0.993 Tucker-Lewis Index (TLI) 0.981 0.986

Robust Comparative Fit Index (CFI) 0.994 Robust Tucker-Lewis Index (TLI) 0.988

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -58658.568 -58658.568 Scaling correction factor 1.826 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.942 for the MLR correction

Akaike (AIC) 117659.136 117659.136 Bayesian (BIC) 118635.657 118635.657 Sample-size adjusted Bayesian (BIC) 118092.363 118092.363

Root Mean Square Error of Approximation:

RMSEA 0.042 0.028 90 Percent confidence interval - lower 0.035 0.021 90 Percent confidence interval - upper 0.049 0.034 P-value RMSEA <= 0.05 0.963 1.000

Robust RMSEA 0.034 90 Percent confidence interval - lower 0.023 90 Percent confidence interval - upper 0.044

Standardized Root Mean Square Residual:

SRMR 0.039 0.039

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.591 0.617 tadhde7 1.000 1.591 0.640 tadhde10 1.000 1.591 0.698 tadhde12 1.000 1.591 0.665 RIsi =~
sisoe5 1.000 0.574 0.574 sisoe7 1.000 0.574 0.554 sisoe10 1.000 0.574 0.471 sisoe12 1.000 0.574 0.477 RIasb =~
asbe5 1.000 5.666 0.690 asbe7 1.000 5.666 0.680 asbe10 1.000 5.666 0.662 asbe12 1.000 5.666 0.629 wsi5 =~
sisoe5 1.000 0.819 0.819 wsi7 =~
sisoe7 1.000 0.863 0.833 wsi10 =~
sisoe10 1.000 1.076 0.882 wsi12 =~
sisoe12 1.000 1.057 0.879 wad5 =~
tadhde5 1.000 2.027 0.787 wad7 =~
tadhde7 1.000 1.911 0.769 wad10 =~
tadhde10 1.000 1.633 0.716 wad12 =~
tadhde12 1.000 1.787 0.747 wasb5 =~
asbe5 1.000 5.950 0.724 wasb7 =~
asbe7 1.000 6.108 0.733 wasb10 =~
asbe10 1.000 6.414 0.750 wasb12 =~
asbe12 1.000 7.011 0.778

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.081 0.090 0.903 0.366 0.077 0.077 wsi10 ~
wsi7 0.183 0.093 1.973 0.048 0.147 0.147 wsi12 ~
wsi10 0.445 0.062 7.169 0.000 0.453 0.453 wasb7 ~
wasb5 0.354 0.083 4.263 0.000 0.345 0.345 wasb10 ~
wasb7 0.263 0.085 3.095 0.002 0.251 0.251 wasb12 ~
wasb10 0.370 0.083 4.460 0.000 0.338 0.338 wad7 ~
wad5 0.304 0.074 4.125 0.000 0.323 0.323 wad10 ~
wad7 0.136 0.095 1.420 0.156 0.159 0.159 wad12 ~
wad10 0.339 0.106 3.191 0.001 0.309 0.309 wad7 ~
wsi5 (e1) -0.108 0.083 -1.309 0.191 -0.046 -0.046 wad10 ~
wsi7 (e1) -0.108 0.083 -1.309 0.191 -0.057 -0.057 wad12 ~
wsi10 (e1) -0.108 0.083 -1.309 0.191 -0.065 -0.065 wsi7 ~
wad5 (f1) 0.059 0.022 2.700 0.007 0.139 0.139 wsi10 ~
wad7 (f1) 0.059 0.022 2.700 0.007 0.105 0.105 wsi12 ~
wad10 (f1) 0.059 0.022 2.700 0.007 0.091 0.091 wsi7 ~
wasb5 (b1) 0.004 0.008 0.543 0.587 0.029 0.029 wad7 ~
wasb5 (d1) 0.016 0.015 1.084 0.279 0.051 0.051 wasb12 ~
wsi10 (c1) -0.038 0.304 -0.124 0.901 -0.006 -0.006 wad10 (a1) 0.174 0.194 0.898 0.369 0.041 0.041 wasb7 ~
wad5 (a1) 0.174 0.194 0.898 0.369 0.058 0.058 wsi10 ~
wasb7 (b1) 0.004 0.008 0.543 0.587 0.024 0.024 wasb10 ~
wad7 (a1) 0.174 0.194 0.898 0.369 0.052 0.052 wsi12 ~
wasb10 (b1) 0.004 0.008 0.543 0.587 0.026 0.026 wasb7 ~
wsi5 (c1) -0.038 0.304 -0.124 0.901 -0.005 -0.005 wad10 ~
wasb7 (d1) 0.016 0.015 1.084 0.279 0.061 0.061 wasb10 ~
wsi7 (c1) -0.038 0.304 -0.124 0.901 -0.005 -0.005 wad12 ~
wasb10 (d1) 0.016 0.015 1.084 0.279 0.059 0.059

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 2.074 0.544 3.810 0.000 0.426 0.426 wad5 ~~
wasb5 6.548 1.212 5.404 0.000 0.543 0.543 wsi5 ~~
wad5 0.484 0.142 3.412 0.001 0.292 0.292 .wsi7 ~~
.wasb7 2.364 0.499 4.742 0.000 0.494 0.494 .wad7 ~~
.wasb7 5.281 1.028 5.135 0.000 0.520 0.520 .wsi7 ~~
.wad7 0.412 0.143 2.877 0.004 0.271 0.271 .wsi10 ~~
.wasb10 2.536 0.426 5.953 0.000 0.392 0.392 .wad10 ~~
.wasb10 4.241 1.076 3.943 0.000 0.429 0.429 .wsi10 ~~
.wad10 0.399 0.113 3.538 0.000 0.237 0.237 .wsi12 ~~
.wasb12 1.864 0.369 5.049 0.000 0.310 0.310 .wad12 ~~
.wasb12 5.980 0.952 6.279 0.000 0.540 0.540 .wsi12 ~~
.wad12 0.368 0.099 3.718 0.000 0.238 0.238 RIad ~~
RIsi 0.473 0.101 4.673 0.000 0.518 0.518 RIasb 6.904 1.154 5.981 0.000 0.766 0.766 RIsi ~~
RIasb 1.674 0.385 4.342 0.000 0.515 0.515

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.042 0.095 21.549 0.000 2.042 0.792 .tadhde7 1.790 0.094 18.965 0.000 1.790 0.720 .tadhde10 1.375 0.084 16.370 0.000 1.375 0.603 .tadhde12 1.387 0.090 15.468 0.000 1.387 0.580 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.727 .sisoe7 0.743 0.039 19.075 0.000 0.743 0.717 .sisoe10 0.812 0.045 17.864 0.000 0.812 0.666 .sisoe12 0.870 0.045 19.154 0.000 0.870 0.724 .asbe5 10.834 0.299 36.208 0.000 10.834 1.319 .asbe7 10.053 0.316 31.833 0.000 10.053 1.207 .asbe10 9.396 0.321 29.262 0.000 9.396 1.098 .asbe12 9.970 0.340 29.320 0.000 9.970 1.106 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIasb 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wasb5 0.000 0.000 0.000 .wasb7 0.000 0.000 0.000 .wasb10 0.000 0.000 0.000 .wasb12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 4.109 0.485 8.472 0.000 1.000 1.000 wsi5 0.670 0.103 6.481 0.000 1.000 1.000 wasb5 35.398 5.605 6.316 0.000 1.000 1.000 .wad7 3.229 0.393 8.210 0.000 0.884 0.884 .wsi7 0.716 0.094 7.612 0.000 0.961 0.961 .wasb7 31.987 4.250 7.527 0.000 0.857 0.857 .wad10 2.576 0.450 5.721 0.000 0.966 0.966 .wsi10 1.101 0.157 7.023 0.000 0.951 0.951 .wasb10 37.926 5.541 6.844 0.000 0.922 0.922 .wad12 2.855 0.379 7.531 0.000 0.894 0.894 .wsi12 0.841 0.077 10.978 0.000 0.753 0.753 .wasb12 42.932 4.542 9.452 0.000 0.873 0.873 RIad 2.531 0.380 6.666 0.000 1.000 1.000 RIsi 0.330 0.069 4.811 0.000 1.000 1.000 RIasb 32.099 4.351 7.377 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .asbe5 0.000 0.000 0.000 .asbe7 0.000 0.000 0.000 .asbe10 0.000 0.000 0.000 .asbe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.972 0.640 tadhde7 1.000 1.972 0.674 tadhde10 1.000 1.972 0.693 tadhde12 1.000 1.972 0.658 RIsi =~
sisoe5 1.000 0.841 0.613 sisoe7 1.000 0.841 0.617 sisoe10 1.000 0.841 0.585 sisoe12 1.000 0.841 0.503 RIasb =~
asbe5 1.000 7.628 0.726 asbe7 1.000 7.628 0.719 asbe10 1.000 7.628 0.659 asbe12 1.000 7.628 0.651 wsi5 =~
sisoe5 1.000 1.084 0.790 wsi7 =~
sisoe7 1.000 1.073 0.787 wsi10 =~
sisoe10 1.000 1.167 0.811 wsi12 =~
sisoe12 1.000 1.447 0.865 wad5 =~
tadhde5 1.000 2.365 0.768 wad7 =~
tadhde7 1.000 2.160 0.739 wad10 =~
tadhde10 1.000 2.051 0.721 wad12 =~
tadhde12 1.000 2.256 0.753 wasb5 =~
asbe5 1.000 7.223 0.688 wasb7 =~
asbe7 1.000 7.377 0.695 wasb10 =~
asbe10 1.000 8.709 0.752 wasb12 =~
asbe12 1.000 8.884 0.759

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.234 0.085 2.755 0.006 0.236 0.236 wsi10 ~
wsi7 0.173 0.096 1.808 0.071 0.159 0.159 wsi12 ~
wsi10 0.423 0.077 5.457 0.000 0.341 0.341 wasb7 ~
wasb5 0.295 0.090 3.292 0.001 0.289 0.289 wasb10 ~
wasb7 0.312 0.092 3.398 0.001 0.264 0.264 wasb12 ~
wasb10 0.520 0.071 7.350 0.000 0.510 0.510 wad7 ~
wad5 0.126 0.066 1.897 0.058 0.138 0.138 wad10 ~
wad7 0.067 0.088 0.764 0.445 0.071 0.071 wad12 ~
wad10 0.312 0.085 3.687 0.000 0.284 0.284 wad7 ~
wsi5 (e2) 0.076 0.101 0.752 0.452 0.038 0.038 wad10 ~
wsi7 (e2) 0.076 0.101 0.752 0.452 0.040 0.040 wad12 ~
wsi10 (e2) 0.076 0.101 0.752 0.452 0.039 0.039 wsi7 ~
wad5 (f2) 0.032 0.025 1.254 0.210 0.070 0.070 wsi10 ~
wad7 (f2) 0.032 0.025 1.254 0.210 0.059 0.059 wsi12 ~
wad10 (f2) 0.032 0.025 1.254 0.210 0.045 0.045 wsi7 ~
wasb5 (b2) 0.016 0.008 2.173 0.030 0.111 0.111 wad7 ~
wasb5 (d2) 0.033 0.016 2.129 0.033 0.112 0.112 wasb12 ~
wsi10 (c2) 0.181 0.335 0.541 0.589 0.024 0.024 wad10 (a2) -0.025 0.185 -0.135 0.893 -0.006 -0.006 wasb7 ~
wad5 (a2) -0.025 0.185 -0.135 0.893 -0.008 -0.008 wsi10 ~
wasb7 (b2) 0.016 0.008 2.173 0.030 0.104 0.104 wasb10 ~
wad7 (a2) -0.025 0.185 -0.135 0.893 -0.006 -0.006 wsi12 ~
wasb10 (b2) 0.016 0.008 2.173 0.030 0.099 0.099 wasb7 ~
wsi5 (c2) 0.181 0.335 0.541 0.589 0.027 0.027 wad10 ~
wasb7 (d2) 0.033 0.016 2.129 0.033 0.120 0.120 wasb10 ~
wsi7 (c2) 0.181 0.335 0.541 0.589 0.022 0.022 wad12 ~
wasb10 (d2) 0.033 0.016 2.129 0.033 0.129 0.129

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 2.327 0.767 3.035 0.002 0.297 0.297 wad5 ~~
wasb5 9.959 1.523 6.539 0.000 0.583 0.583 wsi5 ~~
wad5 0.747 0.261 2.856 0.004 0.291 0.291 .wsi7 ~~
.wasb7 3.611 0.735 4.909 0.000 0.505 0.505 .wad7 ~~
.wasb7 8.523 1.473 5.787 0.000 0.576 0.576 .wsi7 ~~
.wad7 0.716 0.191 3.753 0.000 0.337 0.337 .wsi10 ~~
.wasb10 4.961 0.688 7.216 0.000 0.527 0.527 .wad10 ~~
.wasb10 9.241 1.449 6.376 0.000 0.548 0.548 .wsi10 ~~
.wad10 0.819 0.216 3.783 0.000 0.362 0.362 .wsi12 ~~
.wasb12 4.441 0.717 6.195 0.000 0.447 0.447 .wad12 ~~
.wasb12 7.903 1.252 6.313 0.000 0.502 0.502 .wsi12 ~~
.wad12 0.803 0.199 4.040 0.000 0.296 0.296 RIad ~~
RIsi 0.850 0.162 5.245 0.000 0.512 0.512 RIasb 12.125 1.462 8.293 0.000 0.806 0.806 RIsi ~~
RIasb 3.738 0.624 5.986 0.000 0.583 0.583

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.974 0.112 26.461 0.000 2.974 0.966 .tadhde7 2.343 0.108 21.654 0.000 2.343 0.801 .tadhde10 2.135 0.106 20.220 0.000 2.135 0.750 .tadhde12 2.067 0.113 18.349 0.000 2.067 0.690 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.739 .sisoe7 1.044 0.050 20.891 0.000 1.044 0.765 .sisoe10 1.182 0.054 21.770 0.000 1.182 0.822 .sisoe12 1.254 0.063 19.979 0.000 1.254 0.749 .asbe5 14.674 0.384 38.242 0.000 14.674 1.397 .asbe7 12.873 0.389 33.109 0.000 12.873 1.213 .asbe10 13.377 0.433 30.904 0.000 13.377 1.156 .asbe12 13.838 0.450 30.782 0.000 13.838 1.182 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIasb 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wasb5 0.000 0.000 0.000 .wasb7 0.000 0.000 0.000 .wasb10 0.000 0.000 0.000 .wasb12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 5.594 0.603 9.282 0.000 1.000 1.000 wsi5 1.174 0.247 4.748 0.000 1.000 1.000 wasb5 52.177 5.764 9.052 0.000 1.000 1.000 .wad7 4.402 0.535 8.229 0.000 0.944 0.944 .wsi7 1.029 0.135 7.627 0.000 0.893 0.893 .wasb7 49.750 7.107 7.000 0.000 0.914 0.914 .wad10 4.044 0.497 8.141 0.000 0.962 0.962 .wsi10 1.264 0.158 8.004 0.000 0.929 0.929 .wasb10 70.189 7.428 9.449 0.000 0.926 0.926 .wad12 4.303 0.495 8.701 0.000 0.846 0.846 .wsi12 1.713 0.198 8.641 0.000 0.818 0.818 .wasb12 57.556 5.191 11.087 0.000 0.729 0.729 RIad 3.888 0.459 8.462 0.000 1.000 1.000 RIsi 0.708 0.121 5.851 0.000 1.000 1.000 RIasb 58.179 6.313 9.215 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .asbe5 0.000 0.000 0.000 .asbe7 0.000 0.000 0.000 .asbe10 0.000 0.000 0.000 .asbe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.557 0.620 tadhde7 1.000 1.557 0.731 tadhde10 1.000 1.557 0.718 tadhde12 1.000 1.557 0.780 RIsi =~
sisoe5 1.000 0.544 0.537 sisoe7 1.000 0.544 0.515 sisoe10 1.000 0.544 0.477 sisoe12 1.000 0.544 0.516 RIasb =~
asbe5 1.000 5.745 0.716 asbe7 1.000 5.745 0.787 asbe10 1.000 5.745 0.751 asbe12 1.000 5.745 0.749 wsi5 =~
sisoe5 1.000 0.854 0.843 wsi7 =~
sisoe7 1.000 0.905 0.857 wsi10 =~
sisoe10 1.000 1.002 0.879 wsi12 =~
sisoe12 1.000 0.905 0.857 wad5 =~
tadhde5 1.000 1.969 0.784 wad7 =~
tadhde7 1.000 1.453 0.682 wad10 =~
tadhde10 1.000 1.509 0.696 wad12 =~
tadhde12 1.000 1.248 0.625 wasb5 =~
asbe5 1.000 5.594 0.698 wasb7 =~
asbe7 1.000 4.508 0.617 wasb10 =~
asbe10 1.000 5.047 0.660 wasb12 =~
asbe12 1.000 5.078 0.662

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.287 0.080 3.568 0.000 0.271 0.271 wsi10 ~
wsi7 0.301 0.078 3.881 0.000 0.272 0.272 wsi12 ~
wsi10 0.277 0.067 4.117 0.000 0.307 0.307 wasb7 ~
wasb5 0.151 0.081 1.876 0.061 0.188 0.188 wasb10 ~
wasb7 0.149 0.142 1.047 0.295 0.133 0.133 wasb12 ~
wasb10 0.240 0.078 3.072 0.002 0.238 0.238 wad7 ~
wad5 0.160 0.065 2.443 0.015 0.216 0.216 wad10 ~
wad7 -0.003 0.110 -0.025 0.980 -0.003 -0.003 wad12 ~
wad10 0.030 0.101 0.299 0.765 0.036 0.036 wad7 ~
wsi5 (e3) 0.012 0.078 0.151 0.880 0.007 0.007 wad10 ~
wsi7 (e3) 0.012 0.078 0.151 0.880 0.007 0.007 wad12 ~
wsi10 (e3) 0.012 0.078 0.151 0.880 0.009 0.009 wsi7 ~
wad5 (f3) -0.048 0.028 -1.721 0.085 -0.105 -0.105 wsi10 ~
wad7 (f3) -0.048 0.028 -1.721 0.085 -0.070 -0.070 wsi12 ~
wad10 (f3) -0.048 0.028 -1.721 0.085 -0.081 -0.081 wsi7 ~
wasb5 (b3) 0.010 0.010 0.955 0.340 0.062 0.062 wad7 ~
wasb5 (d3) 0.014 0.015 0.958 0.338 0.054 0.054 wasb12 ~
wsi10 (c3) 0.023 0.283 0.082 0.935 0.005 0.005 wad10 (a3) -0.185 0.167 -1.107 0.268 -0.055 -0.055 wasb7 ~
wad5 (a3) -0.185 0.167 -1.107 0.268 -0.081 -0.081 wsi10 ~
wasb7 (b3) 0.010 0.010 0.955 0.340 0.045 0.045 wasb10 ~
wad7 (a3) -0.185 0.167 -1.107 0.268 -0.053 -0.053 wsi12 ~
wasb10 (b3) 0.010 0.010 0.955 0.340 0.056 0.056 wasb7 ~
wsi5 (c3) 0.023 0.283 0.082 0.935 0.004 0.004 wad10 ~
wasb7 (d3) 0.014 0.015 0.958 0.338 0.042 0.042 wasb10 ~
wsi7 (c3) 0.023 0.283 0.082 0.935 0.004 0.004 wad12 ~
wasb10 (d3) 0.014 0.015 0.958 0.338 0.057 0.057

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.647 0.343 4.796 0.000 0.345 0.345 wad5 ~~
wasb5 6.396 1.141 5.608 0.000 0.581 0.581 wsi5 ~~
wad5 0.413 0.114 3.611 0.000 0.245 0.245 .wsi7 ~~
.wasb7 1.311 0.434 3.018 0.003 0.339 0.339 .wad7 ~~
.wasb7 2.454 0.587 4.180 0.000 0.392 0.392 .wsi7 ~~
.wad7 0.023 0.087 0.264 0.792 0.019 0.019 .wsi10 ~~
.wasb10 1.702 0.454 3.746 0.000 0.355 0.355 .wad10 ~~
.wasb10 2.844 0.909 3.128 0.002 0.377 0.377 .wsi10 ~~
.wad10 0.295 0.107 2.749 0.006 0.204 0.204 .wsi12 ~~
.wasb12 1.219 0.261 4.676 0.000 0.287 0.287 .wad12 ~~
.wasb12 2.530 0.566 4.468 0.000 0.411 0.411 .wsi12 ~~
.wad12 0.114 0.078 1.465 0.143 0.107 0.107 RIad ~~
RIsi 0.445 0.089 4.995 0.000 0.525 0.525 RIasb 6.453 0.865 7.460 0.000 0.721 0.721 RIsi ~~
RIasb 1.977 0.349 5.662 0.000 0.632 0.632

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 1.741 0.090 19.313 0.000 1.741 0.694 .tadhde7 1.317 0.080 16.507 0.000 1.317 0.618 .tadhde10 1.193 0.081 14.720 0.000 1.193 0.550 .tadhde12 0.921 0.073 12.689 0.000 0.921 0.462 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.690 .sisoe7 0.709 0.040 17.914 0.000 0.709 0.671 .sisoe10 0.824 0.043 19.177 0.000 0.824 0.722 .sisoe12 0.699 0.040 17.595 0.000 0.699 0.662 .asbe5 10.033 0.295 33.970 0.000 10.033 1.251 .asbe7 8.468 0.269 31.509 0.000 8.468 1.160 .asbe10 7.929 0.285 27.776 0.000 7.929 1.037 .asbe12 7.393 0.279 26.489 0.000 7.393 0.964 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIasb 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wasb5 0.000 0.000 0.000 .wasb7 0.000 0.000 0.000 .wasb10 0.000 0.000 0.000 .wasb12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 3.876 0.540 7.180 0.000 1.000 1.000 wsi5 0.730 0.092 7.937 0.000 1.000 1.000 wasb5 31.291 3.680 8.503 0.000 1.000 1.000 .wad7 1.974 0.286 6.915 0.000 0.936 0.936 .wsi7 0.755 0.108 6.969 0.000 0.922 0.922 .wasb7 19.818 3.066 6.464 0.000 0.975 0.975 .wad10 2.273 0.508 4.478 0.000 0.998 0.998 .wsi10 0.918 0.102 9.028 0.000 0.914 0.914 .wasb10 25.080 4.373 5.735 0.000 0.985 0.985 .wad12 1.546 0.344 4.499 0.000 0.993 0.993 .wsi12 0.735 0.084 8.749 0.000 0.897 0.897 .wasb12 24.485 3.066 7.987 0.000 0.950 0.950 RIad 2.425 0.375 6.465 0.000 1.000 1.000 RIsi 0.296 0.067 4.404 0.000 1.000 1.000 RIasb 33.008 3.510 9.405 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .asbe5 0.000 0.000 0.000 .asbe7 0.000 0.000 0.000 .asbe10 0.000 0.000 0.000 .asbe12 0.000 0.000 0.000

Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1mid 0.001 0.001 0.569 0.570 0.001 0.001 indirect1low -0.000 0.003 -0.133 0.894 -0.001 -0.001 indirect1high -0.002 0.003 -0.627 0.530 -0.003 -0.003 indirect2mid -0.001 0.005 -0.120 0.905 -0.000 -0.000 indirect2low 0.006 0.011 0.564 0.573 0.003 0.003 indirect2high 0.000 0.004 0.081 0.935 0.000 0.000

Constrained full cross-lag RI-CLPM mediation model - SES constraints

Autoregressive paths are constrained to be equal across groups of SES but freed across time.

Cross lags are constrained to be equal across groups AND across time.

ri.med.long.asb.c.ses <- ' 
                  ###### Create random intercepts ###### 
                  RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 
                  RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 
                  RIasb =~ 1*asbe5 + 1*asbe7 + 1*asbe10  + 1*asbe12
                
                  ###### Create within-person variables ######
                  ## Isolation
                  wsi5 =~ 1*sisoe5
                  wsi7 =~ 1*sisoe7
                  wsi10 =~ 1*sisoe10
                  wsi12 =~ 1*sisoe12
                  ## ADHD
                  wad5 =~ 1*tadhde5
                  wad7 =~ 1*tadhde7
                  wad10 =~ 1*tadhde10
                  wad12 =~ 1*tadhde12
                  ## antisocial 
                  wasb5 =~ 1*asbe5
                  wasb7 =~ 1*asbe7
                  wasb10 =~ 1*asbe10
                  wasb12 =~ 1*asbe12
                  
                  ###### Autoregressive lags ######
                  ## Isolation
                  wsi7 ~ c(g1,g1,g1)*wsi5
                  wsi10 ~ c(g2,g2,g2)*wsi7
                  wsi12 ~ c(g3,g3,g3)*wsi10
                  ## antisocial behaviour
                  wasb7 ~ c(h1,h1,h1)*wasb5
                  wasb10 ~ c(h2,h2,h2)*wasb7
                  wasb12 ~ c(h3,h3,h3)*wasb10
                  ## ADHD
                  wad7 ~ c(i1,i1,i1)*wad5
                  wad10 ~ c(i2,i2,i2)*wad7
                  wad12 ~ c(i3,i3,i3)*wad10
                  
                  ###### Cross lag paths ######
                  ## Isolation
                  wad7 ~ c(e,e,e)*wsi5
                  wad10 ~ c(e,e,e)*wsi7
                  wad12 ~ c(e,e,e)*wsi10
                  ## ADHD
                  wsi7 ~ c(f,f,f)*wad5
                  wsi10 ~ c(f,f,f)*wad7
                  wsi12 ~ c(f,f,f)*wad10
                  ## antisocial
                  wsi7 ~ c(b,b,b)*wasb5
                  wad7 ~ c(d,d,d)*wasb5
                  wasb12 ~ c(c,c,c)*wsi10
                  wasb12 ~ c(a,a,a)*wad10
                  
                  ###### Mediation paths ######
                  ## ADHD to Isolation
                  wasb7 ~ c(a,a,a)*wad5 
                  wsi10 ~ c(b,b,b)*wasb7
                  wasb10 ~ c(a,a,a)*wad7 
                  wsi12 ~ c(b,b,b)*wasb10
                  ## Isolation to ADHD
                  wasb7 ~ c(c,c,c)*wsi5
                  wad10 ~ c(d,d,d)*wasb7
                  wasb10 ~ c(c,c,c)*wsi7
                  wad12 ~ c(d,d,d)*wasb10
                  
                  ###### Covariances ######
                  wsi5 ~~ wasb5
                  wasb5 ~~ wad5
                  wsi5 ~~ wad5
                  wsi7 ~~ wasb7
                  wasb7 ~~ wad7
                  wsi7 ~~ wad7
                  wsi10 ~~ wasb10
                  wasb10 ~~ wad10
                  wsi10 ~~ wad10
                  wsi12 ~~ wasb12
                  wasb12 ~~ wad12
                  wsi12 ~~ wad12
                    
                  ###### Variances ######
                  ## Variances
                  wad5 ~~ wad5 
                  wsi5 ~~ wsi5 
                  wasb5 ~~ wasb5
                  ## Residual variances
                  wad7 ~~ wad7 
                  wsi7 ~~ wsi7 
                  wasb7 ~~ wasb7
                  wad10 ~~ wad10 
                  wsi10 ~~ wsi10 
                  wasb10 ~~ wasb10
                  wad12 ~~ wad12 
                  wsi12 ~~ wsi12
                  wasb12 ~~ wasb12
                  
                  ###### Variance and covariance of random intercepts ######
                  RIad ~~ RIad
                  RIsi ~~ RIsi
                  RIasb ~~ RIasb
                  RIad ~~ RIsi
                  RIad ~~ RIasb
                  RIsi ~~ RIasb
         '
ri.med.long.asb.c.ses.fit <- lavaan(ri.med.long.asb.c.ses, 
                      data = dat, 
                      missing = 'ML', 
                      group = "SES",
                      meanstructure = TRUE, 
                      int.ov.free = TRUE,
                      se = "robust",
                      estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
                      ) 

ri.med.long.asb.c.ses.fit.summary <- summary(ri.med.long.asb.c.ses.fit, standardized = TRUE, fit.measures = TRUE)

lavaan 0.6-10 ended normally after 1765 iterations

Estimator ML Optimization method NLMINB Number of model parameters 207 Number of equality constraints 66

Number of observations per group:
Middle 738 Low 742 High 752 Number of missing patterns per group:
Middle 7 Low 8 High 8

Model Test User Model: Standard Robust Test Statistic 350.350 220.787 Degrees of freedom 129 129 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.587 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Middle 113.902 71.780 Low 67.821 42.740 High 168.628 106.267

Model Test Baseline Model:

Test statistic 14369.124 8384.835 Degrees of freedom 198 198 P-value 0.000 0.000 Scaling correction factor 1.714

User Model versus Baseline Model:

Comparative Fit Index (CFI) 0.984 0.989 Tucker-Lewis Index (TLI) 0.976 0.983

Robust Comparative Fit Index (CFI) 0.990 Robust Tucker-Lewis Index (TLI) 0.984

Loglikelihood and Information Criteria:

Loglikelihood user model (H0) -58718.502 -58718.502 Scaling correction factor 1.544 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.942 for the MLR correction

Akaike (AIC) 117719.004 117719.004 Bayesian (BIC) 118524.206 118524.206 Sample-size adjusted Bayesian (BIC) 118076.226 118076.226

Root Mean Square Error of Approximation:

RMSEA 0.048 0.031 90 Percent confidence interval - lower 0.042 0.025 90 Percent confidence interval - upper 0.054 0.036 P-value RMSEA <= 0.05 0.696 1.000

Robust RMSEA 0.039 90 Percent confidence interval - lower 0.030 90 Percent confidence interval - upper 0.048

Standardized Root Mean Square Residual:

SRMR 0.047 0.047

Parameter Estimates:

Standard errors Sandwich Information bread Observed Observed information based on Hessian

Group 1 [Middle]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.664 0.643 tadhde7 1.000 1.664 0.678 tadhde10 1.000 1.664 0.726 tadhde12 1.000 1.664 0.696 RIsi =~
sisoe5 1.000 0.551 0.546 sisoe7 1.000 0.551 0.519 sisoe10 1.000 0.551 0.454 sisoe12 1.000 0.551 0.476 RIasb =~
asbe5 1.000 5.960 0.728 asbe7 1.000 5.960 0.725 asbe10 1.000 5.960 0.689 asbe12 1.000 5.960 0.649 wsi5 =~
sisoe5 1.000 0.845 0.838 wsi7 =~
sisoe7 1.000 0.907 0.855 wsi10 =~
sisoe10 1.000 1.082 0.891 wsi12 =~
sisoe12 1.000 1.019 0.880 wad5 =~
tadhde5 1.000 1.980 0.765 wad7 =~
tadhde7 1.000 1.806 0.735 wad10 =~
tadhde10 1.000 1.575 0.687 wad12 =~
tadhde12 1.000 1.715 0.718 wasb5 =~
asbe5 1.000 5.616 0.686 wasb7 =~
asbe7 1.000 5.654 0.688 wasb10 =~
asbe10 1.000 6.271 0.725 wasb12 =~
asbe12 1.000 6.988 0.761

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 (g1) 0.214 0.049 4.362 0.000 0.199 0.199 wsi10 ~
wsi7 (g2) 0.241 0.053 4.522 0.000 0.202 0.202 wsi12 ~
wsi10 (g3) 0.384 0.043 8.978 0.000 0.408 0.408 wasb7 ~
wasb5 (h1) 0.249 0.052 4.827 0.000 0.247 0.247 wasb10 ~
wasb7 (h2) 0.235 0.062 3.819 0.000 0.212 0.212 wasb12 ~
wasb10 (h3) 0.377 0.046 8.249 0.000 0.339 0.339 wad7 ~
wad5 (i1) 0.184 0.040 4.563 0.000 0.202 0.202 wad10 ~
wad7 (i2) 0.061 0.058 1.048 0.295 0.069 0.069 wad12 ~
wad10 (i3) 0.205 0.060 3.386 0.001 0.188 0.188 wad7 ~
wsi5 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wad10 ~
wsi7 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wad12 ~
wsi10 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wsi7 ~
wad5 (f) 0.014 0.015 0.928 0.353 0.030 0.030 wsi10 ~
wad7 (f) 0.014 0.015 0.928 0.353 0.023 0.023 wsi12 ~
wad10 (f) 0.014 0.015 0.928 0.353 0.021 0.021 wsi7 ~
wasb5 (b) 0.009 0.005 1.830 0.067 0.056 0.056 wad7 ~
wasb5 (d) 0.021 0.009 2.217 0.027 0.065 0.065 wasb12 ~
wsi10 (c) 0.079 0.182 0.436 0.663 0.012 0.012 wad10 (a) -0.025 0.109 -0.225 0.822 -0.006 -0.006 wasb7 ~
wad5 (a) -0.025 0.109 -0.225 0.822 -0.009 -0.009 wsi10 ~
wasb7 (b) 0.009 0.005 1.830 0.067 0.047 0.047 wasb10 ~
wad7 (a) -0.025 0.109 -0.225 0.822 -0.007 -0.007 wsi12 ~
wasb10 (b) 0.009 0.005 1.830 0.067 0.056 0.056 wasb7 ~
wsi5 (c) 0.079 0.182 0.436 0.663 0.012 0.012 wad10 ~
wasb7 (d) 0.021 0.009 2.217 0.027 0.075 0.075 wasb10 ~
wsi7 (c) 0.079 0.182 0.436 0.663 0.011 0.011 wad12 ~
wasb10 (d) 0.021 0.009 2.217 0.027 0.076 0.076

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.974 0.494 3.997 0.000 0.416 0.416 wad5 ~~
wasb5 5.909 1.045 5.656 0.000 0.531 0.531 wsi5 ~~
wad5 0.467 0.130 3.589 0.000 0.279 0.279 .wsi7 ~~
.wasb7 2.404 0.498 4.825 0.000 0.499 0.499 .wad7 ~~
.wasb7 5.005 0.958 5.226 0.000 0.522 0.522 .wsi7 ~~
.wad7 0.431 0.138 3.115 0.002 0.280 0.280 .wsi10 ~~
.wasb10 2.523 0.407 6.207 0.000 0.392 0.392 .wad10 ~~
.wasb10 4.124 0.960 4.295 0.000 0.431 0.431 .wsi10 ~~
.wad10 0.396 0.108 3.664 0.000 0.241 0.241 .wsi12 ~~
.wasb12 1.799 0.367 4.900 0.000 0.300 0.300 .wad12 ~~
.wasb12 5.897 0.927 6.364 0.000 0.538 0.538 .wsi12 ~~
.wad12 0.333 0.098 3.395 0.001 0.218 0.218 RIad ~~
RIsi 0.504 0.094 5.339 0.000 0.550 0.550 RIasb 7.475 1.011 7.392 0.000 0.754 0.754 RIsi ~~
RIasb 1.827 0.357 5.118 0.000 0.556 0.556

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.042 0.095 21.549 0.000 2.042 0.789 .tadhde7 1.789 0.094 18.948 0.000 1.789 0.728 .tadhde10 1.374 0.084 16.403 0.000 1.374 0.599 .tadhde12 1.386 0.090 15.417 0.000 1.386 0.580 .sisoe5 0.727 0.037 19.702 0.000 0.727 0.720 .sisoe7 0.743 0.039 19.043 0.000 0.743 0.700 .sisoe10 0.814 0.046 17.874 0.000 0.814 0.670 .sisoe12 0.871 0.046 19.138 0.000 0.871 0.752 .asbe5 10.834 0.299 36.208 0.000 10.834 1.323 .asbe7 10.054 0.316 31.809 0.000 10.054 1.224 .asbe10 9.397 0.321 29.286 0.000 9.397 1.086 .asbe12 9.970 0.340 29.318 0.000 9.970 1.086 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIasb 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wasb5 0.000 0.000 0.000 .wasb7 0.000 0.000 0.000 .wasb10 0.000 0.000 0.000 .wasb12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 3.920 0.449 8.731 0.000 1.000 1.000 wsi5 0.715 0.099 7.214 0.000 1.000 1.000 wasb5 31.541 4.646 6.789 0.000 1.000 1.000 .wad7 3.070 0.354 8.662 0.000 0.941 0.941 .wsi7 0.774 0.089 8.738 0.000 0.942 0.942 .wasb7 30.003 4.202 7.141 0.000 0.939 0.939 .wad10 2.441 0.379 6.440 0.000 0.984 0.984 .wsi10 1.104 0.149 7.407 0.000 0.943 0.943 .wasb10 37.517 5.256 7.138 0.000 0.954 0.954 .wad12 2.785 0.363 7.681 0.000 0.946 0.946 .wsi12 0.836 0.077 10.870 0.000 0.806 0.806 .wasb12 43.140 4.381 9.847 0.000 0.883 0.883 RIad 2.770 0.330 8.400 0.000 1.000 1.000 RIsi 0.303 0.067 4.541 0.000 1.000 1.000 RIasb 35.520 4.228 8.402 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .asbe5 0.000 0.000 0.000 .asbe7 0.000 0.000 0.000 .asbe10 0.000 0.000 0.000 .asbe12 0.000 0.000 0.000

Group 2 [Low]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 2.040 0.649 tadhde7 1.000 2.040 0.688 tadhde10 1.000 2.040 0.726 tadhde12 1.000 2.040 0.697 RIsi =~
sisoe5 1.000 0.857 0.618 sisoe7 1.000 0.857 0.635 sisoe10 1.000 0.857 0.593 sisoe12 1.000 0.857 0.523 RIasb =~
asbe5 1.000 7.939 0.738 asbe7 1.000 7.939 0.748 asbe10 1.000 7.939 0.695 asbe12 1.000 7.939 0.699 wsi5 =~
sisoe5 1.000 1.088 0.786 wsi7 =~
sisoe7 1.000 1.041 0.772 wsi10 =~
sisoe10 1.000 1.164 0.805 wsi12 =~
sisoe12 1.000 1.397 0.852 wad5 =~
tadhde5 1.000 2.393 0.761 wad7 =~
tadhde7 1.000 2.149 0.725 wad10 =~
tadhde10 1.000 1.934 0.688 wad12 =~
tadhde12 1.000 2.099 0.717 wasb5 =~
asbe5 1.000 7.251 0.674 wasb7 =~
asbe7 1.000 7.043 0.664 wasb10 =~
asbe10 1.000 8.219 0.719 wasb12 =~
asbe12 1.000 8.126 0.715

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 (g1) 0.214 0.049 4.362 0.000 0.223 0.223 wsi10 ~
wsi7 (g2) 0.241 0.053 4.522 0.000 0.215 0.215 wsi12 ~
wsi10 (g3) 0.384 0.043 8.978 0.000 0.320 0.320 wasb7 ~
wasb5 (h1) 0.249 0.052 4.827 0.000 0.256 0.256 wasb10 ~
wasb7 (h2) 0.235 0.062 3.819 0.000 0.202 0.202 wasb12 ~
wasb10 (h3) 0.377 0.046 8.249 0.000 0.382 0.382 wad7 ~
wad5 (i1) 0.184 0.040 4.563 0.000 0.205 0.205 wad10 ~
wad7 (i2) 0.061 0.058 1.048 0.295 0.067 0.067 wad12 ~
wad10 (i3) 0.205 0.060 3.386 0.001 0.189 0.189 wad7 ~
wsi5 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wad10 ~
wsi7 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wad12 ~
wsi10 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wsi7 ~
wad5 (f) 0.014 0.015 0.928 0.353 0.032 0.032 wsi10 ~
wad7 (f) 0.014 0.015 0.928 0.353 0.026 0.026 wsi12 ~
wad10 (f) 0.014 0.015 0.928 0.353 0.019 0.019 wsi7 ~
wasb5 (b) 0.009 0.005 1.830 0.067 0.063 0.063 wad7 ~
wasb5 (d) 0.021 0.009 2.217 0.027 0.070 0.070 wasb12 ~
wsi10 (c) 0.079 0.182 0.436 0.663 0.011 0.011 wad10 (a) -0.025 0.109 -0.225 0.822 -0.006 -0.006 wasb7 ~
wad5 (a) -0.025 0.109 -0.225 0.822 -0.008 -0.008 wsi10 ~
wasb7 (b) 0.009 0.005 1.830 0.067 0.055 0.055 wasb10 ~
wad7 (a) -0.025 0.109 -0.225 0.822 -0.006 -0.006 wsi12 ~
wasb10 (b) 0.009 0.005 1.830 0.067 0.053 0.053 wasb7 ~
wsi5 (c) 0.079 0.182 0.436 0.663 0.012 0.012 wad10 ~
wasb7 (d) 0.021 0.009 2.217 0.027 0.076 0.076 wasb10 ~
wsi7 (c) 0.079 0.182 0.436 0.663 0.010 0.010 wad12 ~
wasb10 (d) 0.021 0.009 2.217 0.027 0.081 0.081

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 2.383 0.734 3.246 0.001 0.302 0.302 wad5 ~~
wasb5 10.105 1.458 6.929 0.000 0.582 0.582 wsi5 ~~
wad5 0.739 0.263 2.808 0.005 0.284 0.284 .wsi7 ~~
.wasb7 3.195 0.638 5.005 0.000 0.467 0.467 .wad7 ~~
.wasb7 7.841 1.159 6.767 0.000 0.554 0.554 .wsi7 ~~
.wad7 0.590 0.159 3.720 0.000 0.282 0.282 .wsi10 ~~
.wasb10 4.583 0.660 6.945 0.000 0.506 0.506 .wad10 ~~
.wasb10 8.061 1.343 6.002 0.000 0.522 0.522 .wsi10 ~~
.wad10 0.700 0.192 3.650 0.000 0.324 0.324 .wsi12 ~~
.wasb12 4.373 0.719 6.081 0.000 0.447 0.447 .wad12 ~~
.wasb12 7.607 1.265 6.013 0.000 0.498 0.498 .wsi12 ~~
.wad12 0.768 0.199 3.852 0.000 0.289 0.289 RIad ~~
RIsi 0.983 0.139 7.067 0.000 0.563 0.563 RIasb 13.208 1.362 9.700 0.000 0.816 0.816 RIsi ~~
RIasb 4.172 0.583 7.155 0.000 0.613 0.613

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.974 0.112 26.461 0.000 2.974 0.946 .tadhde7 2.342 0.108 21.641 0.000 2.342 0.790 .tadhde10 2.137 0.106 20.186 0.000 2.137 0.760 .tadhde12 2.067 0.113 18.334 0.000 2.067 0.706 .sisoe5 1.014 0.050 20.330 0.000 1.014 0.732 .sisoe7 1.044 0.050 20.891 0.000 1.044 0.774 .sisoe10 1.183 0.054 21.751 0.000 1.183 0.819 .sisoe12 1.254 0.063 19.983 0.000 1.254 0.765 .asbe5 14.674 0.384 38.242 0.000 14.674 1.365 .asbe7 12.873 0.388 33.142 0.000 12.873 1.213 .asbe10 13.384 0.434 30.867 0.000 13.384 1.171 .asbe12 13.834 0.449 30.809 0.000 13.834 1.218 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIasb 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wasb5 0.000 0.000 0.000 .wasb7 0.000 0.000 0.000 .wasb10 0.000 0.000 0.000 .wasb12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 5.727 0.584 9.802 0.000 1.000 1.000 wsi5 1.185 0.257 4.602 0.000 1.000 1.000 wasb5 52.571 5.256 10.002 0.000 1.000 1.000 .wad7 4.324 0.443 9.751 0.000 0.936 0.936 .wsi7 1.008 0.115 8.777 0.000 0.930 0.930 .wasb7 46.374 5.805 7.988 0.000 0.935 0.935 .wad10 3.682 0.468 7.863 0.000 0.984 0.984 .wsi10 1.266 0.144 8.778 0.000 0.934 0.934 .wasb10 64.769 7.114 9.105 0.000 0.959 0.959 .wad12 4.147 0.495 8.370 0.000 0.942 0.942 .wsi12 1.699 0.195 8.707 0.000 0.871 0.871 .wasb12 56.251 5.238 10.739 0.000 0.852 0.852 RIad 4.161 0.423 9.829 0.000 1.000 1.000 RIsi 0.734 0.115 6.401 0.000 1.000 1.000 RIasb 63.024 6.017 10.473 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .asbe5 0.000 0.000 0.000 .asbe7 0.000 0.000 0.000 .asbe10 0.000 0.000 0.000 .asbe12 0.000 0.000 0.000

Group 3 [High]:

Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.471 0.596 tadhde7 1.000 1.471 0.698 tadhde10 1.000 1.471 0.671 tadhde12 1.000 1.471 0.731 RIsi =~
sisoe5 1.000 0.545 0.548 sisoe7 1.000 0.545 0.517 sisoe10 1.000 0.545 0.481 sisoe12 1.000 0.545 0.487 RIasb =~
asbe5 1.000 5.454 0.685 asbe7 1.000 5.454 0.737 asbe10 1.000 5.454 0.713 asbe12 1.000 5.454 0.704 wsi5 =~
sisoe5 1.000 0.831 0.836 wsi7 =~
sisoe7 1.000 0.903 0.856 wsi10 =~
sisoe10 1.000 0.994 0.877 wsi12 =~
sisoe12 1.000 0.978 0.874 wad5 =~
tadhde5 1.000 1.981 0.803 wad7 =~
tadhde7 1.000 1.508 0.716 wad10 =~
tadhde10 1.000 1.624 0.741 wad12 =~
tadhde12 1.000 1.374 0.683 wasb5 =~
asbe5 1.000 5.793 0.728 wasb7 =~
asbe7 1.000 5.001 0.676 wasb10 =~
asbe10 1.000 5.369 0.702 wasb12 =~
asbe12 1.000 5.509 0.711

Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 (g1) 0.214 0.049 4.362 0.000 0.197 0.197 wsi10 ~
wsi7 (g2) 0.241 0.053 4.522 0.000 0.218 0.218 wsi12 ~
wsi10 (g3) 0.384 0.043 8.978 0.000 0.391 0.391 wasb7 ~
wasb5 (h1) 0.249 0.052 4.827 0.000 0.288 0.288 wasb10 ~
wasb7 (h2) 0.235 0.062 3.819 0.000 0.219 0.219 wasb12 ~
wasb10 (h3) 0.377 0.046 8.249 0.000 0.368 0.368 wad7 ~
wad5 (i1) 0.184 0.040 4.563 0.000 0.242 0.242 wad10 ~
wad7 (i2) 0.061 0.058 1.048 0.295 0.056 0.056 wad12 ~
wad10 (i3) 0.205 0.060 3.386 0.001 0.242 0.242 wad7 ~
wsi5 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wad10 ~
wsi7 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wad12 ~
wsi10 (e) -0.000 0.053 -0.008 0.994 -0.000 -0.000 wsi7 ~
wad5 (f) 0.014 0.015 0.928 0.353 0.030 0.030 wsi10 ~
wad7 (f) 0.014 0.015 0.928 0.353 0.021 0.021 wsi12 ~
wad10 (f) 0.014 0.015 0.928 0.353 0.023 0.023 wsi7 ~
wasb5 (b) 0.009 0.005 1.830 0.067 0.058 0.058 wad7 ~
wasb5 (d) 0.021 0.009 2.217 0.027 0.080 0.080 wasb12 ~
wsi10 (c) 0.079 0.182 0.436 0.663 0.014 0.014 wad10 (a) -0.025 0.109 -0.225 0.822 -0.007 -0.007 wasb7 ~
wad5 (a) -0.025 0.109 -0.225 0.822 -0.010 -0.010 wsi10 ~
wasb7 (b) 0.009 0.005 1.830 0.067 0.045 0.045 wasb10 ~
wad7 (a) -0.025 0.109 -0.225 0.822 -0.007 -0.007 wsi12 ~
wasb10 (b) 0.009 0.005 1.830 0.067 0.050 0.050 wasb7 ~
wsi5 (c) 0.079 0.182 0.436 0.663 0.013 0.013 wad10 ~
wasb7 (d) 0.021 0.009 2.217 0.027 0.064 0.064 wasb10 ~
wsi7 (c) 0.079 0.182 0.436 0.663 0.013 0.013 wad12 ~
wasb10 (d) 0.021 0.009 2.217 0.027 0.081 0.081

Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.659 0.361 4.600 0.000 0.345 0.345 wad5 ~~
wasb5 6.799 1.234 5.510 0.000 0.592 0.592 wsi5 ~~
wad5 0.430 0.119 3.619 0.000 0.261 0.261 .wsi7 ~~
.wasb7 1.577 0.378 4.176 0.000 0.375 0.375 .wad7 ~~
.wasb7 2.914 0.614 4.743 0.000 0.422 0.422 .wsi7 ~~
.wad7 0.096 0.083 1.166 0.244 0.076 0.076 .wsi10 ~~
.wasb10 1.859 0.431 4.315 0.000 0.368 0.368 .wad10 ~~
.wasb10 3.429 0.939 3.650 0.000 0.405 0.405 .wsi10 ~~
.wad10 0.373 0.110 3.378 0.001 0.240 0.240 .wsi12 ~~
.wasb12 1.470 0.280 5.256 0.000 0.324 0.324 .wad12 ~~
.wasb12 2.881 0.586 4.912 0.000 0.427 0.427 .wsi12 ~~
.wad12 0.197 0.077 2.541 0.011 0.168 0.168 RIad ~~
RIsi 0.358 0.079 4.565 0.000 0.447 0.447 RIasb 5.762 0.833 6.915 0.000 0.718 0.718 RIsi ~~
RIasb 1.748 0.304 5.743 0.000 0.588 0.588

Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 1.741 0.090 19.313 0.000 1.741 0.706 .tadhde7 1.314 0.080 16.497 0.000 1.314 0.624 .tadhde10 1.192 0.081 14.723 0.000 1.192 0.544 .tadhde12 0.918 0.072 12.687 0.000 0.918 0.456 .sisoe5 0.699 0.035 19.703 0.000 0.699 0.704 .sisoe7 0.708 0.040 17.892 0.000 0.708 0.672 .sisoe10 0.823 0.043 19.177 0.000 0.823 0.726 .sisoe12 0.699 0.040 17.530 0.000 0.699 0.624 .asbe5 10.033 0.295 33.970 0.000 10.033 1.261 .asbe7 8.463 0.269 31.510 0.000 8.463 1.144 .asbe10 7.924 0.285 27.831 0.000 7.924 1.035 .asbe12 7.387 0.279 26.467 0.000 7.387 0.953 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 RIasb 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wasb5 0.000 0.000 0.000 .wasb7 0.000 0.000 0.000 .wasb10 0.000 0.000 0.000 .wasb12 0.000 0.000 0.000

Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 3.924 0.563 6.974 0.000 1.000 1.000 wsi5 0.690 0.093 7.450 0.000 1.000 1.000 wasb5 33.563 3.799 8.836 0.000 1.000 1.000 .wad7 2.074 0.279 7.424 0.000 0.912 0.912 .wsi7 0.769 0.105 7.347 0.000 0.944 0.944 .wasb7 22.945 2.837 8.086 0.000 0.917 0.917 .wad10 2.610 0.506 5.156 0.000 0.990 0.990 .wsi10 0.929 0.101 9.181 0.000 0.940 0.940 .wasb10 27.412 3.769 7.273 0.000 0.951 0.951 .wad12 1.735 0.342 5.081 0.000 0.919 0.919 .wsi12 0.789 0.082 9.653 0.000 0.824 0.824 .wasb12 26.175 3.142 8.330 0.000 0.863 0.863 RIad 2.164 0.371 5.832 0.000 1.000 1.000 RIsi 0.297 0.066 4.473 0.000 1.000 1.000 RIasb 29.743 3.215 9.251 0.000 1.000 1.000 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000 .asbe5 0.000 0.000 0.000 .asbe7 0.000 0.000 0.000 .asbe10 0.000 0.000 0.000 .asbe12 0.000 0.000 0.000

Now we see if there is a significantly worse fit when the lagged-parameters are constrained to be equal across groups.

lavTestLRT(ri.med.long.asb.c.fit, ri.med.long.asb.c.ses.fit, method = "satorra.bentler.2010")
 

Work by Katherine N Thompson

katherine.n.thompson@kcl.ac.uk