<- read_dta(paste0(data.raw_path, "Katie_19Jan22.dta"))
dat.raw
<- dat.raw %>%
dat ::select(id = atwinid,
dplyr
sampsex,
seswq35,# social isolation mother report
sisoem5,
sisoem7,
sisoem10,
sisoem12,# social isolation teacher report
sisoet5,
sisoet7,
sisoet10,
sisoet12,# social isolation combined report
sisoe5,
sisoe7,
sisoe10,
sisoe12,# total ADHD mother report
tadhdem5,
tadhdem7,
tadhdem10,
tadhdem12,# total ADHD teacher report
tadhdet5,
tadhdet7,
tadhdet10,
tadhdet12,# hyperactivity ADHD mother report
hyem5,
hyem7,
hyem10,
hyem12, # hyperactivity ADHD teacher report
hyet5,
hyet7,
hyet10,
hyet12,# inattention ADHD mother report
inem5,
inem7,
inem10,
inem12,# inattention ADHD teacher report
inet5,
inet7,
inet10,
inet12
)
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”
Functions
# Table of model fit
<- function(model){
table.model.fit <- as.data.frame(t(as.data.frame(model$FIT))) %>%
model.fit ::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
dplyrreturn(model.fit)
}
# Table of regression and correlation (standardised covariance) coefficients
<- function(model, sex, constraints){
table.model.coef if (sex == "Male" & constraints == "No"){
<- as.tibble(model$PE[c(86:101),]) %>% dplyr::select(-block, -group, -exo, -std.lv, -std.nox)
model.coef return(model.coef)
else if(sex == "Female" & constraints == "No"){
} <- as.tibble(model$PE[c(17:32),]) %>% dplyr::select(-block, -group, -exo, -std.lv, -std.nox)
model.coef return(model.coef)
else if(sex == "Male" & constraints == "Yes"){
} <- as.tibble(model$PE[c(86:101),]) %>% dplyr::select(-block, -group, -exo, -label, -std.lv, -std.nox)
model.coef return(model.coef)
else if(sex == "Female" & constraints == "Yes"){
} <- as.tibble(model$PE[c(17:32),]) %>% dplyr::select(-block, -group, -exo, -label, -std.lv, -std.nox)
model.coef return(model.coef)
else {model.coef <- NULL}
} }
To check for group differences in parameter estimates between girls and boys (sex), we can run the same model but test group differences in the lavaan command.
<- dat %>%
dat mutate(
sex =
recode_factor(as_factor(sampsex),
"1" = "Male",
"2" = "Female"))
table(dat$sex)
Male Female 1092 1140
# 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)))))
)
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.
Model | Sex differences |
---|---|
Combined report, total ADHD symptoms | No significant sex differences |
Combined report, hyperactivity ADHD symptoms | No significant sex differences |
Combined report, inattention ADHD symptoms | No significant sex differences |
Mother report, total ADHD symptoms | No significant sex differences |
Mother report, hyperactivity ADHD symptoms | No significant sex differences |
Mother report, inattention ADHD symptoms | No significant sex differences |
Teacher report, total ADHD symptoms | No significant sex differences |
Teacher report, hyperactivity ADHD symptoms | No significant sex differences |
Teacher report, inattention ADHD symptoms | No significant sex differences |
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 (female/male) 2) Estimate a model where constraints are applied across both lags and the groups (female/male)
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). This provides the same estimates across each lag, but that they differ for girls and boys.
<- '
RICLPMcomb.lag.c # Create beween 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 beween the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags (all lags constrained). We want to constrain c and d lags but free the autoregressive lags. Variables without notation are freely estimated across sexes.
wad7 ~ wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + wsi5
wad10 ~ wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + wsi7
wad12 ~ wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPMcomb.lag.c,
RICLPMcomb.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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
)
<- summary(RICLPMcomb.lag.c.fit,
RICLPMcomb.lag.c.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 161 iterations
Estimator ML Optimization method NLMINB Number of model parameters 70 Number of equality constraints 8
Number of observations per group:
Female 1140 Male 1092 Number of missing patterns per group:
Female 7 Male 9
Model Test User Model: Standard Robust Test Statistic 93.253 56.699 Degrees of freedom 26 26 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.645 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Female 29.825 18.134 Male 63.428 38.565
Model Test Baseline Model:
Test statistic 6220.595 3142.297 Degrees of freedom 56 56 P-value 0.000 0.000 Scaling correction factor 1.980
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.989 0.990 Tucker-Lewis Index (TLI) 0.977 0.979
Robust Comparative Fit Index (CFI) 0.992 Robust Tucker-Lewis Index (TLI) 0.982
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -31415.294 -31415.294 Scaling correction factor 2.355 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.359 for the MLR correction
Akaike (AIC) 62954.587 62954.587 Bayesian (BIC) 63308.648 63308.648 Sample-size adjusted Bayesian (BIC) 63111.664 63111.664
Root Mean Square Error of Approximation:
RMSEA 0.048 0.033 90 Percent confidence interval - lower 0.038 0.024 90 Percent confidence interval - upper 0.059 0.042 P-value RMSEA <= 0.05 0.594 1.000
Robust RMSEA 0.042 90 Percent confidence interval - lower 0.027 90 Percent confidence interval - upper 0.057
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 [Female]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.497 0.611 tadhde7 1.000 1.497 0.710 tadhde10 1.000 1.497 0.737 tadhde12 1.000 1.497 0.697 RIsi =~
sisoe5 1.000 0.620 0.595 sisoe7 1.000 0.620 0.572 sisoe10 1.000 0.620 0.510 sisoe12 1.000 0.620 0.494 wad5 =~
tadhde5 1.000 1.939 0.792 wad7 =~
tadhde7 1.000 1.483 0.704 wad10 =~
tadhde10 1.000 1.372 0.676 wad12 =~
tadhde12 1.000 1.539 0.717 wsi5 =~
sisoe5 1.000 0.837 0.804 wsi7 =~
sisoe7 1.000 0.888 0.820 wsi10 =~
sisoe10 1.000 1.044 0.860 wsi12 =~
sisoe12 1.000 1.091 0.870
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.226 0.054 4.155 0.000 0.295 0.295 wsi5 (d1) -0.006 0.065 -0.086 0.932 -0.003 -0.003 wsi7 ~
wad5 (c1) 0.029 0.021 1.368 0.171 0.063 0.063 wsi5 0.173 0.077 2.245 0.025 0.163 0.163 wad10 ~
wad7 0.040 0.104 0.381 0.704 0.043 0.043 wsi7 (d1) -0.006 0.065 -0.086 0.932 -0.004 -0.004 wsi10 ~
wad7 (c1) 0.029 0.021 1.368 0.171 0.041 0.041 wsi7 0.259 0.067 3.851 0.000 0.220 0.220 wad12 ~
wad10 0.389 0.108 3.591 0.000 0.346 0.346 wsi10 (d1) -0.006 0.065 -0.086 0.932 -0.004 -0.004 wsi12 ~
wad10 (c1) 0.029 0.021 1.368 0.171 0.037 0.037 wsi10 0.421 0.053 7.878 0.000 0.403 0.403
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.400 0.101 3.964 0.000 0.247 0.247 .wad7 ~~
.wsi7 0.247 0.115 2.158 0.031 0.200 0.200 .wad10 ~~
.wsi10 0.339 0.089 3.816 0.000 0.244 0.244 .wad12 ~~
.wsi12 0.249 0.082 3.041 0.002 0.174 0.174 RIad ~~
RIsi 0.500 0.100 5.008 0.000 0.539 0.539
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 1.851 0.072 25.552 0.000 1.851 0.756 .tadhde7 1.388 0.064 21.842 0.000 1.388 0.658 .tadhde10 1.077 0.061 17.708 0.000 1.077 0.530 .tadhde12 1.058 0.065 16.400 0.000 1.058 0.493 .sisoe5 0.746 0.031 24.409 0.000 0.746 0.716 .sisoe7 0.760 0.032 23.389 0.000 0.760 0.702 .sisoe10 0.874 0.037 23.704 0.000 0.874 0.720 .sisoe12 0.869 0.038 22.750 0.000 0.869 0.693 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.242 0.301 7.439 0.000 1.000 1.000 RIsi 0.384 0.069 5.527 0.000 1.000 1.000 wad5 3.760 0.402 9.344 0.000 1.000 1.000 wsi5 0.700 0.096 7.326 0.000 1.000 1.000 .wad7 2.010 0.300 6.693 0.000 0.913 0.913 .wsi7 0.760 0.079 9.645 0.000 0.964 0.964 .wad10 1.878 0.395 4.757 0.000 0.998 0.998 .wsi10 1.031 0.108 9.564 0.000 0.946 0.946 .wad12 2.086 0.287 7.264 0.000 0.881 0.881 .wsi12 0.988 0.102 9.715 0.000 0.830 0.830 .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 [Male]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.953 0.641 tadhde7 1.000 1.953 0.675 tadhde10 1.000 1.953 0.700 tadhde12 1.000 1.953 0.692 RIsi =~
sisoe5 1.000 0.737 0.592 sisoe7 1.000 0.737 0.588 sisoe10 1.000 0.737 0.544 sisoe12 1.000 0.737 0.506 wad5 =~
tadhde5 1.000 2.341 0.768 wad7 =~
tadhde7 1.000 2.137 0.738 wad10 =~
tadhde10 1.000 1.995 0.715 wad12 =~
tadhde12 1.000 2.036 0.722 wsi5 =~
sisoe5 1.000 1.002 0.806 wsi7 =~
sisoe7 1.000 1.013 0.809 wsi10 =~
sisoe10 1.000 1.135 0.839 wsi12 =~
sisoe12 1.000 1.254 0.862
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.208 0.055 3.802 0.000 0.228 0.228 wsi5 (d2) 0.133 0.094 1.419 0.156 0.062 0.062 wsi7 ~
wad5 (c2) 0.039 0.020 1.964 0.050 0.090 0.090 wsi5 0.241 0.082 2.939 0.003 0.239 0.239 wad10 ~
wad7 0.093 0.076 1.215 0.224 0.099 0.099 wsi7 (d2) 0.133 0.094 1.419 0.156 0.067 0.067 wsi10 ~
wad7 (c2) 0.039 0.020 1.964 0.050 0.074 0.074 wsi7 0.276 0.084 3.283 0.001 0.246 0.246 wad12 ~
wad10 0.191 0.085 2.258 0.024 0.187 0.187 wsi10 (d2) 0.133 0.094 1.419 0.156 0.074 0.074 wsi12 ~
wad10 (c2) 0.039 0.020 1.964 0.050 0.062 0.062 wsi10 0.436 0.061 7.097 0.000 0.395 0.395
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.718 0.198 3.637 0.000 0.306 0.306 .wad7 ~~
.wsi7 0.522 0.145 3.600 0.000 0.260 0.260 .wad10 ~~
.wsi10 0.715 0.164 4.353 0.000 0.332 0.332 .wad12 ~~
.wsi12 0.746 0.151 4.949 0.000 0.330 0.330 RIad ~~
RIsi 0.750 0.112 6.722 0.000 0.521 0.521
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.667 0.091 29.324 0.000 2.667 0.875 .tadhde7 2.255 0.090 25.138 0.000 2.255 0.779 .tadhde10 2.075 0.085 24.277 0.000 2.075 0.743 .tadhde12 1.868 0.087 21.420 0.000 1.868 0.662 .sisoe5 0.883 0.037 23.782 0.000 0.883 0.710 .sisoe7 0.906 0.038 23.570 0.000 0.906 0.723 .sisoe10 1.008 0.042 24.012 0.000 1.008 0.745 .sisoe12 1.015 0.045 22.523 0.000 1.015 0.698 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.813 0.349 10.913 0.000 1.000 1.000 RIsi 0.543 0.092 5.871 0.000 1.000 1.000 wad5 5.479 0.496 11.038 0.000 1.000 1.000 wsi5 1.005 0.181 5.557 0.000 1.000 1.000 .wad7 4.271 0.389 10.991 0.000 0.935 0.935 .wsi7 0.945 0.120 7.845 0.000 0.922 0.922 .wad10 3.906 0.467 8.358 0.000 0.982 0.982 .wsi10 1.190 0.119 9.989 0.000 0.923 0.923 .wad12 3.938 0.431 9.140 0.000 0.950 0.950 .wsi12 1.294 0.130 9.982 0.000 0.823 0.823 .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
<- table.model.fit(RICLPMcomb.lag.c.fit.summary)
RICLPMcomb.lag.c.fit.summary.fit # Table of regression and correlation (standardised covariances) coefficients
<- table.model.coef(RICLPMcomb.lag.c.fit.summary, sex = "Female", constraints = "Yes")
RICLPMcomb.lag.c.fit.summary.reg.female <- table.model.coef(RICLPMcomb.lag.c.fit.summary, sex = "Male", constraints = "Yes") RICLPMcomb.lag.c.fit.summary.reg.male
<- '
RICLPMcomb.sex.lag.c # Create beween 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 beween the within-person centered variables. a and b parameters are constrained to be the same across the groups c(females, males), but are different across the lags. c and d parameters are the same across lag and group.
wad7 ~ c(a1, a1)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b1, b1)*wsi5
wad10 ~ c(a2, a2)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b2, b2)*wsi7
wad12 ~ c(a3, a3)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(b3, b3)*wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPMcomb.sex.lag.c,
RICLPMcomb.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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-parameers are constrained to be equal across groups.
lavTestLRT(RICLPMcomb.lag.c.fit, RICLPMcomb.sex.lag.c.fit, mehod = "satorra.bentler.2010")
The chi-square difference test of these two nested models is NON significant (p=0.5628). Therefore, we conclude there are no sex differences in the constrained RICLPM combined report, total ADHD symptoms.
<- '
RICLPMcomb_hyp.lag.c # Create beween 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 beween the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across cross lags.
wad7 ~ wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + wsi5
wad10 ~ wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + wsi7
wad12 ~ wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPMcomb_hyp.lag.c,
RICLPMcomb_hyp.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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
)
<- summary(RICLPMcomb_hyp.lag.c.fit,
RICLPMcomb_hyp.lag.c.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 61 iterations
Estimator ML Optimization method NLMINB Number of model parameters 70 Number of equality constraints 8
Number of observations per group:
Female 1140 Male 1092 Number of missing patterns per group:
Female 7 Male 9
Model Test User Model: Standard Robust Test Statistic 71.082 45.700 Degrees of freedom 26 26 P-value (Chi-square) 0.000 0.010 Scaling correction factor 1.555 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Female 24.870 15.989 Male 46.212 29.711
Model Test Baseline Model:
Test statistic 5615.686 3028.921 Degrees of freedom 56 56 P-value 0.000 0.000 Scaling correction factor 1.854
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.993 Tucker-Lewis Index (TLI) 0.983 0.986
Robust Comparative Fit Index (CFI) 0.994 Robust Tucker-Lewis Index (TLI) 0.988
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26900.182 -26900.182 Scaling correction factor 2.213 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.220 for the MLR correction
Akaike (AIC) 53924.364 53924.364 Bayesian (BIC) 54278.424 54278.424 Sample-size adjusted Bayesian (BIC) 54081.440 54081.440
Root Mean Square Error of Approximation:
RMSEA 0.039 0.026 90 Percent confidence interval - lower 0.029 0.016 90 Percent confidence interval - upper 0.051 0.036 P-value RMSEA <= 0.05 0.941 1.000
Robust RMSEA 0.032 90 Percent confidence interval - lower 0.016 90 Percent confidence interval - upper 0.048
Standardized Root Mean Square Residual:
SRMR 0.029 0.029
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Group 1 [Female]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.866 0.601 hye7 1.000 0.866 0.698 hye10 1.000 0.866 0.730 hye12 1.000 0.866 0.674 RIsi =~
sisoe5 1.000 0.630 0.606 sisoe7 1.000 0.630 0.584 sisoe10 1.000 0.630 0.517 sisoe12 1.000 0.630 0.500 wad5 =~
hye5 1.000 1.152 0.799 wad7 =~
hye7 1.000 0.888 0.716 wad10 =~
hye10 1.000 0.811 0.684 wad12 =~
hye12 1.000 0.949 0.739 wsi5 =~
sisoe5 1.000 0.827 0.796 wsi7 =~
sisoe7 1.000 0.875 0.812 wsi10 =~
sisoe10 1.000 1.044 0.856 wsi12 =~
sisoe12 1.000 1.092 0.866
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.184 0.047 3.915 0.000 0.239 0.239 wsi5 (d1) 0.004 0.037 0.096 0.924 0.003 0.003 wsi7 ~
wad5 (c1) 0.038 0.033 1.140 0.254 0.050 0.050 wsi5 0.155 0.080 1.937 0.053 0.146 0.146 wad10 ~
wad7 0.011 0.091 0.118 0.906 0.012 0.012 wsi7 (d1) 0.004 0.037 0.096 0.924 0.004 0.004 wsi10 ~
wad7 (c1) 0.038 0.033 1.140 0.254 0.032 0.032 wsi7 0.253 0.067 3.769 0.000 0.213 0.213 wad12 ~
wad10 0.380 0.101 3.774 0.000 0.325 0.325 wsi10 (d1) 0.004 0.037 0.096 0.924 0.004 0.004 wsi12 ~
wad10 (c1) 0.038 0.033 1.140 0.254 0.028 0.028 wsi10 0.427 0.053 8.045 0.000 0.408 0.408
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.188 0.059 3.209 0.001 0.197 0.197 .wad7 ~~
.wsi7 0.121 0.070 1.740 0.082 0.162 0.162 .wad10 ~~
.wsi10 0.166 0.053 3.109 0.002 0.201 0.201 .wad12 ~~
.wsi12 0.115 0.050 2.308 0.021 0.129 0.129 RIad ~~
RIsi 0.256 0.051 4.977 0.000 0.469 0.469
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.165 0.042 27.578 0.000 1.165 0.809 .hye7 0.857 0.038 22.827 0.000 0.857 0.691 .hye10 0.600 0.035 16.937 0.000 0.600 0.506 .hye12 0.607 0.039 15.664 0.000 0.607 0.473 .sisoe5 0.746 0.031 24.409 0.000 0.746 0.717 .sisoe7 0.759 0.032 23.396 0.000 0.759 0.704 .sisoe10 0.874 0.037 23.702 0.000 0.874 0.717 .sisoe12 0.870 0.038 22.752 0.000 0.870 0.690 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.749 0.086 8.674 0.000 1.000 1.000 RIsi 0.397 0.070 5.643 0.000 1.000 1.000 wad5 1.327 0.119 11.109 0.000 1.000 1.000 wsi5 0.685 0.096 7.125 0.000 1.000 1.000 .wad7 0.743 0.109 6.845 0.000 0.943 0.943 .wsi7 0.746 0.080 9.353 0.000 0.973 0.973 .wad10 0.658 0.129 5.115 0.000 1.000 1.000 .wsi10 1.036 0.109 9.548 0.000 0.951 0.951 .wad12 0.804 0.104 7.771 0.000 0.894 0.894 .wsi12 0.988 0.101 9.737 0.000 0.828 0.828 .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 [Male]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 1.050 0.597 hye7 1.000 1.050 0.628 hye10 1.000 1.050 0.684 hye12 1.000 1.050 0.690 RIsi =~
sisoe5 1.000 0.744 0.600 sisoe7 1.000 0.744 0.594 sisoe10 1.000 0.744 0.548 sisoe12 1.000 0.744 0.510 wad5 =~
hye5 1.000 1.412 0.803 wad7 =~
hye7 1.000 1.301 0.778 wad10 =~
hye10 1.000 1.120 0.730 wad12 =~
hye12 1.000 1.102 0.724 wsi5 =~
sisoe5 1.000 0.991 0.800 wsi7 =~
sisoe7 1.000 1.009 0.805 wsi10 =~
sisoe10 1.000 1.136 0.836 wsi12 =~
sisoe12 1.000 1.254 0.860
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.262 0.046 5.680 0.000 0.284 0.284 wsi5 (d2) 0.065 0.051 1.282 0.200 0.049 0.049 wsi7 ~
wad5 (c2) 0.069 0.030 2.329 0.020 0.096 0.096 wsi5 0.237 0.082 2.907 0.004 0.233 0.233 wad10 ~
wad7 0.135 0.063 2.152 0.031 0.157 0.157 wsi7 (d2) 0.065 0.051 1.282 0.200 0.058 0.058 wsi10 ~
wad7 (c2) 0.069 0.030 2.329 0.020 0.079 0.079 wsi7 0.280 0.083 3.359 0.001 0.248 0.248 wad12 ~
wad10 0.175 0.079 2.208 0.027 0.178 0.178 wsi10 (d2) 0.065 0.051 1.282 0.200 0.067 0.067 wsi12 ~
wad10 (c2) 0.069 0.030 2.329 0.020 0.062 0.062 wsi10 0.438 0.062 7.017 0.000 0.396 0.396
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.288 0.083 3.451 0.001 0.206 0.206 .wad7 ~~
.wsi7 0.264 0.077 3.419 0.001 0.219 0.219 .wad10 ~~
.wsi10 0.362 0.084 4.316 0.000 0.302 0.302 .wad12 ~~
.wsi12 0.339 0.080 4.258 0.000 0.276 0.276 RIad ~~
RIsi 0.339 0.060 5.675 0.000 0.434 0.434
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.587 0.053 30.125 0.000 1.587 0.902 .hye7 1.339 0.052 25.872 0.000 1.339 0.801 .hye10 1.082 0.047 23.056 0.000 1.082 0.705 .hye12 0.959 0.047 20.391 0.000 0.959 0.630 .sisoe5 0.883 0.037 23.782 0.000 0.883 0.713 .sisoe7 0.906 0.038 23.570 0.000 0.906 0.723 .sisoe10 1.008 0.042 24.021 0.000 1.008 0.742 .sisoe12 1.015 0.045 22.537 0.000 1.015 0.697 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.102 0.101 10.924 0.000 1.000 1.000 RIsi 0.554 0.091 6.115 0.000 1.000 1.000 wad5 1.994 0.153 13.023 0.000 1.000 1.000 wsi5 0.983 0.175 5.614 0.000 1.000 1.000 .wad7 1.543 0.129 11.923 0.000 0.911 0.911 .wsi7 0.944 0.120 7.844 0.000 0.927 0.927 .wad10 1.213 0.138 8.762 0.000 0.967 0.967 .wsi10 1.190 0.120 9.911 0.000 0.922 0.922 .wad12 1.161 0.129 9.002 0.000 0.956 0.956 .wsi12 1.294 0.129 10.022 0.000 0.823 0.823 .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
<- table.model.fit(RICLPMcomb_hyp.lag.c.fit.summary)
RICLPMcomb_hyp.lag.c.fit.summary.fit # Table of regression and correlation (standardised covariances) coefficients
<- table.model.coef(RICLPMcomb_hyp.lag.c.fit.summary, sex = "Female", constraints = "Yes")
RICLPMcomb_hyp.lag.c.fit.summary.reg.female <- table.model.coef(RICLPMcomb_hyp.lag.c.fit.summary, sex = "Male", constraints = "Yes") RICLPMcomb_hyp.lag.c.fit.summary.reg.male
<- '
RICLPMcomb_hyp.sex.lag.c # Create beween 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 beween the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects beween the within-person centered variables.
wad7 ~ c(a1, a1)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b1, b1)*wsi5
wad10 ~ c(a2, a2)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b2, b2)*wsi7
wad12 ~ c(a3, a3)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(b3, b3)*wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPMcomb_hyp.sex.lag.c,
RICLPMcomb_hyp.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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-parameers are constrained to be equal across groups.
lavTestLRT(RICLPMcomb_hyp.lag.c.fit, RICLPMcomb_hyp.sex.lag.c.fit, mehod = "satorra.bentler.2010")
<- '
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)*wsi5
wsi7 ~ c(c1, c2)*wad5 + wsi5
wad10 ~ wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + wsi7
wad12 ~ wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*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
'
<- lavaan(RICLPMcomb_inat.lag.c,
RICLPMcomb_inat.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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
)
<- summary(RICLPMcomb_inat.lag.c.fit,
RICLPMcomb_inat.lag.c.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 67 iterations
Estimator ML Optimization method NLMINB Number of model parameters 70 Number of equality constraints 8
Number of observations per group:
Female 1140 Male 1092 Number of missing patterns per group:
Female 7 Male 9
Model Test User Model: Standard Robust Test Statistic 100.207 59.672 Degrees of freedom 26 26 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.679 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Female 34.676 20.649 Male 65.531 39.023
Model Test Baseline Model:
Test statistic 5616.960 2788.828 Degrees of freedom 56 56 P-value 0.000 0.000 Scaling correction factor 2.014
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.987 0.988 Tucker-Lewis Index (TLI) 0.971 0.973
Robust Comparative Fit Index (CFI) 0.990 Robust Tucker-Lewis Index (TLI) 0.978
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26108.768 -26108.768 Scaling correction factor 2.418 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.420 for the MLR correction
Akaike (AIC) 52341.536 52341.536 Bayesian (BIC) 52695.597 52695.597 Sample-size adjusted Bayesian (BIC) 52498.613 52498.613
Root Mean Square Error of Approximation:
RMSEA 0.051 0.034 90 Percent confidence interval - lower 0.040 0.025 90 Percent confidence interval - upper 0.061 0.043 P-value RMSEA <= 0.05 0.444 0.999
Robust RMSEA 0.044 90 Percent confidence interval - lower 0.029 90 Percent confidence interval - upper 0.059
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 [Female]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.729 0.581 ine7 1.000 0.729 0.659 ine10 1.000 0.729 0.685 ine12 1.000 0.729 0.672 RIsi =~
sisoe5 1.000 0.616 0.593 sisoe7 1.000 0.616 0.568 sisoe10 1.000 0.616 0.507 sisoe12 1.000 0.616 0.492 wad5 =~
ine5 1.000 1.021 0.814 wad7 =~
ine7 1.000 0.833 0.753 wad10 =~
ine10 1.000 0.775 0.728 wad12 =~
ine12 1.000 0.803 0.740 wsi5 =~
sisoe5 1.000 0.836 0.805 wsi7 =~
sisoe7 1.000 0.893 0.823 wsi10 =~
sisoe10 1.000 1.048 0.862 wsi12 =~
sisoe12 1.000 1.091 0.871
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.225 0.066 3.433 0.001 0.276 0.276 wsi5 (d1) 0.008 0.033 0.243 0.808 0.008 0.008 wsi7 ~
wad5 (c1) 0.052 0.038 1.377 0.168 0.060 0.060 wsi5 0.182 0.078 2.337 0.019 0.170 0.170 wad10 ~
wad7 0.051 0.083 0.612 0.541 0.054 0.054 wsi7 (d1) 0.008 0.033 0.243 0.808 0.009 0.009 wsi10 ~
wad7 (c1) 0.052 0.038 1.377 0.168 0.041 0.041 wsi7 0.272 0.070 3.868 0.000 0.232 0.232 wad12 ~
wad10 0.295 0.084 3.507 0.000 0.284 0.284 wsi10 (d1) 0.008 0.033 0.243 0.808 0.011 0.011 wsi12 ~
wad10 (c1) 0.052 0.038 1.377 0.168 0.037 0.037 wsi10 0.419 0.053 7.832 0.000 0.403 0.403
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.210 0.051 4.096 0.000 0.246 0.246 .wad7 ~~
.wsi7 0.132 0.053 2.471 0.013 0.188 0.188 .wad10 ~~
.wsi10 0.180 0.053 3.390 0.001 0.229 0.229 .wad12 ~~
.wsi12 0.141 0.042 3.339 0.001 0.184 0.184 RIad ~~
RIsi 0.244 0.053 4.622 0.000 0.542 0.542
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.684 0.038 18.219 0.000 0.684 0.546 .ine7 0.531 0.033 16.009 0.000 0.531 0.479 .ine10 0.474 0.032 14.839 0.000 0.474 0.445 .ine12 0.449 0.032 13.823 0.000 0.449 0.414 .sisoe5 0.746 0.031 24.409 0.000 0.746 0.718 .sisoe7 0.760 0.032 23.391 0.000 0.760 0.700 .sisoe10 0.874 0.037 23.705 0.000 0.874 0.719 .sisoe12 0.869 0.038 22.748 0.000 0.869 0.694 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.532 0.080 6.626 0.000 1.000 1.000 RIsi 0.380 0.068 5.581 0.000 1.000 1.000 wad5 1.042 0.118 8.793 0.000 1.000 1.000 wsi5 0.700 0.095 7.329 0.000 1.000 1.000 .wad7 0.641 0.089 7.208 0.000 0.923 0.923 .wsi7 0.768 0.079 9.707 0.000 0.962 0.962 .wad10 0.599 0.107 5.601 0.000 0.997 0.997 .wsi10 1.034 0.108 9.557 0.000 0.941 0.941 .wad12 0.592 0.089 6.685 0.000 0.918 0.918 .wsi12 0.987 0.102 9.681 0.000 0.830 0.830 .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 [Male]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 1.008 0.646 ine7 1.000 1.008 0.676 ine10 1.000 1.008 0.651 ine12 1.000 1.008 0.643 RIsi =~
sisoe5 1.000 0.745 0.597 sisoe7 1.000 0.745 0.595 sisoe10 1.000 0.745 0.551 sisoe12 1.000 0.745 0.513 wad5 =~
ine5 1.000 1.191 0.763 wad7 =~
ine7 1.000 1.100 0.737 wad10 =~
ine10 1.000 1.177 0.759 wad12 =~
ine12 1.000 1.202 0.766 wsi5 =~
sisoe5 1.000 1.002 0.802 wsi7 =~
sisoe7 1.000 1.006 0.803 wsi10 =~
sisoe10 1.000 1.129 0.835 wsi12 =~
sisoe12 1.000 1.247 0.858
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.098 0.067 1.449 0.147 0.106 0.106 wsi5 (d2) 0.061 0.047 1.291 0.197 0.055 0.055 wsi7 ~
wad5 (c2) 0.044 0.038 1.138 0.255 0.052 0.052 wsi5 0.245 0.084 2.917 0.004 0.244 0.244 wad10 ~
wad7 0.029 0.084 0.341 0.733 0.027 0.027 wsi7 (d2) 0.061 0.047 1.291 0.197 0.052 0.052 wsi10 ~
wad7 (c2) 0.044 0.038 1.138 0.255 0.042 0.042 wsi7 0.281 0.086 3.270 0.001 0.251 0.251 wad12 ~
wad10 0.224 0.069 3.268 0.001 0.220 0.220 wsi10 (d2) 0.061 0.047 1.291 0.197 0.057 0.057 wsi12 ~
wad10 (c2) 0.044 0.038 1.138 0.255 0.041 0.041 wsi10 0.439 0.062 7.103 0.000 0.398 0.398
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.393 0.120 3.259 0.001 0.329 0.329 .wad7 ~~
.wsi7 0.237 0.076 3.134 0.002 0.225 0.225 .wad10 ~~
.wsi10 0.351 0.092 3.836 0.000 0.274 0.274 .wad12 ~~
.wsi12 0.423 0.081 5.219 0.000 0.319 0.319 RIad ~~
RIsi 0.435 0.060 7.272 0.000 0.578 0.578
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 1.077 0.047 23.031 0.000 1.077 0.690 .ine7 0.913 0.046 19.752 0.000 0.913 0.612 .ine10 0.989 0.048 20.765 0.000 0.989 0.638 .ine12 0.907 0.048 18.945 0.000 0.907 0.578 .sisoe5 0.883 0.037 23.782 0.000 0.883 0.707 .sisoe7 0.905 0.038 23.569 0.000 0.905 0.723 .sisoe10 1.008 0.042 24.011 0.000 1.008 0.745 .sisoe12 1.016 0.045 22.515 0.000 1.016 0.699 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.017 0.100 10.171 0.000 1.000 1.000 RIsi 0.555 0.092 6.016 0.000 1.000 1.000 wad5 1.417 0.155 9.131 0.000 1.000 1.000 wsi5 1.004 0.180 5.587 0.000 1.000 1.000 .wad7 1.188 0.131 9.091 0.000 0.982 0.982 .wsi7 0.940 0.121 7.750 0.000 0.929 0.929 .wad10 1.380 0.158 8.712 0.000 0.996 0.996 .wsi10 1.187 0.119 9.960 0.000 0.930 0.930 .wad12 1.360 0.132 10.329 0.000 0.942 0.942 .wsi12 1.291 0.130 9.964 0.000 0.831 0.831 .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
<- table.model.fit(RICLPMcomb_inat.lag.c.fit.summary)
RICLPMcomb_inat.lag.c.fit.summary.fit # Table of regression and correlation (standardised covariances) coefficients
<- table.model.coef(RICLPMcomb_inat.lag.c.fit.summary, sex = "Female", constraints = "Yes")
RICLPMcomb_inat.lag.c.fit.summary.reg.female <- table.model.coef(RICLPMcomb_inat.lag.c.fit.summary, sex = "Male", constraints = "Yes") RICLPMcomb_inat.lag.c.fit.summary.reg.male
<- '
RICLPMcomb_inat.sex.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)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b1, b1)*wsi5
wad10 ~ c(a2, a2)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b2, b2)*wsi7
wad12 ~ c(a3, a3)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(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
'
<- lavaan(RICLPMcomb_inat.sex.lag.c,
RICLPMcomb_inat.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.lag.c.fit, method = "satorra.bentler.2010")
non-significant p = 0.8369.
<- '
RICLPM.lag.c # Create beween 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 beween the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across lags (all lags constrained). We want to constrain c and d lags but free the autoregressive lags. Variables without notation are freely estimated across sexes.
wad7 ~ wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + wsi5
wad10 ~ wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + wsi7
wad12 ~ wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPM.lag.c,
RICLPM.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.lag.c # Create beween 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 beween the within-person centered variables. a and b parameters are constrained to be the same across the groups c(females, males), but are different across the lags. c and d parameters are the same across lag and group.
wad7 ~ c(a1, a1)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b1, b1)*wsi5
wad10 ~ c(a2, a2)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b2, b2)*wsi7
wad12 ~ c(a3, a3)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(b3, b3)*wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPM.sex.lag.c,
RICLPM.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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-parameers are constrained to be equal across groups.
lavTestLRT(RICLPM.lag.c.fit, RICLPM.sex.lag.c.fit, mehod = "satorra.bentler.2010")
The chi-square difference test of these two nested models is NON significant (p=0.6957). Therefore, we conclude there are no sex differences in the constrained RICLPM combined report, total ADHD symptoms.
<- '
RICLPM_hyp.lag.c # Create beween 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 beween the within-person centered variables. c(group1/females, group2/males) - different values across groups, but the same values within groups and across cross lags.
wad7 ~ wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + wsi5
wad10 ~ wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + wsi7
wad12 ~ wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPM_hyp.lag.c,
RICLPM_hyp.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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
)
<- summary(RICLPM_hyp.lag.c.fit,
RICLPM_hyp.lag.c.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 113 iterations
Estimator ML Optimization method NLMINB Number of model parameters 70 Number of equality constraints 8
Number of observations per group:
Female 1140 Male 1092 Number of missing patterns per group:
Female 8 Male 10
Model Test User Model: Standard Robust Test Statistic 87.831 58.982 Degrees of freedom 26 26 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.489 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Female 37.136 24.938 Male 50.695 34.043
Model Test Baseline Model:
Test statistic 6262.342 3700.528 Degrees of freedom 56 56 P-value 0.000 0.000 Scaling correction factor 1.692
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.990 0.991 Tucker-Lewis Index (TLI) 0.979 0.981
Robust Comparative Fit Index (CFI) 0.992 Robust Tucker-Lewis Index (TLI) 0.983
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -31939.013 -31939.013 Scaling correction factor 1.755 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.836 for the MLR correction
Akaike (AIC) 64002.025 64002.025 Bayesian (BIC) 64356.086 64356.086 Sample-size adjusted Bayesian (BIC) 64159.102 64159.102
Root Mean Square Error of Approximation:
RMSEA 0.046 0.034 90 Percent confidence interval - lower 0.036 0.024 90 Percent confidence interval - upper 0.057 0.043 P-value RMSEA <= 0.05 0.707 0.998
Robust RMSEA 0.041 90 Percent confidence interval - lower 0.027 90 Percent confidence interval - upper 0.055
Standardized Root Mean Square Residual:
SRMR 0.029 0.029
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Group 1 [Female]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyem5 1.000 1.376 0.592 hyem7 1.000 1.376 0.674 hyem10 1.000 1.376 0.790 hyem12 1.000 1.376 0.779 RIsi =~
sisoem5 1.000 0.815 0.591 sisoem7 1.000 0.815 0.560 sisoem10 1.000 0.815 0.525 sisoem12 1.000 0.815 0.539 wad5 =~
hyem5 1.000 1.872 0.806 wad7 =~
hyem7 1.000 1.506 0.738 wad10 =~
hyem10 1.000 1.069 0.613 wad12 =~
hyem12 1.000 1.109 0.628 wsi5 =~
sisoem5 1.000 1.113 0.807 wsi7 =~
sisoem7 1.000 1.204 0.828 wsi10 =~
sisoem10 1.000 1.321 0.851 wsi12 =~
sisoem12 1.000 1.272 0.842
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.274 0.042 6.596 0.000 0.341 0.341 wsi5 (d1) 0.035 0.042 0.843 0.399 0.026 0.026 wsi7 ~
wad5 (c1) 0.026 0.028 0.925 0.355 0.040 0.040 wsi5 0.223 0.087 2.574 0.010 0.206 0.206 wad10 ~
wad7 0.019 0.063 0.306 0.759 0.027 0.027 wsi7 (d1) 0.035 0.042 0.843 0.399 0.040 0.040 wsi10 ~
wad7 (c1) 0.026 0.028 0.925 0.355 0.029 0.029 wsi7 0.281 0.073 3.836 0.000 0.256 0.256 wad12 ~
wad10 0.206 0.110 1.884 0.060 0.199 0.199 wsi10 (d1) 0.035 0.042 0.843 0.399 0.042 0.042 wsi12 ~
wad10 (c1) 0.026 0.028 0.925 0.355 0.022 0.022 wsi10 0.398 0.050 7.885 0.000 0.413 0.413
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.406 0.117 3.477 0.001 0.195 0.195 .wad7 ~~
.wsi7 0.147 0.090 1.621 0.105 0.088 0.088 .wad10 ~~
.wsi10 0.318 0.108 2.950 0.003 0.233 0.233 .wad12 ~~
.wsi12 0.091 0.059 1.535 0.125 0.073 0.073 RIad ~~
RIsi 0.483 0.097 4.960 0.000 0.431 0.431
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyem5 1.936 0.068 28.534 0.000 1.936 0.834 .hyem7 1.430 0.062 23.152 0.000 1.430 0.701 .hyem10 0.949 0.053 18.047 0.000 0.949 0.545 .hyem12 0.867 0.053 16.390 0.000 0.867 0.491 .sisoem5 0.923 0.040 22.915 0.000 0.923 0.669 .sisoem7 0.945 0.045 21.219 0.000 0.945 0.650 .sisoem10 1.055 0.047 22.585 0.000 1.055 0.679 .sisoem12 0.978 0.046 21.327 0.000 0.978 0.647 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.892 0.195 9.692 0.000 1.000 1.000 RIsi 0.664 0.112 5.948 0.000 1.000 1.000 wad5 3.504 0.233 15.033 0.000 1.000 1.000 wsi5 1.239 0.133 9.342 0.000 1.000 1.000 .wad7 1.996 0.164 12.171 0.000 0.880 0.880 .wsi7 1.382 0.142 9.728 0.000 0.953 0.953 .wad10 1.139 0.191 5.959 0.000 0.997 0.997 .wsi10 1.627 0.144 11.313 0.000 0.932 0.932 .wad12 1.173 0.140 8.364 0.000 0.955 0.955 .wsi12 1.334 0.114 11.686 0.000 0.825 0.825 .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 [Male]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyem5 1.000 1.564 0.618 hyem7 1.000 1.564 0.660 hyem10 1.000 1.564 0.712 hyem12 1.000 1.564 0.730 RIsi =~
sisoem5 1.000 1.024 0.662 sisoem7 1.000 1.024 0.659 sisoem10 1.000 1.024 0.604 sisoem12 1.000 1.024 0.575 wad5 =~
hyem5 1.000 1.986 0.786 wad7 =~
hyem7 1.000 1.778 0.751 wad10 =~
hyem10 1.000 1.543 0.702 wad12 =~
hyem12 1.000 1.463 0.683 wsi5 =~
sisoem5 1.000 1.161 0.750 wsi7 =~
sisoem7 1.000 1.169 0.752 wsi10 =~
sisoem10 1.000 1.350 0.797 wsi12 =~
sisoem12 1.000 1.457 0.818
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.264 0.046 5.797 0.000 0.295 0.295 wsi5 (d2) 0.055 0.057 0.970 0.332 0.036 0.036 wsi7 ~
wad5 (c2) 0.047 0.026 1.810 0.070 0.080 0.080 wsi5 0.221 0.080 2.763 0.006 0.219 0.219 wad10 ~
wad7 0.090 0.066 1.363 0.173 0.103 0.103 wsi7 (d2) 0.055 0.057 0.970 0.332 0.042 0.042 wsi10 ~
wad7 (c2) 0.047 0.026 1.810 0.070 0.062 0.062 wsi7 0.218 0.100 2.184 0.029 0.189 0.189 wad12 ~
wad10 0.247 0.070 3.510 0.000 0.261 0.261 wsi10 (d2) 0.055 0.057 0.970 0.332 0.051 0.051 wsi12 ~
wad10 (c2) 0.047 0.026 1.810 0.070 0.050 0.050 wsi10 0.456 0.069 6.602 0.000 0.423 0.423
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.204 0.117 1.744 0.081 0.088 0.088 .wad7 ~~
.wsi7 0.237 0.103 2.301 0.021 0.123 0.123 .wad10 ~~
.wsi10 0.502 0.125 4.001 0.000 0.248 0.248 .wad12 ~~
.wsi12 0.515 0.109 4.742 0.000 0.280 0.280 RIad ~~
RIsi 0.655 0.113 5.813 0.000 0.409 0.409
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyem5 2.394 0.076 31.417 0.000 2.394 0.947 .hyem7 1.943 0.073 26.721 0.000 1.943 0.821 .hyem10 1.519 0.067 22.530 0.000 1.519 0.691 .hyem12 1.353 0.066 20.589 0.000 1.353 0.632 .sisoem5 1.027 0.046 22.391 0.000 1.027 0.664 .sisoem7 1.030 0.048 21.380 0.000 1.030 0.663 .sisoem10 1.140 0.052 21.916 0.000 1.140 0.672 .sisoem12 1.123 0.055 20.527 0.000 1.123 0.630 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.445 0.201 12.144 0.000 1.000 1.000 RIsi 1.050 0.168 6.241 0.000 1.000 1.000 wad5 3.946 0.239 16.516 0.000 1.000 1.000 wsi5 1.347 0.204 6.603 0.000 1.000 1.000 .wad7 2.874 0.207 13.898 0.000 0.910 0.910 .wsi7 1.287 0.143 9.010 0.000 0.942 0.942 .wad10 2.349 0.232 10.128 0.000 0.986 0.986 .wsi10 1.745 0.177 9.862 0.000 0.957 0.957 .wad12 1.975 0.156 12.690 0.000 0.923 0.923 .wsi12 1.715 0.157 10.959 0.000 0.808 0.808 .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
<- table.model.fit(RICLPM_hyp.lag.c.fit.summary)
RICLPM_hyp.lag.c.fit.summary.fit # Table of regression and correlation (standardised covariances) coefficients
<- table.model.coef(RICLPM_hyp.lag.c.fit.summary, sex = "Female", constraints = "Yes")
RICLPM_hyp.lag.c.fit.summary.reg.female <- table.model.coef(RICLPM_hyp.lag.c.fit.summary, sex = "Male", constraints = "Yes") RICLPM_hyp.lag.c.fit.summary.reg.male
<- '
RICLPM_hyp.sex.lag.c # Create beween 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 beween the within-person centered variables. Constrain the autoregressive effects across groups AND the lagged effects beween the within-person centered variables.
wad7 ~ c(a1, a1)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b1, b1)*wsi5
wad10 ~ c(a2, a2)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b2, b2)*wsi7
wad12 ~ c(a3, a3)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(b3, b3)*wsi10
# Estimate the covariance beween the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances beween 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
'
<- lavaan(RICLPM_hyp.sex.lag.c,
RICLPM_hyp.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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-parameers are constrained to be equal across groups.
lavTestLRT(RICLPM_hyp.lag.c.fit, RICLPM_hyp.sex.lag.c.fit, mehod = "satorra.bentler.2010")
Non-significant p = 0.9554.
<- '
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)*wsi5
wsi7 ~ c(c1, c2)*wad5 + wsi5
wad10 ~ wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + wsi7
wad12 ~ wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*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
'
<- lavaan(RICLPM_inat.lag.c,
RICLPM_inat.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.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)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b1, b1)*wsi5
wad10 ~ c(a2, a2)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b2, b2)*wsi7
wad12 ~ c(a3, a3)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(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
'
<- lavaan(RICLPM_inat.sex.lag.c,
RICLPM_inat.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.lag.c.fit, method = "satorra.bentler.2010")
The chi-square difference test of these two nested models is non significant (p=0.2656).
However, there were no differences in significance in the cross-lagged paths so we conclude there are no sex differences in the constrained RICLPM mother report for inattention 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/females, group2/males) - different values across groups, but the same values within groups and across lags (all lags constrained).
wad7 ~ c(a1, a2)*wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + c(b1,b2)*wsi5
wad10 ~ c(a1, a2)*wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + c(b1,b2)*wsi7
wad12 ~ c(a1, a2)*wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + c(b1,b2)*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
'
<- lavaan(RICLPMt.lag.c,
RICLPMt.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.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)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b, b)*wsi5
wad10 ~ c(a, a)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b, b)*wsi7
wad12 ~ c(a, a)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(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
'
<- lavaan(RICLPMt.sex.lag.c,
RICLPMt.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.lag.c.fit, method = "satorra.bentler.2010")
The chi-square difference test of these two nested models is NON significant (p=0.5833). Therefore, we conclude there are no sex differences in the constrained RICLPM teacher report, total 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/females, group2/males) - different values across groups, but the same values within groups and across lags (all lags constrained).
wad7 ~ c(a1, a2)*wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + c(b1,b2)*wsi5
wad10 ~ c(a1, a2)*wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + c(b1,b2)*wsi7
wad12 ~ c(a1, a2)*wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + c(b1,b2)*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
'
<- lavaan(RICLPMt_hyp.lag.c,
RICLPMt_hyp.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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
)
<- summary(RICLPMt_hyp.lag.c.fit,
RICLPMt_hyp.lag.c.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 78 iterations
Estimator ML Optimization method NLMINB Number of model parameters 70 Number of equality constraints 16
Number of observations per group: Used Total Female 1138 1140 Male 1086 1092 Number of missing patterns per group:
Female 29
Male 24
Model Test User Model: Standard Robust Test Statistic 140.422 54.470 Degrees of freedom 34 34 P-value (Chi-square) 0.000 0.014 Scaling correction factor 2.578 Yuan-Bentler correction (Mplus variant)
Test statistic for each group: Female 91.350 35.435 Male 49.072 19.035
Model Test Baseline Model:
Test statistic 1877.686 745.917 Degrees of freedom 56 56 P-value 0.000 0.000 Scaling correction factor 2.517
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.942 0.970 Tucker-Lewis Index (TLI) 0.904 0.951
Robust Comparative Fit Index (CFI) 0.970 Robust Tucker-Lewis Index (TLI) 0.950
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -24643.875 -24643.875 Scaling correction factor 3.233 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.568 for the MLR correction
Akaike (AIC) 49395.749 49395.749 Bayesian (BIC) 49703.931 49703.931 Sample-size adjusted Bayesian (BIC) 49532.364 49532.364
Root Mean Square Error of Approximation:
RMSEA 0.053 0.023 90 Percent confidence interval - lower 0.044 0.016 90 Percent confidence interval - upper 0.062 0.030 P-value RMSEA <= 0.05 0.276 1.000
Robust RMSEA 0.037 90 Percent confidence interval - lower 0.017 90 Percent confidence interval - upper 0.055
Standardized Root Mean Square Residual:
SRMR 0.041 0.041
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Group 1 [Female]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyet5 1.000 0.440 0.400 hyet7 1.000 0.440 0.495 hyet10 1.000 0.440 0.594 hyet12 1.000 0.440 0.571 RIsi =~
sisoet5 1.000 0.547 0.455 sisoet7 1.000 0.547 0.446 sisoet10 1.000 0.547 0.401 sisoet12 1.000 0.547 0.417 wad5 =~
hyet5 1.000 1.007 0.916 wad7 =~
hyet7 1.000 0.772 0.869 wad10 =~
hyet10 1.000 0.596 0.805 wad12 =~
hyet12 1.000 0.632 0.821 wsi5 =~
sisoet5 1.000 1.070 0.890 wsi7 =~
sisoet7 1.000 1.097 0.895 wsi10 =~
sisoet10 1.000 1.250 0.916 wsi12 =~
sisoet12 1.000 1.191 0.909
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a1) 0.055 0.057 0.966 0.334 0.071 0.071 wsi5 (d1) -0.040 0.036 -1.087 0.277 -0.055 -0.055 wsi7 ~
wad5 (c1) 0.057 0.064 0.903 0.366 0.053 0.053 wsi5 (b1) 0.122 0.049 2.518 0.012 0.119 0.119 wad10 ~
wad7 (a1) 0.055 0.057 0.966 0.334 0.071 0.071 wsi7 (d1) -0.040 0.036 -1.087 0.277 -0.073 -0.073 wsi10 ~
wad7 (c1) 0.057 0.064 0.903 0.366 0.035 0.035 wsi7 (b1) 0.122 0.049 2.518 0.012 0.107 0.107 wad12 ~
wad10 (a1) 0.055 0.057 0.966 0.334 0.052 0.052 wsi10 (d1) -0.040 0.036 -1.087 0.277 -0.078 -0.078 wsi12 ~
wad10 (c1) 0.057 0.064 0.903 0.366 0.029 0.029 wsi10 (b1) 0.122 0.049 2.518 0.012 0.128 0.128
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.224 0.073 3.049 0.002 0.208 0.208 .wad7 ~~
.wsi7 0.084 0.065 1.300 0.194 0.101 0.101 .wad10 ~~
.wsi10 0.070 0.064 1.097 0.273 0.095 0.095 .wad12 ~~
.wsi12 0.061 0.056 1.091 0.275 0.082 0.082 RIad ~~
RIsi 0.139 0.050 2.802 0.005 0.578 0.578
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.308 0.033 9.310 0.000 0.308 0.280 .hyet7 0.214 0.028 7.641 0.000 0.214 0.241 .hyet10 0.152 0.024 6.435 0.000 0.152 0.206 .hyet12 0.150 0.025 6.090 0.000 0.150 0.195 .sisoet5 0.560 0.037 15.178 0.000 0.560 0.466 .sisoet7 0.558 0.038 14.830 0.000 0.558 0.455 .sisoet10 0.643 0.044 14.724 0.000 0.643 0.472 .sisoet12 0.656 0.044 14.943 0.000 0.656 0.500 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.194 0.061 3.167 0.002 1.000 1.000 RIsi 0.299 0.065 4.617 0.000 1.000 1.000 wad5 1.015 0.151 6.709 0.000 1.000 1.000 wsi5 1.145 0.176 6.504 0.000 1.000 1.000 .wad7 0.592 0.123 4.829 0.000 0.994 0.994 .wsi7 1.179 0.141 8.389 0.000 0.980 0.980 .wad10 0.352 0.085 4.138 0.000 0.991 0.991 .wsi10 1.541 0.221 6.958 0.000 0.986 0.986 .wad12 0.397 0.107 3.691 0.000 0.992 0.992 .wsi12 1.393 0.165 8.427 0.000 0.982 0.982 .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 [Male]:
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hyet5 1.000 0.613 0.379 hyet7 1.000 0.613 0.376 hyet10 1.000 0.613 0.420 hyet12 1.000 0.613 0.449 RIsi =~
sisoet5 1.000 0.607 0.465 sisoet7 1.000 0.607 0.430 sisoet10 1.000 0.607 0.393 sisoet12 1.000 0.607 0.379 wad5 =~
hyet5 1.000 1.495 0.925 wad7 =~
hyet7 1.000 1.509 0.926 wad10 =~
hyet10 1.000 1.325 0.908 wad12 =~
hyet12 1.000 1.221 0.894 wsi5 =~
sisoet5 1.000 1.154 0.885 wsi7 =~
sisoet7 1.000 1.275 0.903 wsi10 =~
sisoet10 1.000 1.421 0.920 wsi12 =~
sisoet12 1.000 1.483 0.926
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a2) 0.149 0.048 3.071 0.002 0.147 0.147 wsi5 (d2) 0.031 0.032 0.960 0.337 0.023 0.023 wsi7 ~
wad5 (c2) 0.110 0.034 3.276 0.001 0.130 0.130 wsi5 (b2) 0.179 0.056 3.208 0.001 0.162 0.162 wad10 ~
wad7 (a2) 0.149 0.048 3.071 0.002 0.169 0.169 wsi7 (d2) 0.031 0.032 0.960 0.337 0.029 0.029 wsi10 ~
wad7 (c2) 0.110 0.034 3.276 0.001 0.117 0.117 wsi7 (b2) 0.179 0.056 3.208 0.001 0.161 0.161 wad12 ~
wad10 (a2) 0.149 0.048 3.071 0.002 0.161 0.161 wsi10 (d2) 0.031 0.032 0.960 0.337 0.036 0.036 wsi12 ~
wad10 (c2) 0.110 0.034 3.276 0.001 0.099 0.099 wsi10 (b2) 0.179 0.056 3.208 0.001 0.172 0.172
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.431 0.120 3.584 0.000 0.250 0.250 .wad7 ~~
.wsi7 0.398 0.104 3.822 0.000 0.215 0.215 .wad10 ~~
.wsi10 0.528 0.122 4.327 0.000 0.292 0.292 .wad12 ~~
.wsi12 0.358 0.109 3.274 0.001 0.206 0.206 RIad ~~
RIsi 0.161 0.047 3.407 0.001 0.433 0.433
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.648 0.051 12.799 0.000 0.648 0.401 .hyet7 0.663 0.052 12.639 0.000 0.663 0.407 .hyet10 0.518 0.047 10.910 0.000 0.518 0.355 .hyet12 0.440 0.046 9.535 0.000 0.440 0.322 .sisoet5 0.690 0.041 16.954 0.000 0.690 0.529 .sisoet7 0.745 0.045 16.580 0.000 0.745 0.527 .sisoet10 0.832 0.051 16.271 0.000 0.832 0.538 .sisoet12 0.881 0.054 16.269 0.000 0.881 0.549 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.376 0.091 4.131 0.000 1.000 1.000 RIsi 0.368 0.085 4.313 0.000 1.000 1.000 wad5 2.236 0.261 8.562 0.000 1.000 1.000 wsi5 1.331 0.160 8.316 0.000 1.000 1.000 .wad7 2.222 0.239 9.316 0.000 0.976 0.976 .wsi7 1.538 0.185 8.314 0.000 0.946 0.946 .wad10 1.700 0.245 6.925 0.000 0.968 0.968 .wsi10 1.921 0.212 9.044 0.000 0.951 0.951 .wad12 1.446 0.225 6.435 0.000 0.969 0.969 .wsi12 2.091 0.243 8.611 0.000 0.950 0.950 .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
<- table.model.fit(RICLPMt_hyp.lag.c.fit.summary)
RICLPMt_hyp.lag.c.fit.summary.fit # Table of regression and correlation (standardised covariances) coefficients
<- table.model.coef(RICLPMt_hyp.lag.c.fit.summary, sex = "Female", constraints = "Yes")
RICLPMt_hyp.lag.c.fit.summary.reg.female <- table.model.coef(RICLPMt_hyp.lag.c.fit.summary, sex = "Male", constraints = "Yes") RICLPMt_hyp.lag.c.fit.summary.reg.male
<- '
RICLPMt_hyp.sex.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)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b, b)*wsi5
wad10 ~ c(a, a)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b, b)*wsi7
wad12 ~ c(a, a)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(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
'
<- lavaan(RICLPMt_hyp.sex.lag.c,
RICLPMt_hyp.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.lag.c.fit, method = "satorra.bentler.2010")
The chi-square difference test of these two nested models is non significant (p=0.3255) but this was significant when using non-robust statistics (p=0.01516).
<- '
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/fetales, group2/males) - different values across groups, but the same values within groups and across lags.
wad7 ~ c(a1, a2)*wad5 + c(d1, d2)*wsi5
wsi7 ~ c(c1, c2)*wad5 + c(b1,b2)*wsi5
wad10 ~ c(a1, a2)*wad7 + c(d1, d2)*wsi7
wsi10 ~ c(c1,c2)*wad7 + c(b1,b2)*wsi7
wad12 ~ c(a1, a2)*wad10 + c(d1,d2)*wsi10
wsi12 ~ c(c1,c2)*wad10 + c(b1,b2)*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
'
<- lavaan(RICLPMt_inat.lag.c,
RICLPMt_inat.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.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)*wad5 + c(d, d)*wsi5
wsi7 ~ c(c, c)*wad5 + c(b, b)*wsi5
wad10 ~ c(a, a)*wad7 + c(d, d)*wsi7
wsi10 ~ c(c, c)*wad7 + c(b, b)*wsi7
wad12 ~ c(a, a)*wad10 + c(d, d)*wsi10
wsi12 ~ c(c, c)*wad10 + c(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
'
<- lavaan(RICLPMt_inat.sex.lag.c,
RICLPMt_inat.sex.lag.c.fit data = dat,
missing = 'ML',
group = "sex",
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.sex.lag.c.fit, method = "satorra.bentler.2010")
The chi-square difference test of these two nested models is non significant (p=0.4818).
Work by Katherine N Thompson
katherine.n.thompson@kcl.ac.uk