[1] “familyid” “atwinid” “btwinid” “rorderp5” “torder”
[6] “risks” “cohort” “sampsex” “zygosity” “sisoe5”
[11] “sisoy5” “sisoet5” “sisoyt5” “sisoem5” “sisoym5”
[16] “inem5” “inym5” “hyem5” “hyym5” “inet5”
[21] “inyt5” “hyet5” “hyyt5” “tadhdem5” “tadhdym5”
[26] “tadhdet5” “tadhdyt5” “proem5” “proet5” “asbem5”
[31] “asbet5” “sethnic” “seswq35” “pe2m5” “pe4m5”
[36] “pe7m5” “pe11m5” “pe13m5” “pe25m5” “py2m5”
[41] “py4m5” “py7m5” “py11m5” “py13m5” “py25m5”
[46] “trf11e5” “trf19e5” “trf24e5” “trf30e5” “trf34e5”
[51] “trf77e5” “trf11y5” “trf19y5” “trf24y5” “trf30y5”
[56] “trf34y5” “trf77y5” “pe81m5” “pe82m5” “pe83m5”
[61] “pe86m5” “pe87m5” “pe88m5” “pe89m5” “pe90m5”
[66] “pe91m5” “py81m5” “py82m5” “py83m5” “py86m5”
[71] “py87m5” “py88m5” “py89m5” “py90m5” “py91m5”
[76] “trf89e5” “trf90e5” “trf91e5” “trf94e5” “trf95e5”
[81] “trf96e5” “trf97e5” “trf98e5” “trf99e5” “trf89y5”
[86] “trf90y5” “trf91y5” “trf94y5” “trf95y5” “trf96y5”
[91] “trf97y5” “trf98y5” “trf99y5” “pe84m5” “pe85m5”
[96] “pe96m5” “pe97m5” “pe92m5” “pe93m5” “pe94m5”
[101] “pe95m5” “pe64m5” “py84m5” “py85m5” “py96m5”
[106] “py97m5” “py92m5” “py93m5” “py94m5” “py95m5”
[111] “py64m5” “trf92e5” “trf93e5” “trf104e5” “trf105e5”
[116] “trf100e5” “trf101e5” “trf102e5” “trf103e5” “trf66e5”
[121] “trf92y5” “trf93y5” “trf104y5” “trf105y5” “trf100y5”
[126] “trf101y5” “trf102y5” “trf103y5” “trf66y5” “pe98m5”
[131] “pe99m5” “pe100m5” “pe101m5” “pe102m5” “pe103m5”
[136] “pe104m5” “pe105m5” “pe106m5” “pe107m5” “trf106e5”
[141] “trf107e5” “trf108e5” “trf109e5” “trf110e5” “trf111e5”
[146] “trf112e5” “trf113e5” “trf114e5” “trf115e5” “pe37m5”
[151] “pe38m5” “pe41m5” “pe42m5” “pe43m5” “pe44m5”
[156] “pe45m5” “pe46m5” “pe50m5” “pe53m5” “pe56m5”
[161] “pe58m5” “pe61m5” “pe62m5” “pe65m5” “pe66m5”
[166] “pe69m5” “pe47m5” “pe51m5” “pe52m5” “pe54m5”
[171] “pe55m5” “pe57m5” “pe59m5” “pe60m5” “pe63m5”
[176] “pe67m5” “pe68m5” “pe70m5” “pe71m5” “pe39m5”
[181] “pe40m5” “pe49m5” “pe72m5” “pe73m5” “pe74m5”
[186] “pe75m5” “pe76m5” “pe77m5” “pe78m5” “pe79m5”
[191] “pe80m5” “trf8e5” “trf9e5” “trf10e5” “trf13e5”
[196] “trf14e5” “trf15e5” “trf16e5” “trf17e5” “trf18e5”
[201] “trf21e5” “trf27e5” “trf38e5” “trf47e5” “trf50e5”
[206] “trf51e5” “trf54e5” “trf56e5” “trf57e5” “trf61e5”
[211] “trf62e5” “trf67e5” “trf68e5” “trf69e5” “trf74e5”
[216] “trf20e5” “trf29e5” “trf31e5” “trf48e5” “trf60e5”
[221] “trf65e5” “trf70e5” “trf71e5” “trf79e5” “trf80e5”
[226] “trf81e5” “trf82e5” “trf83e5” “trf84e5” “trf85e5”
[231] “trf86e5” “trf87e5” “trf88e5” “sisoe7” “sisoy7”
[236] “sisoet7” “sisoyt7” “sisoem7” “sisoym7” “inem7”
[241] “inym7” “hyem7” “hyym7” “inet7” “inyt7”
[246] “hyet7” “hyyt7” “tadhdem7” “tadhdym7” “tadhdet7”
[251] “tadhdyt7” “proem7” “proet7” “asbem7” “asbet7”
[256] “pe2m7” “pe4m7” “pe7m7” “pe11m7” “pe13m7”
[261] “pe25m7” “py2m7” “py4m7” “py7m7” “py11m7”
[266] “py13m7” “py25m7” “trf11e7” “trf19e7” “trf24e7”
[271] “trf30e7” “trf34e7” “trf77e7” “trf11y7” “trf19y7”
[276] “trf24y7” “trf30y7” “trf34y7” “trf77y7” “pe81m7”
[281] “pe82m7” “pe83m7” “pe86m7” “pe87m7” “pe88m7”
[286] “pe89m7” “pe90m7” “pe91m7” “py81m7” “py82m7”
[291] “py83m7” “py86m7” “py87m7” “py88m7” “py89m7”
[296] “py90m7” “py91m7” “trf89e7” “trf90e7” “trf91e7”
[301] “trf94e7” “trf95e7” “trf96e7” “trf97e7” “trf98e7”
[306] “trf99e7” “trf89y7” “trf90y7” “trf91y7” “trf94y7”
[311] “trf95y7” “trf96y7” “trf97y7” “trf98y7” “trf99y7”
[316] “pe84m7” “pe85m7” “pe96m7” “pe97m7” “pe92m7”
[321] “pe93m7” “pe94m7” “pe95m7” “pe64m7” “py84m7”
[326] “py85m7” “py96m7” “py97m7” “py92m7” “py93m7”
[331] “py94m7” “py95m7” “py64m7” “trf92e7” “trf93e7”
[336] “trf104e7” “trf105e7” “trf100e7” “trf101e7” “trf102e7”
[341] “trf103e7” “trf66e7” “trf92y7” “trf93y7” “trf104y7”
[346] “trf105y7” “trf100y7” “trf101y7” “trf102y7” “trf103y7”
[351] “trf66y7” “pe98m7” “pe99m7” “pe100m7” “pe101m7”
[356] “pe102m7” “pe103m7” “pe104m7” “pe105m7” “pe106m7”
[361] “pe107m7” “trf106e7” “trf107e7” “trf108e7” “trf109e7”
[366] “trf110e7” “trf111e7” “trf112e7” “trf113e7” “trf114e7”
[371] “trf115e7” “pe37m7” “pe38m7” “pe41m7” “pe42m7”
[376] “pe43m7” “pe44m7” “pe45m7” “pe46m7” “pe50m7”
[381] “pe53m7” “pe56m7” “pe58m7” “pe61m7” “pe62m7”
[386] “pe65m7” “pe66m7” “pe69m7” “pe47m7” “pe51m7”
[391] “pe52m7” “pe54m7” “pe55m7” “pe57m7” “pe59m7”
[396] “pe60m7” “pe63m7” “pe67m7” “pe68m7” “pe70m7”
[401] “pe71m7” “pe39m7” “pe40m7” “pe49m7” “pe72m7”
[406] “pe73m7” “pe74m7” “pe75m7” “pe76m7” “pe77m7”
[411] “pe78m7” “pe79m7” “pe80m7” “trf8e7” “trf9e7”
[416] “trf10e7” “trf13e7” “trf14e7” “trf15e7” “trf16e7”
[421] “trf17e7” “trf18e7” “trf21e7” “trf27e7” “trf38e7”
[426] “trf47e7” “trf50e7” “trf51e7” “trf54e7” “trf56e7”
[431] “trf57e7” “trf61e7” “trf62e7” “trf67e7” “trf68e7”
[436] “trf69e7” “trf74e7” “trf20e7” “trf29e7” “trf31e7”
[441] “trf48e7” “trf60e7” “trf65e7” “trf70e7” “trf71e7”
[446] “trf79e7” “trf80e7” “trf81e7” “trf82e7” “trf83e7”
[451] “trf84e7” “trf85e7” “trf86e7” “trf87e7” “trf88e7”
[456] “sisoe10” “sisoy10” “sisoet10” “sisoyt10” “sisoem10”
[461] “sisoym10” “inem10” “inym10” “hyem10” “hyym10”
[466] “inet10” “inyt10” “hyet10” “hyyt10” “tadhdem10” [471] “tadhdym10” “tadhdet10” “tadhdyt10” “proem10” “proet10”
[476] “asbem10” “asbet10” “pe70m10” “pe2m10” “pe4m10”
[481] “pe7m10” “pe11m10” “pe13m10” “pe25m10” “py2m10”
[486] “py4m10” “py7m10” “py11m10” “py13m10” “py25m10”
[491] “trf11e10” “trf19e10” “trf24e10” “trf30e10” “trf34e10”
[496] “trf77e10” “trf11y10” “trf19y10” “trf24y10” “trf30y10”
[501] “trf34y10” “trf77y10” “pe81m10” “pe82m10” “pe83m10”
[506] “pe86m10” “pe87m10” “pe88m10” “pe89m10” “pe90m10”
[511] “pe91m10” “py81m10” “py82m10” “py83m10” “py86m10”
[516] “py87m10” “py88m10” “py89m10” “py90m10” “py91m10”
[521] “trf89e10” “trf90e10” “trf91e10” “trf94e10” “trf95e10”
[526] “trf96e10” “trf97e10” “trf98e10” “trf99e10” “trf89y10”
[531] “trf90y10” “trf91y10” “trf94y10” “trf95y10” “trf96y10”
[536] “trf97y10” “trf98y10” “trf99y10” “pe84m10” “pe85m10”
[541] “pe96m10” “pe97m10” “pe92m10” “pe93m10” “pe94m10”
[546] “pe95m10” “pe64m10” “py84m10” “py85m10” “py96m10”
[551] “py97m10” “py92m10” “py93m10” “py94m10” “py95m10”
[556] “py64m10” “trf92e10” “trf93e10” “trf104e10” “trf105e10” [561] “trf100e10” “trf101e10” “trf102e10” “trf103e10” “trf66e10”
[566] “trf92y10” “trf93y10” “trf104y10” “trf105y10” “trf100y10” [571] “trf101y10” “trf102y10” “trf103y10” “trf66y10” “pe98m10”
[576] “pe99m10” “pe100m10” “pe101m10” “pe102m10” “pe103m10”
[581] “pe104m10” “pe105m10” “pe106m10” “pe107m10” “trf106e10” [586] “trf107e10” “trf108e10” “trf109e10” “trf110e10” “trf111e10” [591] “trf112e10” “trf113e10” “trf114e10” “trf115e10” “pe37m10”
[596] “pe38m10” “pe41m10” “pe42m10” “pe43m10” “pe44m10”
[601] “pe45m10” “pe46m10” “pe50m10” “pe53m10” “pe56m10”
[606] “pe58m10” “pe61m10” “pe62m10” “pe65m10” “pe66m10”
[611] “pe69m10” “pe47m10” “pe51m10” “pe52m10” “pe54m10”
[616] “pe55m10” “pe57m10” “pe59m10” “pe60m10” “pe63m10”
[621] “pe67m10” “pe68m10” “pe71m10” “pe39m10” “pe40m10”
[626] “pe49m10” “pe72m10” “pe73m10” “pe74m10” “pe75m10”
[631] “pe76m10” “pe77m10” “pe78m10” “pe79m10” “pe80m10”
[636] “trf8e10” “trf9e10” “trf10e10” “trf13e10” “trf14e10”
[641] “trf15e10” “trf16e10” “trf17e10” “trf18e10” “trf21e10”
[646] “trf27e10” “trf38e10” “trf47e10” “trf50e10” “trf51e10”
[651] “trf54e10” “trf56e10” “trf57e10” “trf61e10” “trf62e10”
[656] “trf67e10” “trf68e10” “trf69e10” “trf74e10” “trf20e10”
[661] “trf29e10” “trf31e10” “trf48e10” “trf60e10” “trf65e10”
[666] “trf70e10” “trf71e10” “trf79e10” “trf80e10” “trf81e10”
[671] “trf82e10” “trf83e10” “trf84e10” “trf85e10” “trf86e10”
[676] “trf87e10” “trf88e10” “sisoe12” “sisoy12” “sisoet12”
[681] “sisoyt12” “sisoem12” “sisoym12” “inem12” “inym12”
[686] “hyem12” “hyym12” “inet12” “inyt12” “hyet12”
[691] “hyyt12” “tadhdem12” “tadhdym12” “tadhdet12” “tadhdyt12” [696] “pe70m12” “bullseve12” “proem12” “proet12” “asbem12”
[701] “asbet12” “pe2m12” “pe4m12” “pe7m12” “pe11m12”
[706] “pe13m12” “pe25m12” “py2m12” “py4m12” “py7m12”
[711] “py11m12” “py13m12” “py25m12” “trf11e12” “trf19e12”
[716] “trf24e12” “trf30e12” “trf34e12” “trf77e12” “trf11y12”
[721] “trf19y12” “trf24y12” “trf30y12” “trf34y12” “trf77y12”
[726] “pe81m12” “pe82m12” “pe83m12” “pe86m12” “pe87m12”
[731] “pe88m12” “pe89m12” “pe90m12” “pe91m12” “py81m12”
[736] “py82m12” “py83m12” “py86m12” “py87m12” “py88m12”
[741] “py89m12” “py90m12” “py91m12” “trf89e12” “trf90e12”
[746] “trf91e12” “trf94e12” “trf95e12” “trf96e12” “trf97e12”
[751] “trf98e12” “trf99e12” “trf89y12” “trf90y12” “trf91y12”
[756] “trf94y12” “trf95y12” “trf96y12” “trf97y12” “trf98y12”
[761] “trf99y12” “pe84m12” “pe85m12” “pe96m12” “pe97m12”
[766] “pe92m12” “pe93m12” “pe94m12” “pe95m12” “pe64m12”
[771] “py84m12” “py85m12” “py96m12” “py97m12” “py92m12”
[776] “py93m12” “py94m12” “py95m12” “py64m12” “trf92e12”
[781] “trf93e12” “trf104e12” “trf105e12” “trf100e12” “trf101e12” [786] “trf102e12” “trf103e12” “trf66e12” “trf92y12” “trf93y12”
[791] “trf104y12” “trf105y12” “trf100y12” “trf101y12” “trf102y12” [796] “trf103y12” “trf66y12” “pe98m12” “pe99m12” “pe100m12”
[801] “pe101m12” “pe102m12” “pe103m12” “pe104m12” “pe105m12”
[806] “pe106m12” “pe107m12” “trf106e12” “trf107e12” “trf108e12” [811] “trf109e12” “trf110e12” “trf111e12” “trf112e12” “trf113e12” [816] “trf114e12” “trf115e12” “pe37m12” “pe38m12” “pe41m12”
[821] “pe42m12” “pe43m12” “pe44m12” “pe45m12” “pe46m12”
[826] “pe50m12” “pe53m12” “pe56m12” “pe58m12” “pe61m12”
[831] “pe62m12” “pe65m12” “pe66m12” “pe69m12” “pe47m12”
[836] “pe51m12” “pe52m12” “pe54m12” “pe55m12” “pe57m12”
[841] “pe59m12” “pe60m12” “pe63m12” “pe67m12” “pe68m12”
[846] “pe71m12” “pe39m12” “pe40m12” “pe49m12” “pe72m12”
[851] “pe73m12” “pe74m12” “pe75m12” “pe76m12” “pe77m12”
[856] “pe78m12” “pe79m12” “pe80m12” “trf8e12” “trf9e12”
[861] “trf10e12” “trf13e12” “trf14e12” “trf15e12” “trf16e12”
[866] “trf17e12” “trf18e12” “trf21e12” “trf27e12” “trf38e12”
[871] “trf47e12” “trf50e12” “trf51e12” “trf54e12” “trf56e12”
[876] “trf57e12” “trf61e12” “trf62e12” “trf67e12” “trf68e12”
[881] “trf69e12” “trf74e12” “trf20e12” “trf29e12” “trf31e12”
[886] “trf48e12” “trf60e12” “trf65e12” “trf70e12” “trf71e12”
[891] “trf79e12” “trf80e12” “trf81e12” “trf82e12” “trf83e12”
[896] “trf84e12” “trf85e12” “trf86e12” “trf87e12” “trf88e12”
[901] “str05ec12” “str13ec12” “str15ec12” “str17ec12” “trf2e12”
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, # social isolation combined report
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”
# 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, rmsea.robust, rmsea.ci.lower.robust, rmsea.ci.upper.robust, srmr)
return(model.fit)
}
# Table of regression and correlation (standardised covariance) coefficients
table.model.coef <- function(model, step){
if (step == "S1"){
model.coef <- as.tibble(model$PE[c(1:27,64:67),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
return(model.coef)
} else if(step == "S2"){
model.coef <- as.tibble(model$PE[c(1:27,64,65),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
return(model.coef)
} else if(step == "S3"){
model.coef <- as.tibble(model$PE[c(25:51,121:124),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
return(model.coef)
} else if(step == "S4"){
model.coef <- as.tibble(model$PE[c(25:51,121,122),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
return(model.coef)
} else {model.coef <- NULL}
}
For all mediation analyses we will use mother and teacher report combined scores. Models will then be split into total ADHD score, hyperactivity, and inattention.
Before running the mediation models, we need to create several variables: * Combined (averaged) parent and teacher report for total ADHD, hyperactivity, and inattention at each age * Combined (averaged) parent and teacher report for prosocial behaviour at each age * Combined (averaged) parent and teacher report for antisocial behaviour at each age
# 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)))))
)
# 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)))))
)
# 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)))))
)
# items
items <- c("proe5",
"asbe5",
"proe7",
"asbe7",
"proe10",
"asbe10",
"proe12",
"asbe12",
"proem5",
"asbem5",
"proem7",
"asbem7",
"proem10",
"asbem10",
"proem12",
"asbem12",
"proet5",
"asbet5",
"proet7",
"asbet7",
"proet10",
"asbet10",
"proet12",
"asbet12")
# create data frame
items.df <- as.data.frame(dat[,items])
is.data.frame(items.df) #check
[1] TRUE
colnames(items.df) <- c("Combined Prosocial behaviour age 5",
"Combined Antisocial behaviour age 5",
"Combined Prosocial behaviour age 7",
"Combined Antisocial behaviour age 7",
"Combined Prosocial behaviour age 10",
"Combined Antisocial behaviour age 10",
"Combined Prosocial behaviour age 12",
"Combined Antisocial behaviour age 12",
"Mother Prosocial behaviour age 5",
"Mother Antisocial behaviour age 5",
"Mother Prosocial behaviour age 7",
"Mother Antisocial behaviour age 7",
"Mother Prosocial behaviour age 10",
"Mother Antisocial behaviour age 10",
"Mother Prosocial behaviour age 12",
"Mother Antisocial behaviour age 12",
"Teacher Prosocial behaviour age 5",
"Teacher Antisocial behaviour age 5",
"Teacher Prosocial behaviour age 7",
"Teacher Antisocial behaviour age 7",
"Teacher Prosocial behaviour age 10",
"Teacher Antisocial behaviour age 10",
"Teacher Prosocial behaviour age 12",
"Teacher Antisocial behaviour age 12"
)
item.cor.matrix <- cor(items.df,
method = "pearson",
use = "pairwise.complete.obs")
as.data.frame(item.cor.matrix) %>% mutate_if(is.numeric, round, 2)
as.data.frame(item.cor.matrix) %>% mutate_if(is.numeric, round, 2) %>% select(`Mother Antisocial behaviour age 12`)
For each set of ADHD symptoms, we present four models for each mediator (prosocial/antisocial behvaiour): * Step 1: CLPM mediation model - rather than two variables, we now have three and can calculate the mediation path * Step 2: Constrained CLPM mediation model - crosslags will be constrained over time * Step 3: RICLPM mediation model - add in random intercepts to create a three variable RI-CLPM where the mediation path is calculated whilst accounting for between person differences * Step 4: Constrained RI-CLPM mediation model - crosslags will be constrained over time.
We have established the direction of the association - ADHD predicts later social isolation. Therefore the two mediator paths are (for example): 1. proem7 ~ a1*tadhdem5
and sisoem10 ~ b1*proem7
, 2. proem10 ~ a2*tadhdem7
and sisoem12 ~ b2*proem10
. This indirect mediation effect is then calculated using indirect1 := a*b
. Using the constrained model, the two mediation paths will also be constrained to be equal, resulting in one a*b path.
To test the bidirectional mediation, we also calculated the mediator path (for example): 1. proem7 ~ c1*sisoem5
and tadhdem10 ~ d1*proem7
, 2. proem10 ~ c2*sisoem7
and tadhdem12 ~ d2*proem10
. This indirect mediation effect is then calculated using indirect2 := c*d
.
Our code could be synthesized further by combining regression paths, however aid clarity of which paths have been estimated all path coefficients are written out in full.
The “direct c paths” have not been estimated here. Therefore, for all models, the effects from age 5 have to go through age 7/10 and are not directly associated with age 12.
Model notation is as follows: * med = mediation model * long = longitudinal * pro = prosocial * asb = antisocial * hyp = hyperactivity * inat = inattention * ri = random intercepts
med.long.pro <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Pro social bahviour
proe7 ~ proe5
proe10 ~ proe7
proe12 ~ proe10
## ADHD
tadhde7 ~ tadhde5
tadhde10 ~ tadhde7
tadhde12 ~ tadhde10
###### Cross lag paths ######
## Isolation
tadhde7 ~ sisoe5
tadhde10 ~ sisoe7
tadhde12 ~ sisoe10
## ADHD
sisoe7 ~ tadhde5
sisoe10 ~ tadhde7
sisoe12 ~ tadhde10
## Prosocial
sisoe7 ~ proe5
tadhde7 ~ proe5
proe12 ~ sisoe10
proe12 ~ tadhde10
###### Mediation paths ######
## ADHD to Isolation
proe7 ~ a1*tadhde5
sisoe10 ~ b1*proe7
proe10 ~ a2*tadhde7
sisoe12 ~ b2*proe10
## Isolation to ADHD
proe7 ~ c1*sisoe5
tadhde10 ~ d1*proe7
proe10 ~ c2*sisoe7
tadhde12 ~ d2*proe10
###### Covariances ######
sisoe5 ~~ proe5
proe5 ~~ tadhde5
sisoe5 ~~ tadhde5
sisoe7 ~~ proe7
proe7 ~~ tadhde7
sisoe7 ~~ tadhde7
sisoe10 ~~ proe10
proe10 ~~ tadhde10
sisoe10 ~~ tadhde10
sisoe12 ~~ proe12
proe12 ~~ tadhde12
sisoe12 ~~ tadhde12
###### Variances ######
## Variances
tadhde5 ~~ tadhde5
sisoe5 ~~ sisoe5
proe5 ~~ proe5
## Residual variances
tadhde7 ~~ tadhde7
sisoe7 ~~ sisoe7
proe7 ~~ proe7
tadhde10 ~~ tadhde10
sisoe10 ~~ sisoe10
proe10 ~~ proe10
tadhde12 ~~ tadhde12
sisoe12 ~~ sisoe12
proe12 ~~ proe12
###### Indirect effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
med.long.pro.fit <- lavaan(model = med.long.pro,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med.long.pro.fit.summary <- summary(med.long.pro.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 115 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 564.569 406.472 Degrees of freedom 27 27 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.389 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 8442.398 5457.612 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.547
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.936 0.930 Tucker-Lewis Index (TLI) 0.843 0.828
Robust Comparative Fit Index (CFI) 0.937 Robust Tucker-Lewis Index (TLI) 0.846
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -53357.833 -53357.833 Scaling correction factor 1.900 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.747 for the MLR correction
Akaike (AIC) 106841.666 106841.666 Bayesian (BIC) 107201.437 107201.437 Sample-size adjusted Bayesian (BIC) 107001.276 107001.276
Root Mean Square Error of Approximation:
RMSEA 0.094 0.079 90 Percent confidence interval - lower 0.088 0.074 90 Percent confidence interval - upper 0.101 0.085 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.094 90 Percent confidence interval - lower 0.086 90 Percent confidence interval - upper 0.102
Standardized Root Mean Square Residual:
SRMR 0.058 0.058
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.439 0.043 10.195 0.000 0.439 0.423 sisoe10 ~
sisoe7 0.475 0.037 12.752 0.000 0.475 0.431 sisoe12 ~
sisoe10 0.557 0.033 16.952 0.000 0.557 0.526 proe7 ~
proe5 0.376 0.022 17.392 0.000 0.376 0.375 proe10 ~
proe7 0.323 0.022 14.696 0.000 0.323 0.342 proe12 ~
proe10 0.391 0.026 15.169 0.000 0.391 0.366 tadhde7 ~
tadhde5 0.526 0.027 19.584 0.000 0.526 0.560 tadhde10 ~
tadhde7 0.500 0.031 16.078 0.000 0.500 0.523 tadhde12 ~
tadhde10 0.640 0.035 18.436 0.000 0.640 0.622 tadhde7 ~
sisoe5 0.070 0.059 1.187 0.235 0.070 0.031 tadhde10 ~
sisoe7 0.089 0.068 1.317 0.188 0.089 0.042 tadhde12 ~
sisoe10 -0.004 0.047 -0.086 0.931 -0.004 -0.002 sisoe7 ~
tadhde5 0.049 0.011 4.636 0.000 0.049 0.115 sisoe10 ~
tadhde7 0.068 0.014 4.964 0.000 0.068 0.135 sisoe12 ~
tadhde10 0.066 0.014 4.777 0.000 0.066 0.119 sisoe7 ~
proe5 -0.039 0.008 -4.785 0.000 -0.039 -0.107 tadhde7 ~
proe5 -0.064 0.016 -4.075 0.000 -0.064 -0.079 proe12 ~
sisoe10 -0.208 0.065 -3.173 0.002 -0.208 -0.082 tadhde10 -0.120 0.030 -3.961 0.000 -0.120 -0.091 proe7 ~
tadhde5 (a1) -0.117 0.026 -4.495 0.000 -0.117 -0.099 sisoe10 ~
proe7 (b1) -0.015 0.009 -1.757 0.079 -0.015 -0.038 proe10 ~
tadhde7 (a2) -0.116 0.028 -4.128 0.000 -0.116 -0.098 sisoe12 ~
proe10 (b2) -0.006 0.009 -0.727 0.467 -0.006 -0.014 proe7 ~
sisoe5 (c1) -0.198 0.072 -2.741 0.006 -0.198 -0.069 tadhde10 ~
proe7 (d1) -0.070 0.016 -4.238 0.000 -0.070 -0.091 proe10 ~
sisoe7 (c2) -0.181 0.065 -2.805 0.005 -0.181 -0.070 tadhde12 ~
proe10 (d2) -0.064 0.017 -3.792 0.000 -0.064 -0.076
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
proe5 -0.936 0.101 -9.315 0.000 -0.936 -0.256 proe5 ~~
tadhde5 -2.275 0.241 -9.438 0.000 -2.275 -0.255 sisoe5 ~~
tadhde5 1.152 0.128 8.998 0.000 1.152 0.368 .sisoe7 ~~
.proe7 -0.551 0.076 -7.268 0.000 -0.551 -0.188 .proe7 ~~
.tadhde7 -0.881 0.144 -6.119 0.000 -0.881 -0.145 .sisoe7 ~~
.tadhde7 0.525 0.074 7.115 0.000 0.525 0.251 .sisoe10 ~~
.proe10 -0.724 0.081 -8.905 0.000 -0.724 -0.233 .proe10 ~~
.tadhde10 -0.997 0.160 -6.228 0.000 -0.997 -0.175 .sisoe10 ~~
.tadhde10 0.637 0.084 7.556 0.000 0.637 0.281 .sisoe12 ~~
.proe12 -0.595 0.086 -6.914 0.000 -0.595 -0.182 .proe12 ~~
.tadhde12 -0.694 0.152 -4.560 0.000 -0.694 -0.121 .sisoe12 ~~
.tadhde12 0.601 0.089 6.791 0.000 0.601 0.278
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.917 0.135 6.767 0.000 0.917 0.779 .sisoe10 0.645 0.141 4.578 0.000 0.645 0.498 .sisoe12 0.413 0.147 2.805 0.005 0.413 0.301 .proe7 9.757 0.349 27.939 0.000 9.757 3.007 .proe10 11.178 0.357 31.348 0.000 11.178 3.648 .proe12 9.508 0.442 21.532 0.000 9.508 2.903 .tadhde7 1.473 0.253 5.820 0.000 1.473 0.567 .tadhde10 1.608 0.275 5.839 0.000 1.608 0.648 .tadhde12 1.447 0.286 5.055 0.000 1.447 0.566 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 proe5 14.127 0.068 206.791 0.000 14.127 4.377 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 7.641 0.397 19.265 0.000 7.641 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 proe5 10.417 0.320 32.602 0.000 10.417 1.000 .tadhde7 4.329 0.238 18.219 0.000 4.329 0.643 .sisoe7 1.012 0.061 16.597 0.000 1.012 0.731 .proe7 8.502 0.239 35.516 0.000 8.502 0.808 .tadhde10 4.139 0.263 15.741 0.000 4.139 0.672 .sisoe10 1.242 0.076 16.364 0.000 1.242 0.739 .proe10 7.805 0.266 29.298 0.000 7.805 0.831 .tadhde12 3.794 0.275 13.817 0.000 3.794 0.581 .sisoe12 1.231 0.080 15.353 0.000 1.231 0.654 .proe12 8.659 0.291 29.785 0.000 8.659 0.807
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1a 0.002 0.001 1.626 0.104 0.002 0.004 indirect1b 0.001 0.001 0.709 0.478 0.001 0.001 indirect2a 0.014 0.006 2.227 0.026 0.014 0.006 indirect2b 0.012 0.005 2.382 0.017 0.012 0.005
med.long2.pro <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Pro social bahviour
proe7 ~ proe5
proe10 ~ proe7
proe12 ~ proe10
## ADHD
tadhde7 ~ tadhde5
tadhde10 ~ tadhde7
tadhde12 ~ tadhde10
###### Cross lag paths ######
## Isolation
tadhde7 ~ e*sisoe5
tadhde10 ~ e*sisoe7
tadhde12 ~ e*sisoe10
## ADHD
sisoe7 ~ f*tadhde5
sisoe10 ~ f*tadhde7
sisoe12 ~ f*tadhde10
## Prosocial
sisoe7 ~ b*proe5
tadhde7 ~ d*proe5
proe12 ~ c*sisoe10
proe12 ~ a*tadhde10
###### Mediation paths ######
## ADHD to Isolation
proe7 ~ a*tadhde5
sisoe10 ~ b*proe7
proe10 ~ a*tadhde7
sisoe12 ~ b*proe10
## Isolation to ADHD
proe7 ~ c*sisoe5
tadhde10 ~ d*proe7
proe10 ~ c*sisoe7
tadhde12 ~ d*proe10
###### Covariances ######
sisoe5 ~~ proe5
proe5 ~~ tadhde5
sisoe5 ~~ tadhde5
sisoe7 ~~ proe7
proe7 ~~ tadhde7
sisoe7 ~~ tadhde7
sisoe10 ~~ proe10
proe10 ~~ tadhde10
sisoe10 ~~ tadhde10
sisoe12 ~~ proe12
proe12 ~~ tadhde12
sisoe12 ~~ tadhde12
###### Variances ######
## Variances
tadhde5 ~~ tadhde5
sisoe5 ~~ sisoe5
proe5 ~~ proe5
## Residual variances
tadhde7 ~~ tadhde7
sisoe7 ~~ sisoe7
proe7 ~~ proe7
tadhde10 ~~ tadhde10
sisoe10 ~~ sisoe10
proe10 ~~ proe10
tadhde12 ~~ tadhde12
sisoe12 ~~ sisoe12
proe12 ~~ proe12
###### Indirect effects (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
med.long2.pro.fit <- lavaan(model = med.long2.pro,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med.long2.pro.fit.summary <- summary(med.long2.pro.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 87 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 580.852 411.337 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.412 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 8442.398 5457.612 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.547
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.935 0.931 Tucker-Lewis Index (TLI) 0.891 0.883
Robust Comparative Fit Index (CFI) 0.937 Robust Tucker-Lewis Index (TLI) 0.893
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -53365.974 -53365.974 Scaling correction factor 1.621 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.747 for the MLR correction
Akaike (AIC) 106833.948 106833.948 Bayesian (BIC) 107125.191 107125.191 Sample-size adjusted Bayesian (BIC) 106963.156 106963.156
Root Mean Square Error of Approximation:
RMSEA 0.079 0.065 90 Percent confidence interval - lower 0.073 0.061 90 Percent confidence interval - upper 0.085 0.070 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.078 90 Percent confidence interval - lower 0.071 90 Percent confidence interval - upper 0.085
Standardized Root Mean Square Residual:
SRMR 0.059 0.059
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.440 0.041 10.757 0.000 0.440 0.424 sisoe10 ~
sisoe7 0.472 0.033 14.138 0.000 0.472 0.429 sisoe12 ~
sisoe10 0.556 0.030 18.350 0.000 0.556 0.522 proe7 ~
proe5 0.370 0.020 18.102 0.000 0.370 0.369 proe10 ~
proe7 0.323 0.020 15.847 0.000 0.323 0.341 proe12 ~
proe10 0.400 0.025 16.314 0.000 0.400 0.374 tadhde7 ~
tadhde5 0.531 0.026 20.727 0.000 0.531 0.565 tadhde10 ~
tadhde7 0.505 0.028 17.922 0.000 0.505 0.531 tadhde12 ~
tadhde10 0.628 0.034 18.665 0.000 0.628 0.609 tadhde7 ~
sisoe5 (e) 0.046 0.029 1.562 0.118 0.046 0.020 tadhde10 ~
sisoe7 (e) 0.046 0.029 1.562 0.118 0.046 0.022 tadhde12 ~
sisoe10 (e) 0.046 0.029 1.562 0.118 0.046 0.023 sisoe7 ~
tadhde5 (f) 0.059 0.007 8.365 0.000 0.059 0.139 sisoe10 ~
tadhde7 (f) 0.059 0.007 8.365 0.000 0.059 0.119 sisoe12 ~
tadhde10 (f) 0.059 0.007 8.365 0.000 0.059 0.106 sisoe7 ~
proe5 (b) -0.022 0.005 -4.605 0.000 -0.022 -0.062 tadhde7 ~
proe5 (d) -0.067 0.010 -6.948 0.000 -0.067 -0.083 proe12 ~
sisoe10 (c) -0.193 0.037 -5.184 0.000 -0.193 -0.076 tadhde10 (a) -0.117 0.016 -7.212 0.000 -0.117 -0.088 proe7 ~
tadhde5 (a) -0.117 0.016 -7.212 0.000 -0.117 -0.100 sisoe10 ~
proe7 (b) -0.022 0.005 -4.605 0.000 -0.022 -0.056 proe10 ~
tadhde7 (a) -0.117 0.016 -7.212 0.000 -0.117 -0.099 sisoe12 ~
proe10 (b) -0.022 0.005 -4.605 0.000 -0.022 -0.050 proe7 ~
sisoe5 (c) -0.193 0.037 -5.184 0.000 -0.193 -0.068 tadhde10 ~
proe7 (d) -0.067 0.010 -6.948 0.000 -0.067 -0.087 proe10 ~
sisoe7 (c) -0.193 0.037 -5.184 0.000 -0.193 -0.074 tadhde12 ~
proe10 (d) -0.067 0.010 -6.948 0.000 -0.067 -0.080
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
proe5 -0.936 0.101 -9.315 0.000 -0.936 -0.256 proe5 ~~
tadhde5 -2.275 0.241 -9.438 0.000 -2.275 -0.255 sisoe5 ~~
tadhde5 1.152 0.128 8.998 0.000 1.152 0.368 .sisoe7 ~~
.proe7 -0.552 0.076 -7.246 0.000 -0.552 -0.188 .proe7 ~~
.tadhde7 -0.881 0.144 -6.112 0.000 -0.881 -0.145 .sisoe7 ~~
.tadhde7 0.524 0.074 7.087 0.000 0.524 0.250 .sisoe10 ~~
.proe10 -0.723 0.081 -8.892 0.000 -0.723 -0.232 .proe10 ~~
.tadhde10 -0.996 0.160 -6.213 0.000 -0.996 -0.175 .sisoe10 ~~
.tadhde10 0.638 0.085 7.539 0.000 0.638 0.281 .sisoe12 ~~
.proe12 -0.596 0.086 -6.911 0.000 -0.596 -0.182 .proe12 ~~
.tadhde12 -0.693 0.152 -4.555 0.000 -0.693 -0.121 .sisoe12 ~~
.tadhde12 0.602 0.089 6.786 0.000 0.602 0.278
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.658 0.084 7.793 0.000 0.658 0.560 .sisoe10 0.769 0.083 9.274 0.000 0.769 0.595 .sisoe12 0.674 0.084 7.976 0.000 0.674 0.490 .proe7 9.842 0.314 31.340 0.000 9.842 3.042 .proe10 11.194 0.321 34.894 0.000 11.194 3.652 .proe12 9.344 0.405 23.058 0.000 9.344 2.847 .tadhde7 1.525 0.160 9.547 0.000 1.525 0.587 .tadhde10 1.591 0.165 9.663 0.000 1.591 0.643 .tadhde12 1.469 0.171 8.565 0.000 1.469 0.575 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 proe5 14.127 0.068 206.791 0.000 14.127 4.377 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 7.641 0.397 19.265 0.000 7.641 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 proe5 10.417 0.320 32.602 0.000 10.417 1.000 .tadhde7 4.331 0.238 18.217 0.000 4.331 0.641 .sisoe7 1.015 0.061 16.567 0.000 1.015 0.736 .proe7 8.501 0.239 35.507 0.000 8.501 0.812 .tadhde10 4.141 0.264 15.705 0.000 4.141 0.676 .sisoe10 1.243 0.076 16.377 0.000 1.243 0.744 .proe10 7.804 0.266 29.323 0.000 7.804 0.831 .tadhde12 3.798 0.275 13.823 0.000 3.798 0.582 .sisoe12 1.233 0.081 15.312 0.000 1.233 0.651 .proe12 8.660 0.290 29.817 0.000 8.660 0.804
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1 0.003 0.001 3.941 0.000 0.003 0.005 indirect2 0.013 0.003 4.322 0.000 0.013 0.006
The cross-lag constraints gave a non-significant loss in model fit (p=0.5204). Therefore this model 2 will be carried forward.
# Model fit
med.long2.pro.fit.summary.fit <- table.model.fit(med.long2.pro.fit.summary)
# Coefficients
med.long2.pro.fit.summary.reg <- table.model.coef(model = med.long2.pro.fit.summary, step = "S2") %>% mutate_if(is.numeric, round, 3)
med.long2.pro.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue)
ri.med.long.pro.full <- '
###### 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 ~ wsi5
wad10 ~ wsi7
wad12 ~ wsi10
## ADHD
wsi7 ~ wad5
wsi10 ~ wad7
wsi12 ~ wad10
## Prosocial
wsi7 ~ wpro5
wad7 ~ wpro5
wpro12 ~ wsi10
wpro12 ~ wad10
###### Mediation paths ######
## ADHD to Isolation
wpro7 ~ a1*wad5
wsi10 ~ b1*wpro7
wpro10 ~ a2*wad7
wsi12 ~ b2*wpro10
## Isolation to ADHD
wpro7 ~ wsi5
wad10 ~ wpro7
wpro10 ~ wsi7
wad12 ~ 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) ######
indirect1 := a1*b1
indirect2 := a2*b2
'
ri.med.long.pro.full.fit <- lavaan(model = ri.med.long.pro.full,
data = dat,
missing = 'ML',
meanstructure = TRUE,
se = "robust",
int.ov.free = TRUE,
estimator = "MLR")
ri.med.long.pro.full.fit.summary <- summary(ri.med.long.pro.full.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 159 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 82.015 62.233 Degrees of freedom 21 21 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.318 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 8442.398 5457.612 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.547
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.993 0.992 Tucker-Lewis Index (TLI) 0.977 0.976
Robust Comparative Fit Index (CFI) 0.993 Robust Tucker-Lewis Index (TLI) 0.980
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -53116.556 -53116.556 Scaling correction factor 1.878 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.747 for the MLR correction
Akaike (AIC) 106371.111 106371.111 Bayesian (BIC) 106765.146 106765.146 Sample-size adjusted Bayesian (BIC) 106545.922 106545.922
Root Mean Square Error of Approximation:
RMSEA 0.036 0.030 90 Percent confidence interval - lower 0.028 0.022 90 Percent confidence interval - upper 0.044 0.037 P-value RMSEA <= 0.05 0.997 1.000
Robust RMSEA 0.034 90 Percent confidence interval - lower 0.024 90 Percent confidence interval - upper 0.044
Standardized Root Mean Square Residual:
SRMR 0.025 0.025
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.788 0.641 tadhde7 1.000 1.788 0.698 tadhde10 1.000 1.788 0.718 tadhde12 1.000 1.788 0.706 RIsi =~
sisoe5 1.000 0.678 0.591 sisoe7 1.000 0.678 0.579 sisoe10 1.000 0.678 0.525 sisoe12 1.000 0.678 0.501 RIpro =~
proe5 1.000 1.787 0.549 proe7 1.000 1.787 0.555 proe10 1.000 1.787 0.582 proe12 1.000 1.787 0.547 wsi5 =~
sisoe5 1.000 0.925 0.807 wsi7 =~
sisoe7 1.000 0.955 0.815 wsi10 =~
sisoe10 1.000 1.098 0.851 wsi12 =~
sisoe12 1.000 1.170 0.865 wad5 =~
tadhde5 1.000 2.140 0.767 wad7 =~
tadhde7 1.000 1.834 0.716 wad10 =~
tadhde10 1.000 1.732 0.696 wad12 =~
tadhde12 1.000 1.793 0.708 wpro5 =~
proe5 1.000 2.718 0.836 wpro7 =~
proe7 1.000 2.677 0.832 wpro10 =~
proe10 1.000 2.494 0.813 wpro12 =~
proe12 1.000 2.732 0.837
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.207 0.058 3.538 0.000 0.200 0.200 wsi10 ~
wsi7 0.277 0.058 4.747 0.000 0.241 0.241 wsi12 ~
wsi10 0.437 0.044 9.912 0.000 0.410 0.410 wpro7 ~
wpro5 0.152 0.030 4.992 0.000 0.154 0.154 wpro10 ~
wpro7 0.081 0.034 2.400 0.016 0.087 0.087 wpro12 ~
wpro10 0.138 0.039 3.550 0.000 0.126 0.126 wad7 ~
wad5 0.213 0.038 5.566 0.000 0.249 0.249 wad10 ~
wad7 0.077 0.063 1.210 0.226 0.081 0.081 wad12 ~
wad10 0.265 0.068 3.869 0.000 0.256 0.256 wad7 ~
wsi5 0.059 0.085 0.699 0.484 0.030 0.030 wad10 ~
wsi7 0.134 0.107 1.255 0.209 0.074 0.074 wad12 ~
wsi10 0.035 0.072 0.483 0.629 0.021 0.021 wsi7 ~
wad5 0.037 0.017 2.184 0.029 0.082 0.082 wsi10 ~
wad7 0.050 0.026 1.876 0.061 0.083 0.083 wsi12 ~
wad10 0.027 0.026 1.014 0.311 0.039 0.039 wsi7 ~
wpro5 -0.024 0.011 -2.242 0.025 -0.069 -0.069 wad7 ~
wpro5 -0.025 0.020 -1.268 0.205 -0.037 -0.037 wpro12 ~
wsi10 -0.181 0.089 -2.023 0.043 -0.073 -0.073 wad10 -0.016 0.055 -0.287 0.774 -0.010 -0.010 wpro7 ~
wad5 (a1) -0.039 0.038 -1.014 0.310 -0.031 -0.031 wsi10 ~
wpro7 (b1) -0.000 0.013 -0.012 0.991 -0.000 -0.000 wpro10 ~
wad7 (a2) 0.019 0.053 0.369 0.712 0.014 0.014 wsi12 ~
wpro10 (b2) 0.017 0.013 1.251 0.211 0.036 0.036 wpro7 ~
wsi5 -0.060 0.096 -0.619 0.536 -0.021 -0.021 wad10 ~
wpro7 -0.039 0.023 -1.728 0.084 -0.060 -0.060 wpro10 ~
wsi7 -0.083 0.109 -0.761 0.446 -0.032 -0.032 wad12 ~
wpro10 -0.034 0.024 -1.400 0.161 -0.048 -0.048
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.349 0.094 -3.729 0.000 -0.139 -0.139 wad5 ~~
wpro5 -0.699 0.204 -3.436 0.001 -0.120 -0.120 wsi5 ~~
wad5 0.562 0.113 4.975 0.000 0.284 0.284 .wsi7 ~~
.wpro7 -0.396 0.087 -4.562 0.000 -0.163 -0.163 .wad7 ~~
.wpro7 -0.496 0.153 -3.250 0.001 -0.106 -0.106 .wsi7 ~~
.wad7 0.403 0.090 4.453 0.000 0.247 0.247 .wsi10 ~~
.wpro10 -0.567 0.093 -6.096 0.000 -0.216 -0.216 .wad10 ~~
.wpro10 -0.549 0.179 -3.064 0.002 -0.129 -0.129 .wsi10 ~~
.wad10 0.543 0.100 5.404 0.000 0.300 0.300 .wsi12 ~~
.wpro12 -0.417 0.084 -4.965 0.000 -0.145 -0.145 .wad12 ~~
.wpro12 -0.411 0.148 -2.780 0.005 -0.088 -0.088 .wsi12 ~~
.wad12 0.473 0.086 5.474 0.000 0.258 0.258 RIad ~~
RIsi 0.640 0.076 8.366 0.000 0.528 0.528 RIpro -1.589 0.161 -9.894 0.000 -0.497 -0.497 RIsi ~~
RIpro -0.651 0.080 -8.101 0.000 -0.537 -0.537
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.807 .tadhde7 1.813 0.055 32.736 0.000 1.813 0.708 .tadhde10 1.567 0.053 29.493 0.000 1.567 0.629 .tadhde12 1.455 0.055 26.683 0.000 1.455 0.575 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.709 .sisoe7 0.831 0.025 33.075 0.000 0.831 0.710 .sisoe10 0.940 0.028 33.735 0.000 0.940 0.728 .sisoe12 0.941 0.029 31.948 0.000 0.941 0.696 .proe5 14.127 0.068 206.791 0.000 14.127 4.343 .proe7 14.652 0.069 211.355 0.000 14.652 4.552 .proe10 15.548 0.066 235.210 0.000 15.548 5.067 .proe12 15.202 0.071 215.397 0.000 15.202 4.656 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.578 0.321 14.248 0.000 1.000 1.000 wsi5 0.856 0.101 8.491 0.000 1.000 1.000 wpro5 7.387 0.304 24.281 0.000 1.000 1.000 .wad7 3.124 0.241 12.958 0.000 0.929 0.929 .wsi7 0.852 0.071 11.940 0.000 0.934 0.934 .wpro7 6.968 0.259 26.860 0.000 0.972 0.972 .wad10 2.935 0.315 9.328 0.000 0.978 0.978 .wsi10 1.114 0.080 13.836 0.000 0.924 0.924 .wpro10 6.165 0.283 21.772 0.000 0.991 0.991 .wad12 2.973 0.255 11.659 0.000 0.925 0.925 .wsi12 1.131 0.081 13.915 0.000 0.826 0.826 .wpro12 7.271 0.284 25.619 0.000 0.974 0.974 RIad 3.196 0.238 13.420 0.000 1.000 1.000 RIsi 0.460 0.058 7.992 0.000 1.000 1.000 RIpro 3.193 0.232 13.745 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 indirect1 0.000 0.000 0.012 0.991 0.000 0.000 indirect2 0.000 0.001 0.338 0.735 0.001 0.001
ri.med.long.pro.full2 <- '
###### 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 ~ e*wsi5
wad10 ~ e*wsi7
wad12 ~ e*wsi10
## ADHD
wsi7 ~ f*wad5
wsi10 ~ f*wad7
wsi12 ~ f*wad10
## Prosocial
wsi7 ~ b*wpro5
wad7 ~ d*wpro5
wpro12 ~ c*wsi10
wpro12 ~ a*wad10
###### Mediation paths ######
## ADHD to Isolation
wpro7 ~ a*wad5
wsi10 ~ b*wpro7
wpro10 ~ a*wad7
wsi12 ~ b*wpro10
## Isolation to ADHD
wpro7 ~ c*wsi5
wad10 ~ d*wpro7
wpro10 ~ c*wsi7
wad12 ~ 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
###### Indirect effect (a*b) ######
indirect1 := a*b
indirect2 := c*d
indirect3 := d*f
'
ri.med.long.pro.full2.fit <- lavaan(model = ri.med.long.pro.full2,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
ri.med.long.pro.full2.fit.summary <- summary(ri.med.long.pro.full2.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 142 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 99.336 72.457 Degrees of freedom 33 33 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.371 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 8442.398 5457.612 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.547
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.993 Tucker-Lewis Index (TLI) 0.984 0.985
Robust Comparative Fit Index (CFI) 0.994 Robust Tucker-Lewis Index (TLI) 0.987
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -53125.216 -53125.216 Scaling correction factor 1.623 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.747 for the MLR correction
Akaike (AIC) 106364.432 106364.432 Bayesian (BIC) 106689.939 106689.939 Sample-size adjusted Bayesian (BIC) 106508.841 106508.841
Root Mean Square Error of Approximation:
RMSEA 0.030 0.023 90 Percent confidence interval - lower 0.023 0.017 90 Percent confidence interval - upper 0.037 0.029 P-value RMSEA <= 0.05 1.000 1.000
Robust RMSEA 0.027 90 Percent confidence interval - lower 0.019 90 Percent confidence interval - upper 0.036
Standardized Root Mean Square Residual:
SRMR 0.026 0.026
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.787 0.642 tadhde7 1.000 1.787 0.697 tadhde10 1.000 1.787 0.720 tadhde12 1.000 1.787 0.705 RIsi =~
sisoe5 1.000 0.687 0.598 sisoe7 1.000 0.687 0.588 sisoe10 1.000 0.687 0.534 sisoe12 1.000 0.687 0.507 RIpro =~
proe5 1.000 1.780 0.549 proe7 1.000 1.780 0.554 proe10 1.000 1.780 0.578 proe12 1.000 1.780 0.545 wsi5 =~
sisoe5 1.000 0.921 0.802 wsi7 =~
sisoe7 1.000 0.945 0.809 wsi10 =~
sisoe10 1.000 1.089 0.846 wsi12 =~
sisoe12 1.000 1.170 0.862 wad5 =~
tadhde5 1.000 2.137 0.767 wad7 =~
tadhde7 1.000 1.839 0.717 wad10 =~
tadhde10 1.000 1.724 0.694 wad12 =~
tadhde12 1.000 1.798 0.709 wpro5 =~
proe5 1.000 2.710 0.836 wpro7 =~
proe7 1.000 2.674 0.832 wpro10 =~
proe10 1.000 2.511 0.816 wpro12 =~
proe12 1.000 2.737 0.838
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.205 0.056 3.682 0.000 0.200 0.200 wsi10 ~
wsi7 0.266 0.053 5.014 0.000 0.231 0.231 wsi12 ~
wsi10 0.421 0.041 10.378 0.000 0.392 0.392 wpro7 ~
wpro5 0.146 0.030 4.792 0.000 0.148 0.148 wpro10 ~
wpro7 0.083 0.033 2.545 0.011 0.088 0.088 wpro12 ~
wpro10 0.156 0.037 4.190 0.000 0.143 0.143 wad7 ~
wad5 0.214 0.039 5.509 0.000 0.249 0.249 wad10 ~
wad7 0.085 0.060 1.422 0.155 0.091 0.091 wad12 ~
wad10 0.265 0.066 4.034 0.000 0.254 0.254 wad7 ~
wsi5 (e) 0.049 0.056 0.867 0.386 0.024 0.024 wad10 ~
wsi7 (e) 0.049 0.056 0.867 0.386 0.027 0.027 wad12 ~
wsi10 (e) 0.049 0.056 0.867 0.386 0.029 0.029 wsi7 ~
wad5 (f) 0.034 0.014 2.400 0.016 0.077 0.077 wsi10 ~
wad7 (f) 0.034 0.014 2.400 0.016 0.057 0.057 wsi12 ~
wad10 (f) 0.034 0.014 2.400 0.016 0.050 0.050 wsi7 ~
wpro5 (b) -0.006 0.008 -0.774 0.439 -0.018 -0.018 wad7 ~
wpro5 (d) -0.037 0.013 -2.721 0.007 -0.054 -0.054 wpro12 ~
wsi10 (c) -0.107 0.061 -1.750 0.080 -0.043 -0.043 wad10 (a) -0.015 0.028 -0.546 0.585 -0.010 -0.010 wpro7 ~
wad5 (a) -0.015 0.028 -0.546 0.585 -0.012 -0.012 wsi10 ~
wpro7 (b) -0.006 0.008 -0.774 0.439 -0.015 -0.015 wpro10 ~
wad7 (a) -0.015 0.028 -0.546 0.585 -0.011 -0.011 wsi12 ~
wpro10 (b) -0.006 0.008 -0.774 0.439 -0.013 -0.013 wpro7 ~
wsi5 (c) -0.107 0.061 -1.750 0.080 -0.037 -0.037 wad10 ~
wpro7 (d) -0.037 0.013 -2.721 0.007 -0.057 -0.057 wpro10 ~
wsi7 (c) -0.107 0.061 -1.750 0.080 -0.040 -0.040 wad12 ~
wpro10 (d) -0.037 0.013 -2.721 0.007 -0.051 -0.051
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.321 0.093 -3.457 0.001 -0.128 -0.128 wad5 ~~
wpro5 -0.702 0.197 -3.569 0.000 -0.121 -0.121 wsi5 ~~
wad5 0.548 0.106 5.173 0.000 0.278 0.278 .wsi7 ~~
.wpro7 -0.386 0.085 -4.544 0.000 -0.159 -0.159 .wad7 ~~
.wpro7 -0.506 0.148 -3.410 0.001 -0.108 -0.108 .wsi7 ~~
.wad7 0.374 0.090 4.152 0.000 0.230 0.230 .wsi10 ~~
.wpro10 -0.578 0.086 -6.698 0.000 -0.220 -0.220 .wad10 ~~
.wpro10 -0.568 0.161 -3.525 0.000 -0.133 -0.133 .wsi10 ~~
.wad10 0.521 0.091 5.698 0.000 0.289 0.289 .wsi12 ~~
.wpro12 -0.441 0.083 -5.326 0.000 -0.153 -0.153 .wad12 ~~
.wpro12 -0.409 0.140 -2.920 0.003 -0.088 -0.088 .wsi12 ~~
.wad12 0.484 0.084 5.776 0.000 0.263 0.263 RIad ~~
RIsi 0.661 0.074 8.959 0.000 0.538 0.538 RIpro -1.571 0.152 -10.299 0.000 -0.494 -0.494 RIsi ~~
RIpro -0.653 0.080 -8.135 0.000 -0.534 -0.534
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.808 .tadhde7 1.813 0.055 32.731 0.000 1.813 0.707 .tadhde10 1.566 0.053 29.512 0.000 1.566 0.631 .tadhde12 1.455 0.055 26.695 0.000 1.455 0.574 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.707 .sisoe7 0.831 0.025 33.083 0.000 0.831 0.712 .sisoe10 0.940 0.028 33.729 0.000 0.940 0.730 .sisoe12 0.941 0.029 31.933 0.000 0.941 0.694 .proe5 14.127 0.068 206.790 0.000 14.127 4.356 .proe7 14.652 0.069 211.386 0.000 14.652 4.561 .proe10 15.548 0.066 235.220 0.000 15.548 5.051 .proe12 15.201 0.071 215.353 0.000 15.201 4.656 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.565 0.320 14.281 0.000 1.000 1.000 wsi5 0.849 0.097 8.754 0.000 1.000 1.000 wpro5 7.346 0.305 24.048 0.000 1.000 1.000 .wad7 3.138 0.245 12.782 0.000 0.928 0.928 .wsi7 0.842 0.069 12.242 0.000 0.944 0.944 .wpro7 6.970 0.257 27.090 0.000 0.975 0.975 .wad10 2.926 0.307 9.539 0.000 0.985 0.985 .wsi10 1.108 0.079 13.964 0.000 0.935 0.935 .wpro10 6.234 0.278 22.424 0.000 0.989 0.989 .wad12 2.984 0.254 11.756 0.000 0.923 0.923 .wsi12 1.135 0.081 13.935 0.000 0.830 0.830 .wpro12 7.297 0.282 25.850 0.000 0.974 0.974 RIad 3.194 0.232 13.756 0.000 1.000 1.000 RIsi 0.472 0.056 8.442 0.000 1.000 1.000 RIpro 3.169 0.230 13.754 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 indirect1 0.000 0.000 0.430 0.667 0.000 0.000 indirect2 0.004 0.003 1.467 0.142 0.002 0.002 indirect3 -0.001 0.001 -1.788 0.074 -0.004 -0.004
The cross-lag constraints gave a non-significant loss in model fit (p=0.4722).
# Model fit
ri.med.long.pro.full2.fit.summary.fit <- table.model.fit(ri.med.long.pro.full2.fit.summary)
# Coefficients -
ri.med.long.pro.full2.fit.summary.reg <- table.model.coef(model = ri.med.long.pro.full2.fit.summary, step = "S4") %>% mutate_if(is.numeric, round, 3)
ri.med.long.pro.full2.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue) %>%
filter(lhs == "indirect1" | lhs == "indirect2" | lhs == "indirect3")
med_hyp.long.pro <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Pro social bahviour
proe7 ~ proe5
proe10 ~ proe7
proe12 ~ proe10
## ADHD
hye7 ~ hye5
hye10 ~ hye7
hye12 ~ hye10
###### Cross lag paths ######
## Isolation
hye7 ~ sisoe5
hye10 ~ sisoe7
hye12 ~ sisoe10
## ADHD
sisoe7 ~ hye5
sisoe10 ~ hye7
sisoe12 ~ hye10
## Prosocial
sisoe7 ~ proe5
hye7 ~ proe5
proe12 ~ sisoe10
proe12 ~ hye10
###### mediation paths ######
## ADHD to Isolation
proe7 ~ a1*hye5
sisoe10 ~ b1*proe7
proe10 ~ a2*hye7
sisoe12 ~ b2*proe10
## Isolation to ADHD
proe7 ~ c1*sisoe5
hye10 ~ d1*proe7
proe10 ~ c2*sisoe7
hye12 ~ d2*proe10
###### Covariances ######
sisoe5 ~~ proe5
proe5 ~~ hye5
sisoe5 ~~ hye5
sisoe7 ~~ proe7
proe7 ~~ hye7
sisoe7 ~~ hye7
sisoe10 ~~ proe10
proe10 ~~ hye10
sisoe10 ~~ hye10
sisoe12 ~~ proe12
proe12 ~~ hye12
sisoe12 ~~ hye12
###### Variances ######
## Variances
hye5 ~~ hye5
sisoe5 ~~ sisoe5
proe5 ~~ proe5
## Residual variances
hye7 ~~ hye7
sisoe7 ~~ sisoe7
proe7 ~~ proe7
hye10 ~~ hye10
sisoe10 ~~ sisoe10
proe10 ~~ proe10
hye12 ~~ hye12
sisoe12 ~~ sisoe12
proe12 ~~ proe12
###### Indirect effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
med_hyp.long.pro.fit <- lavaan(model = med_hyp.long.pro,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_hyp.long.pro.fit.summary <- summary(med_hyp.long.pro.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 105 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 530.976 392.095 Degrees of freedom 27 27 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.354 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7764.911 5158.866 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.505
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.935 0.928 Tucker-Lewis Index (TLI) 0.840 0.825
Robust Comparative Fit Index (CFI) 0.936 Robust Tucker-Lewis Index (TLI) 0.842
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -48790.383 -48790.383 Scaling correction factor 1.838 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.693 for the MLR correction
Akaike (AIC) 97706.765 97706.765 Bayesian (BIC) 98066.536 98066.536 Sample-size adjusted Bayesian (BIC) 97866.375 97866.375
Root Mean Square Error of Approximation:
RMSEA 0.091 0.078 90 Percent confidence interval - lower 0.085 0.072 90 Percent confidence interval - upper 0.098 0.084 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.091 90 Percent confidence interval - lower 0.083 90 Percent confidence interval - upper 0.099
Standardized Root Mean Square Residual:
SRMR 0.056 0.056
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.452 0.043 10.508 0.000 0.452 0.436 sisoe10 ~
sisoe7 0.489 0.037 13.375 0.000 0.489 0.444 sisoe12 ~
sisoe10 0.566 0.032 17.587 0.000 0.566 0.535 proe7 ~
proe5 0.384 0.022 17.846 0.000 0.384 0.382 proe10 ~
proe7 0.327 0.022 14.862 0.000 0.327 0.346 proe12 ~
proe10 0.395 0.026 15.344 0.000 0.395 0.370 hye7 ~
hye5 0.505 0.023 21.794 0.000 0.505 0.537 hye10 ~
hye7 0.471 0.027 17.501 0.000 0.471 0.513 hye12 ~
hye10 0.631 0.035 18.264 0.000 0.631 0.610 hye7 ~
sisoe5 0.057 0.031 1.874 0.061 0.057 0.043 hye10 ~
sisoe7 0.059 0.037 1.583 0.114 0.059 0.050 hye12 ~
sisoe10 -0.007 0.024 -0.267 0.789 -0.007 -0.006 sisoe7 ~
hye5 0.071 0.017 4.129 0.000 0.071 0.096 sisoe10 ~
hye7 0.096 0.022 4.262 0.000 0.096 0.111 sisoe12 ~
hye10 0.105 0.024 4.464 0.000 0.105 0.106 sisoe7 ~
proe5 -0.041 0.008 -5.128 0.000 -0.041 -0.114 hye7 ~
proe5 -0.035 0.009 -3.896 0.000 -0.035 -0.074 proe12 ~
sisoe10 -0.225 0.065 -3.484 0.000 -0.225 -0.089 hye10 -0.190 0.053 -3.576 0.000 -0.190 -0.080 proe7 ~
hye5 (a1) -0.144 0.045 -3.230 0.001 -0.144 -0.071 sisoe10 ~
proe7 (b1) -0.019 0.009 -2.143 0.032 -0.019 -0.047 proe10 ~
hye7 (a2) -0.206 0.046 -4.512 0.000 -0.206 -0.101 sisoe12 ~
proe10 (b2) -0.009 0.009 -0.957 0.339 -0.009 -0.019 proe7 ~
sisoe5 (c1) -0.239 0.072 -3.318 0.001 -0.239 -0.083 hye10 ~
proe7 (d1) -0.032 0.009 -3.448 0.001 -0.032 -0.075 proe10 ~
sisoe7 (c2) -0.189 0.063 -3.006 0.003 -0.189 -0.073 hye12 ~
proe10 (d2) -0.026 0.009 -2.745 0.006 -0.026 -0.055
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
proe5 -0.936 0.101 -9.315 0.000 -0.936 -0.256 proe5 ~~
hye5 -1.058 0.127 -8.305 0.000 -1.058 -0.205 sisoe5 ~~
hye5 0.527 0.061 8.626 0.000 0.527 0.290 .sisoe7 ~~
.proe7 -0.564 0.076 -7.428 0.000 -0.564 -0.192 .proe7 ~~
.hye7 -0.395 0.084 -4.724 0.000 -0.395 -0.109 .sisoe7 ~~
.hye7 0.259 0.043 6.029 0.000 0.259 0.208 .sisoe10 ~~
.proe10 -0.728 0.081 -8.947 0.000 -0.728 -0.233 .proe10 ~~
.hye10 -0.466 0.090 -5.199 0.000 -0.466 -0.145 .sisoe10 ~~
.hye10 0.313 0.045 6.951 0.000 0.313 0.243 .sisoe12 ~~
.proe12 -0.602 0.087 -6.950 0.000 -0.602 -0.184 .proe12 ~~
.hye12 -0.219 0.084 -2.611 0.009 -0.219 -0.067 .sisoe12 ~~
.hye12 0.267 0.049 5.492 0.000 0.267 0.215
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.952 0.133 7.158 0.000 0.952 0.809 .sisoe10 0.705 0.144 4.911 0.000 0.705 0.544 .sisoe12 0.453 0.150 3.015 0.003 0.453 0.330 .proe7 9.623 0.347 27.730 0.000 9.623 2.966 .proe10 11.147 0.357 31.212 0.000 11.147 3.637 .proe12 9.425 0.442 21.338 0.000 9.425 2.877 .hye7 0.844 0.142 5.936 0.000 0.844 0.560 .hye10 0.739 0.154 4.784 0.000 0.739 0.534 .hye12 0.659 0.159 4.134 0.000 0.659 0.461 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 proe5 14.127 0.068 206.791 0.000 14.127 4.377 hye5 1.371 0.034 40.447 0.000 1.371 0.856
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all hye5 2.566 0.114 22.496 0.000 2.566 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 proe5 10.417 0.320 32.602 0.000 10.417 1.000 .hye7 1.529 0.082 18.740 0.000 1.529 0.673 .sisoe7 1.016 0.061 16.687 0.000 1.016 0.734 .proe7 8.540 0.240 35.635 0.000 8.540 0.811 .hye10 1.328 0.082 16.223 0.000 1.328 0.694 .sisoe10 1.249 0.077 16.313 0.000 1.249 0.743 .proe10 7.796 0.267 29.201 0.000 7.796 0.830 .hye12 1.248 0.086 14.442 0.000 1.248 0.610 .sisoe12 1.235 0.080 15.363 0.000 1.235 0.656 .proe12 8.669 0.291 29.810 0.000 8.669 0.808
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1a 0.003 0.002 1.774 0.076 0.003 0.003 indirect1b 0.002 0.002 0.929 0.353 0.002 0.002 indirect2a 0.008 0.003 2.274 0.023 0.008 0.006 indirect2b 0.005 0.002 2.087 0.037 0.005 0.004
med_hyp.long2.pro <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Pro social bahviour
proe7 ~ proe5
proe10 ~ proe7
proe12 ~ proe10
## ADHD
hye7 ~ hye5
hye10 ~ hye7
hye12 ~ hye10
###### Cross lag paths ######
## Isolation
hye7 ~ e*sisoe5
hye10 ~ e*sisoe7
hye12 ~ e*sisoe10
## ADHD
sisoe7 ~ f*hye5
sisoe10 ~ f*hye7
sisoe12 ~ f*hye10
## Prosocial
sisoe7 ~ b*proe5
hye7 ~ d*proe5
proe12 ~ c*sisoe10
proe12 ~ a*hye10
###### mediation paths ######
## ADHD to Isolation
proe7 ~ a*hye5
sisoe10 ~ b*proe7
proe10 ~ a*hye7
sisoe12 ~ b*proe10
## Isolation to ADHD
proe7 ~ c*sisoe5
hye10 ~ d*proe7
proe10 ~ c*sisoe7
hye12 ~ d*proe10
###### Covariances ######
sisoe5 ~~ proe5
proe5 ~~ hye5
sisoe5 ~~ hye5
sisoe7 ~~ proe7
proe7 ~~ hye7
sisoe7 ~~ hye7
sisoe10 ~~ proe10
proe10 ~~ hye10
sisoe10 ~~ hye10
sisoe12 ~~ proe12
proe12 ~~ hye12
sisoe12 ~~ hye12
###### Variances ######
## Variances
hye5 ~~ hye5
sisoe5 ~~ sisoe5
proe5 ~~ proe5
## Residual variances
hye7 ~~ hye7
sisoe7 ~~ sisoe7
proe7 ~~ proe7
hye10 ~~ hye10
sisoe10 ~~ sisoe10
proe10 ~~ proe10
hye12 ~~ hye12
sisoe12 ~~ sisoe12
proe12 ~~ proe12
###### Indirect effects (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
med_hyp.long2.pro.fit <- lavaan(model = med_hyp.long2.pro,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_hyp.long2.pro.fit.summary <- summary(med_hyp.long2.pro.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 67 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 550.244 401.333 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.371 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7764.911 5158.866 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.505
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.934 0.929 Tucker-Lewis Index (TLI) 0.888 0.880
Robust Comparative Fit Index (CFI) 0.935 Robust Tucker-Lewis Index (TLI) 0.890
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -48800.017 -48800.017 Scaling correction factor 1.570 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.693 for the MLR correction
Akaike (AIC) 97702.033 97702.033 Bayesian (BIC) 97993.276 97993.276 Sample-size adjusted Bayesian (BIC) 97831.241 97831.241
Root Mean Square Error of Approximation:
RMSEA 0.077 0.065 90 Percent confidence interval - lower 0.071 0.060 90 Percent confidence interval - upper 0.082 0.069 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.076 90 Percent confidence interval - lower 0.069 90 Percent confidence interval - upper 0.082
Standardized Root Mean Square Residual:
SRMR 0.058 0.058
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.453 0.041 10.993 0.000 0.453 0.438 sisoe10 ~
sisoe7 0.484 0.033 14.758 0.000 0.484 0.438 sisoe12 ~
sisoe10 0.567 0.031 18.466 0.000 0.567 0.533 proe7 ~
proe5 0.374 0.020 18.263 0.000 0.374 0.373 proe10 ~
proe7 0.329 0.020 16.134 0.000 0.329 0.347 proe12 ~
proe10 0.406 0.025 16.543 0.000 0.406 0.379 hye7 ~
hye5 0.515 0.023 22.595 0.000 0.515 0.547 hye10 ~
hye7 0.476 0.026 18.592 0.000 0.476 0.520 hye12 ~
hye10 0.614 0.034 18.158 0.000 0.614 0.592 hye7 ~
sisoe5 (e) 0.032 0.016 2.007 0.045 0.032 0.024 hye10 ~
sisoe7 (e) 0.032 0.016 2.007 0.045 0.032 0.027 hye12 ~
sisoe10 (e) 0.032 0.016 2.007 0.045 0.032 0.029 sisoe7 ~
hye5 (f) 0.087 0.012 7.361 0.000 0.087 0.119 sisoe10 ~
hye7 (f) 0.087 0.012 7.361 0.000 0.087 0.102 sisoe12 ~
hye10 (f) 0.087 0.012 7.361 0.000 0.087 0.087 sisoe7 ~
proe5 (b) -0.025 0.005 -5.134 0.000 -0.025 -0.069 hye7 ~
proe5 (d) -0.031 0.005 -5.852 0.000 -0.031 -0.067 proe12 ~
sisoe10 (c) -0.214 0.037 -5.776 0.000 -0.214 -0.084 hye10 (a) -0.178 0.027 -6.552 0.000 -0.178 -0.075 proe7 ~
hye5 (a) -0.178 0.027 -6.552 0.000 -0.178 -0.088 sisoe10 ~
proe7 (b) -0.025 0.005 -5.134 0.000 -0.025 -0.063 proe10 ~
hye7 (a) -0.178 0.027 -6.552 0.000 -0.178 -0.088 sisoe12 ~
proe10 (b) -0.025 0.005 -5.134 0.000 -0.025 -0.056 proe7 ~
sisoe5 (c) -0.214 0.037 -5.776 0.000 -0.214 -0.075 hye10 ~
proe7 (d) -0.031 0.005 -5.852 0.000 -0.031 -0.074 proe10 ~
sisoe7 (c) -0.214 0.037 -5.776 0.000 -0.214 -0.082 hye12 ~
proe10 (d) -0.031 0.005 -5.852 0.000 -0.031 -0.067
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
proe5 -0.936 0.101 -9.315 0.000 -0.936 -0.256 proe5 ~~
hye5 -1.058 0.127 -8.305 0.000 -1.058 -0.205 sisoe5 ~~
hye5 0.527 0.061 8.626 0.000 0.527 0.290 .sisoe7 ~~
.proe7 -0.566 0.076 -7.436 0.000 -0.566 -0.192 .proe7 ~~
.hye7 -0.396 0.084 -4.739 0.000 -0.396 -0.110 .sisoe7 ~~
.hye7 0.260 0.043 6.022 0.000 0.260 0.208 .sisoe10 ~~
.proe10 -0.728 0.081 -8.935 0.000 -0.728 -0.233 .proe10 ~~
.hye10 -0.465 0.090 -5.191 0.000 -0.465 -0.145 .sisoe10 ~~
.hye10 0.313 0.045 6.935 0.000 0.313 0.243 .sisoe12 ~~
.proe12 -0.603 0.087 -6.949 0.000 -0.603 -0.184 .proe12 ~~
.hye12 -0.219 0.084 -2.610 0.009 -0.219 -0.067 .sisoe12 ~~
.hye12 0.269 0.049 5.500 0.000 0.269 0.216
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.699 0.085 8.197 0.000 0.699 0.596 .sisoe10 0.811 0.084 9.685 0.000 0.811 0.627 .sisoe12 0.725 0.085 8.559 0.000 0.725 0.527 .proe7 9.785 0.314 31.135 0.000 9.785 3.024 .proe10 11.111 0.321 34.656 0.000 11.111 3.628 .proe12 9.245 0.405 22.837 0.000 9.245 2.818 .hye7 0.804 0.088 9.108 0.000 0.804 0.533 .hye10 0.749 0.093 8.073 0.000 0.749 0.542 .hye12 0.725 0.096 7.559 0.000 0.725 0.507 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 proe5 14.127 0.068 206.791 0.000 14.127 4.377 hye5 1.371 0.034 40.447 0.000 1.371 0.856
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all hye5 2.566 0.114 22.496 0.000 2.566 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 proe5 10.417 0.320 32.602 0.000 10.417 1.000 .hye7 1.530 0.082 18.718 0.000 1.530 0.672 .sisoe7 1.019 0.061 16.667 0.000 1.019 0.741 .proe7 8.543 0.240 35.568 0.000 8.543 0.816 .hye10 1.329 0.082 16.157 0.000 1.329 0.697 .sisoe10 1.250 0.077 16.333 0.000 1.250 0.747 .proe10 7.797 0.267 29.251 0.000 7.797 0.831 .hye12 1.251 0.087 14.426 0.000 1.251 0.612 .sisoe12 1.237 0.081 15.310 0.000 1.237 0.653 .proe12 8.671 0.291 29.845 0.000 8.671 0.805
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1 0.004 0.001 4.125 0.000 0.004 0.005 indirect2 0.007 0.002 4.212 0.000 0.007 0.006
The cross-lag constraints gave a non-significant loss in model fit (p=0.3275). Therefore this model 2 will be carried forward.
# Model fit
med_hyp.long2.pro.fit.summary.fit <- table.model.fit(med_hyp.long2.pro.fit.summary)
# Coefficients
med_hyp.long2.pro.fit.summary.reg <- table.model.coef(model = med_hyp.long2.pro.fit.summary, step = "S2") %>% mutate_if(is.numeric, round, 3)
med_hyp.long2.pro.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue)
ri.med_hyp.long.pro.full <- '
###### Create random intercepts ######
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12
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*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
## 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 ~ wsi5
wad10 ~ wsi7
wad12 ~ wsi10
## ADHD
wsi7 ~ wad5
wsi10 ~ wad7
wsi12 ~ wad10
## Prosocial
wsi7 ~ wpro5
wad7 ~ wpro5
wpro12 ~ wsi10
wpro12 ~ wad10
###### Mediation paths ######
## ADHD to Isolation
wpro7 ~ a1*wad5
wsi10 ~ b1*wpro7
wpro10 ~ a2*wad7
wsi12 ~ b2*wpro10
## Isolation to ADHD
wpro7 ~ wsi5
wad10 ~ wpro7
wpro10 ~ wsi7
wad12 ~ 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) ######
indirect1 := a1*b1
indirect2 := a2*b2
'
ri.med_hyp.long.pro.full.fit <- lavaan(model = ri.med_hyp.long.pro.full,
data = dat,
missing = 'ML',
meanstructure = TRUE,
se = "robust",
int.ov.free = TRUE,
estimator = "MLR")
ri.med_hyp.long.pro.full.fit.summary <- summary(ri.med_hyp.long.pro.full.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 132 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 69.364 53.694 Degrees of freedom 21 21 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.292 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7764.911 5158.866 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.505
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.994 0.994 Tucker-Lewis Index (TLI) 0.980 0.980
Robust Comparative Fit Index (CFI) 0.994 Robust Tucker-Lewis Index (TLI) 0.983
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -48559.577 -48559.577 Scaling correction factor 1.815 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.693 for the MLR correction
Akaike (AIC) 97257.153 97257.153 Bayesian (BIC) 97651.188 97651.188 Sample-size adjusted Bayesian (BIC) 97431.964 97431.964
Root Mean Square Error of Approximation:
RMSEA 0.032 0.026 90 Percent confidence interval - lower 0.024 0.019 90 Percent confidence interval - upper 0.041 0.034 P-value RMSEA <= 0.05 1.000 1.000
Robust RMSEA 0.030 90 Percent confidence interval - lower 0.020 90 Percent confidence interval - upper 0.040
Standardized Root Mean Square Residual:
SRMR 0.023 0.023
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.978 0.606 hye7 1.000 0.978 0.658 hye10 1.000 0.978 0.703 hye12 1.000 0.978 0.688 RIsi =~
sisoe5 1.000 0.688 0.601 sisoe7 1.000 0.688 0.588 sisoe10 1.000 0.688 0.533 sisoe12 1.000 0.688 0.507 RIpro =~
proe5 1.000 1.780 0.547 proe7 1.000 1.780 0.553 proe10 1.000 1.780 0.580 proe12 1.000 1.780 0.546 wsi5 =~
sisoe5 1.000 0.915 0.799 wsi7 =~
sisoe7 1.000 0.946 0.809 wsi10 =~
sisoe10 1.000 1.094 0.846 wsi12 =~
sisoe12 1.000 1.171 0.862 wad5 =~
hye5 1.000 1.283 0.795 wad7 =~
hye7 1.000 1.118 0.753 wad10 =~
hye10 1.000 0.989 0.711 wad12 =~
hye12 1.000 1.030 0.725 wpro5 =~
proe5 1.000 2.722 0.837 wpro7 =~
proe7 1.000 2.681 0.833 wpro10 =~
proe10 1.000 2.501 0.815 wpro12 =~
proe12 1.000 2.734 0.838
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.202 0.058 3.446 0.001 0.195 0.195 wsi10 ~
wsi7 0.273 0.059 4.647 0.000 0.236 0.236 wsi12 ~
wsi10 0.431 0.042 10.173 0.000 0.402 0.402 wpro7 ~
wpro5 0.156 0.031 5.085 0.000 0.158 0.158 wpro10 ~
wpro7 0.082 0.034 2.421 0.015 0.088 0.088 wpro12 ~
wpro10 0.138 0.039 3.553 0.000 0.127 0.127 wad7 ~
wad5 0.229 0.034 6.814 0.000 0.262 0.262 wad10 ~
wad7 0.104 0.053 1.979 0.048 0.118 0.118 wad12 ~
wad10 0.267 0.064 4.161 0.000 0.256 0.256 wad7 ~
wsi5 0.035 0.049 0.700 0.484 0.028 0.028 wad10 ~
wsi7 0.068 0.060 1.136 0.256 0.065 0.065 wad12 ~
wsi10 0.010 0.036 0.283 0.777 0.011 0.011 wsi7 ~
wad5 0.046 0.026 1.755 0.079 0.062 0.062 wsi10 ~
wad7 0.075 0.039 1.917 0.055 0.077 0.077 wsi12 ~
wad10 0.071 0.042 1.672 0.094 0.060 0.060 wsi7 ~
wpro5 -0.025 0.011 -2.345 0.019 -0.073 -0.073 wad7 ~
wpro5 -0.021 0.012 -1.854 0.064 -0.052 -0.052 wpro12 ~
wsi10 -0.177 0.089 -1.984 0.047 -0.071 -0.071 wad10 -0.073 0.097 -0.745 0.456 -0.026 -0.026 wpro7 ~
wad5 (a1) -0.045 0.063 -0.714 0.475 -0.022 -0.022 wsi10 ~
wpro7 (b1) -0.003 0.013 -0.222 0.825 -0.007 -0.007 wpro10 ~
wad7 (a2) -0.074 0.084 -0.891 0.373 -0.033 -0.033 wsi12 ~
wpro10 (b2) 0.014 0.013 1.072 0.284 0.031 0.031 wpro7 ~
wsi5 -0.066 0.097 -0.676 0.499 -0.023 -0.023 wad10 ~
wpro7 -0.021 0.013 -1.593 0.111 -0.056 -0.056 wpro10 ~
wsi7 -0.055 0.109 -0.506 0.613 -0.021 -0.021 wad12 ~
wpro10 -0.017 0.014 -1.243 0.214 -0.042 -0.042
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.342 0.094 -3.622 0.000 -0.137 -0.137 wad5 ~~
wpro5 -0.358 0.114 -3.127 0.002 -0.102 -0.102 wsi5 ~~
wad5 0.232 0.054 4.328 0.000 0.198 0.198 .wsi7 ~~
.wpro7 -0.399 0.087 -4.559 0.000 -0.164 -0.164 .wad7 ~~
.wpro7 -0.231 0.090 -2.571 0.010 -0.081 -0.081 .wsi7 ~~
.wad7 0.200 0.052 3.862 0.000 0.203 0.203 .wsi10 ~~
.wpro10 -0.569 0.092 -6.173 0.000 -0.217 -0.217 .wad10 ~~
.wpro10 -0.319 0.099 -3.241 0.001 -0.132 -0.132 .wsi10 ~~
.wad10 0.271 0.053 5.134 0.000 0.263 0.263 .wsi12 ~~
.wpro12 -0.429 0.085 -5.051 0.000 -0.150 -0.150 .wad12 ~~
.wpro12 -0.101 0.083 -1.216 0.224 -0.038 -0.038 .wsi12 ~~
.wad12 0.217 0.047 4.604 0.000 0.206 0.206 RIad ~~
RIsi 0.305 0.041 7.533 0.000 0.454 0.454 RIpro -0.706 0.082 -8.611 0.000 -0.406 -0.406 RIsi ~~
RIpro -0.647 0.080 -8.066 0.000 -0.528 -0.528
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.850 .hye7 1.093 0.032 33.966 0.000 1.093 0.736 .hye10 0.836 0.030 28.208 0.000 0.836 0.601 .hye12 0.779 0.031 25.519 0.000 0.779 0.549 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.710 .sisoe7 0.831 0.025 33.067 0.000 0.831 0.711 .sisoe10 0.940 0.028 33.726 0.000 0.940 0.727 .sisoe12 0.941 0.029 31.961 0.000 0.941 0.693 .proe5 14.127 0.068 206.790 0.000 14.127 4.344 .proe7 14.652 0.069 211.349 0.000 14.652 4.553 .proe10 15.549 0.066 235.177 0.000 15.549 5.065 .proe12 15.201 0.071 215.375 0.000 15.201 4.660 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 1.647 0.099 16.672 0.000 1.000 1.000 wsi5 0.838 0.098 8.527 0.000 1.000 1.000 wpro5 7.409 0.307 24.095 0.000 1.000 1.000 .wad7 1.151 0.084 13.624 0.000 0.921 0.921 .wsi7 0.844 0.072 11.725 0.000 0.943 0.943 .wpro7 6.986 0.261 26.816 0.000 0.972 0.972 .wad10 0.952 0.095 10.023 0.000 0.973 0.973 .wsi10 1.112 0.081 13.747 0.000 0.929 0.929 .wpro10 6.190 0.281 22.004 0.000 0.989 0.989 .wad12 0.985 0.082 12.015 0.000 0.928 0.928 .wsi12 1.132 0.081 13.988 0.000 0.826 0.826 .wpro12 7.265 0.283 25.626 0.000 0.972 0.972 RIad 0.956 0.068 14.014 0.000 1.000 1.000 RIsi 0.474 0.057 8.354 0.000 1.000 1.000 RIpro 3.168 0.233 13.608 0.000 1.000 1.000 .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 .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 indirect1 0.000 0.001 0.205 0.837 0.000 0.000 indirect2 -0.001 0.001 -0.732 0.464 -0.001 -0.001
ri.med_hyp.long.pro.full2 <- '
###### Create random intercepts ######
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12
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*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
## 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 ~ e*wsi5
wad10 ~ e*wsi7
wad12 ~ e*wsi10
## ADHD
wsi7 ~ f*wad5
wsi10 ~ f*wad7
wsi12 ~ f*wad10
## Prosocial
wsi7 ~ b*wpro5
wad7 ~ d*wpro5
wpro12 ~ c*wsi10
wpro12 ~ a*wad10
###### Mediation paths ######
## ADHD to Isolation
wpro7 ~ a*wad5
wsi10 ~ b*wpro7
wpro10 ~ a*wad7
wsi12 ~ b*wpro10
## Isolation to ADHD
wpro7 ~ c*wsi5
wad10 ~ d*wpro7
wpro10 ~ c*wsi7
wad12 ~ 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
###### Indirect effect (a*b) ######
indirect1 := a*b
indirect2 := c*d
indirect3 := d*f
'
ri.med_hyp.long.pro.full2.fit <- lavaan(model = ri.med_hyp.long.pro.full2,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
ri.med_hyp.long.pro.full2.fit.summary <- summary(ri.med_hyp.long.pro.full2.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 120 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 83.228 62.392 Degrees of freedom 33 33 P-value (Chi-square) 0.000 0.001 Scaling correction factor 1.334 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7764.911 5158.866 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.505
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.993 0.994 Tucker-Lewis Index (TLI) 0.987 0.988
Robust Comparative Fit Index (CFI) 0.995 Robust Tucker-Lewis Index (TLI) 0.990
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -48566.508 -48566.508 Scaling correction factor 1.571 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.693 for the MLR correction
Akaike (AIC) 97247.016 97247.016 Bayesian (BIC) 97572.524 97572.524 Sample-size adjusted Bayesian (BIC) 97391.426 97391.426
Root Mean Square Error of Approximation:
RMSEA 0.026 0.020 90 Percent confidence interval - lower 0.019 0.013 90 Percent confidence interval - upper 0.033 0.026 P-value RMSEA <= 0.05 1.000 1.000
Robust RMSEA 0.023 90 Percent confidence interval - lower 0.014 90 Percent confidence interval - upper 0.032
Standardized Root Mean Square Residual:
SRMR 0.024 0.024
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.981 0.607 hye7 1.000 0.981 0.660 hye10 1.000 0.981 0.707 hye12 1.000 0.981 0.690 RIsi =~
sisoe5 1.000 0.695 0.606 sisoe7 1.000 0.695 0.595 sisoe10 1.000 0.695 0.538 sisoe12 1.000 0.695 0.511 RIpro =~
proe5 1.000 1.772 0.547 proe7 1.000 1.772 0.551 proe10 1.000 1.772 0.576 proe12 1.000 1.772 0.543 wsi5 =~
sisoe5 1.000 0.913 0.796 wsi7 =~
sisoe7 1.000 0.939 0.804 wsi10 =~
sisoe10 1.000 1.088 0.843 wsi12 =~
sisoe12 1.000 1.170 0.860 wad5 =~
hye5 1.000 1.284 0.794 wad7 =~
hye7 1.000 1.116 0.751 wad10 =~
hye10 1.000 0.980 0.707 wad12 =~
hye12 1.000 1.028 0.723 wpro5 =~
proe5 1.000 2.713 0.837 wpro7 =~
proe7 1.000 2.683 0.834 wpro10 =~
proe10 1.000 2.517 0.818 wpro12 =~
proe12 1.000 2.739 0.840
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.198 0.056 3.514 0.000 0.193 0.193 wsi10 ~
wsi7 0.265 0.053 4.980 0.000 0.229 0.229 wsi12 ~
wsi10 0.423 0.041 10.358 0.000 0.393 0.393 wpro7 ~
wpro5 0.147 0.031 4.824 0.000 0.149 0.149 wpro10 ~
wpro7 0.087 0.033 2.652 0.008 0.093 0.093 wpro12 ~
wpro10 0.158 0.037 4.225 0.000 0.146 0.146 wad7 ~
wad5 0.231 0.034 6.770 0.000 0.265 0.265 wad10 ~
wad7 0.102 0.052 1.981 0.048 0.116 0.116 wad12 ~
wad10 0.254 0.063 4.008 0.000 0.242 0.242 wad7 ~
wsi5 (e) 0.026 0.031 0.858 0.391 0.022 0.022 wad10 ~
wsi7 (e) 0.026 0.031 0.858 0.391 0.025 0.025 wad12 ~
wsi10 (e) 0.026 0.031 0.858 0.391 0.028 0.028 wsi7 ~
wad5 (f) 0.054 0.022 2.449 0.014 0.074 0.074 wsi10 ~
wad7 (f) 0.054 0.022 2.449 0.014 0.055 0.055 wsi12 ~
wad10 (f) 0.054 0.022 2.449 0.014 0.045 0.045 wsi7 ~
wpro5 (b) -0.008 0.008 -1.014 0.311 -0.024 -0.024 wad7 ~
wpro5 (d) -0.020 0.008 -2.530 0.011 -0.049 -0.049 wpro12 ~
wsi10 (c) -0.103 0.061 -1.695 0.090 -0.041 -0.041 wad10 (a) -0.057 0.049 -1.172 0.241 -0.020 -0.020 wpro7 ~
wad5 (a) -0.057 0.049 -1.172 0.241 -0.027 -0.027 wsi10 ~
wpro7 (b) -0.008 0.008 -1.014 0.311 -0.020 -0.020 wpro10 ~
wad7 (a) -0.057 0.049 -1.172 0.241 -0.025 -0.025 wsi12 ~
wpro10 (b) -0.008 0.008 -1.014 0.311 -0.018 -0.018 wpro7 ~
wsi5 (c) -0.103 0.061 -1.695 0.090 -0.035 -0.035 wad10 ~
wpro7 (d) -0.020 0.008 -2.530 0.011 -0.055 -0.055 wpro10 ~
wsi7 (c) -0.103 0.061 -1.695 0.090 -0.039 -0.039 wad12 ~
wpro10 (d) -0.020 0.008 -2.530 0.011 -0.049 -0.049
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.313 0.093 -3.375 0.001 -0.127 -0.127 wad5 ~~
wpro5 -0.361 0.110 -3.266 0.001 -0.104 -0.104 wsi5 ~~
wad5 0.233 0.050 4.647 0.000 0.198 0.198 .wsi7 ~~
.wpro7 -0.393 0.085 -4.623 0.000 -0.162 -0.162 .wad7 ~~
.wpro7 -0.226 0.088 -2.565 0.010 -0.080 -0.080 .wsi7 ~~
.wad7 0.188 0.051 3.656 0.000 0.191 0.191 .wsi10 ~~
.wpro10 -0.584 0.086 -6.764 0.000 -0.222 -0.222 .wad10 ~~
.wpro10 -0.307 0.090 -3.415 0.001 -0.126 -0.126 .wsi10 ~~
.wad10 0.260 0.049 5.317 0.000 0.254 0.254 .wsi12 ~~
.wpro12 -0.448 0.084 -5.360 0.000 -0.156 -0.156 .wad12 ~~
.wpro12 -0.099 0.078 -1.274 0.203 -0.037 -0.037 .wsi12 ~~
.wad12 0.218 0.046 4.764 0.000 0.207 0.207 RIad ~~
RIsi 0.315 0.040 7.969 0.000 0.463 0.463 RIpro -0.710 0.079 -9.038 0.000 -0.408 -0.408 RIsi ~~
RIpro -0.649 0.080 -8.069 0.000 -0.527 -0.527
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.849 .hye7 1.093 0.032 33.964 0.000 1.093 0.735 .hye10 0.836 0.030 28.230 0.000 0.836 0.603 .hye12 0.779 0.031 25.526 0.000 0.779 0.548 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.709 .sisoe7 0.831 0.025 33.081 0.000 0.831 0.712 .sisoe10 0.940 0.028 33.731 0.000 0.940 0.728 .sisoe12 0.941 0.029 31.946 0.000 0.941 0.692 .proe5 14.127 0.068 206.790 0.000 14.127 4.359 .proe7 14.652 0.069 211.398 0.000 14.652 4.557 .proe10 15.549 0.066 235.179 0.000 15.549 5.050 .proe12 15.201 0.071 215.323 0.000 15.201 4.659 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 1.648 0.098 16.798 0.000 1.000 1.000 wsi5 0.834 0.095 8.741 0.000 1.000 1.000 wpro5 7.361 0.308 23.922 0.000 1.000 1.000 .wad7 1.148 0.085 13.440 0.000 0.921 0.921 .wsi7 0.837 0.069 12.091 0.000 0.950 0.950 .wpro7 7.004 0.259 27.079 0.000 0.973 0.973 .wad10 0.942 0.094 10.012 0.000 0.980 0.980 .wsi10 1.109 0.080 13.889 0.000 0.937 0.937 .wpro10 6.256 0.280 22.375 0.000 0.987 0.987 .wad12 0.984 0.082 12.041 0.000 0.931 0.931 .wsi12 1.136 0.081 13.962 0.000 0.830 0.830 .wpro12 7.299 0.283 25.801 0.000 0.973 0.973 RIad 0.963 0.068 14.246 0.000 1.000 1.000 RIsi 0.483 0.056 8.664 0.000 1.000 1.000 RIpro 3.141 0.231 13.601 0.000 1.000 1.000 .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 .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 indirect1 0.000 0.001 0.741 0.459 0.000 0.000 indirect2 0.002 0.001 1.395 0.163 0.002 0.002 indirect3 -0.001 0.001 -1.757 0.079 -0.004 -0.004
lavTestLRT(ri.med_hyp.long.pro.full.fit, ri.med_hyp.long.pro.full2.fit, method = "satorra.bentler.2010")
The cross-lag constraints gave a non-significant loss in model fit (p=0.4722).
# Model fit
ri.med_hyp.long.pro.full2.fit.summary.fit <- table.model.fit(ri.med_hyp.long.pro.full2.fit.summary)
# Coefficients -
ri.med_hyp.long.pro.full2.fit.summary.reg <- table.model.coef(model = ri.med_hyp.long.pro.full2.fit.summary, step = "S4") %>% mutate_if(is.numeric, round, 3)
ri.med_hyp.long.pro.full2.fit.summary.reg %>%
select(lhs, op, rhs, std.all, pvalue) %>%
filter(lhs == "indirect1" | lhs == "indirect2")
med_inat.long.pro <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Pro social bahviour
proe7 ~ proe5
proe10 ~ proe7
proe12 ~ proe10
## ADHD
ine7 ~ ine5
ine10 ~ ine7
ine12 ~ ine10
###### Cross lag paths ######
## Isolation
ine7 ~ sisoe5
ine10 ~ sisoe7
ine12 ~ sisoe10
## ADHD
sisoe7 ~ ine5
sisoe10 ~ ine7
sisoe12 ~ ine10
## Prosocial
sisoe7 ~ proe5
ine7 ~ proe5
proe12 ~ sisoe10
proe12 ~ ine10
###### mediation paths ######
## ADHD to Isolation
proe7 ~ a1*ine5
sisoe10 ~ b1*proe7
proe10 ~ a2*ine7
sisoe12 ~ b2*proe10
## Isolation to ADHD
proe7 ~ c1*sisoe5
ine10 ~ d1*proe7
proe10 ~ c2*sisoe7
ine12 ~ d2*proe10
###### Covariances ######
sisoe5 ~~ proe5
proe5 ~~ ine5
sisoe5 ~~ ine5
sisoe7 ~~ proe7
proe7 ~~ ine7
sisoe7 ~~ ine7
sisoe10 ~~ proe10
proe10 ~~ ine10
sisoe10 ~~ ine10
sisoe12 ~~ proe12
proe12 ~~ ine12
sisoe12 ~~ ine12
###### Variances ######
## Variances
ine5 ~~ ine5
sisoe5 ~~ sisoe5
proe5 ~~ proe5
## Residual variances
ine7 ~~ ine7
sisoe7 ~~ sisoe7
proe7 ~~ proe7
ine10 ~~ ine10
sisoe10 ~~ sisoe10
proe10 ~~ proe10
ine12 ~~ ine12
sisoe12 ~~ sisoe12
proe12 ~~ proe12
###### Indirect effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
med_inat.long.pro.fit <- lavaan(model = med_inat.long.pro,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_inat.long.pro.fit.summary <- summary(med_inat.long.pro.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 101 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 582.895 416.384 Degrees of freedom 27 27 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.400 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7855.903 5065.773 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.551
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.929 0.922 Tucker-Lewis Index (TLI) 0.826 0.810
Robust Comparative Fit Index (CFI) 0.930 Robust Tucker-Lewis Index (TLI) 0.828
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -48077.646 -48077.646 Scaling correction factor 1.934 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.773 for the MLR correction
Akaike (AIC) 96281.293 96281.293 Bayesian (BIC) 96641.064 96641.064 Sample-size adjusted Bayesian (BIC) 96440.903 96440.903
Root Mean Square Error of Approximation:
RMSEA 0.096 0.080 90 Percent confidence interval - lower 0.089 0.075 90 Percent confidence interval - upper 0.103 0.086 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.095 90 Percent confidence interval - lower 0.087 90 Percent confidence interval - upper 0.103
Standardized Root Mean Square Residual:
SRMR 0.062 0.062
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.439 0.043 10.227 0.000 0.439 0.423 sisoe10 ~
sisoe7 0.479 0.037 12.894 0.000 0.479 0.434 sisoe12 ~
sisoe10 0.566 0.033 17.001 0.000 0.566 0.535 proe7 ~
proe5 0.374 0.022 17.323 0.000 0.374 0.372 proe10 ~
proe7 0.327 0.022 14.898 0.000 0.327 0.346 proe12 ~
proe10 0.394 0.026 15.323 0.000 0.394 0.369 ine7 ~
ine5 0.471 0.031 14.946 0.000 0.471 0.501 ine10 ~
ine7 0.447 0.034 13.151 0.000 0.447 0.442 ine12 ~
ine10 0.557 0.034 16.178 0.000 0.557 0.552 ine7 ~
sisoe5 0.045 0.034 1.331 0.183 0.045 0.038 ine10 ~
sisoe7 0.063 0.033 1.876 0.061 0.063 0.055 ine12 ~
sisoe10 0.031 0.027 1.124 0.261 0.031 0.029 sisoe7 ~
ine5 0.088 0.022 4.058 0.000 0.088 0.107 sisoe10 ~
ine7 0.127 0.026 4.877 0.000 0.127 0.131 sisoe12 ~
ine10 0.100 0.026 3.857 0.000 0.100 0.099 sisoe7 ~
proe5 -0.039 0.008 -4.754 0.000 -0.039 -0.108 ine7 ~
proe5 -0.034 0.009 -3.942 0.000 -0.034 -0.082 proe12 ~
sisoe10 -0.224 0.065 -3.458 0.001 -0.224 -0.089 ine10 -0.188 0.056 -3.381 0.001 -0.188 -0.078 proe7 ~
ine5 (a1) -0.247 0.050 -4.981 0.000 -0.247 -0.109 sisoe10 ~
proe7 (b1) -0.015 0.009 -1.737 0.082 -0.015 -0.037 proe10 ~
ine7 (a2) -0.161 0.056 -2.872 0.004 -0.161 -0.070 sisoe12 ~
proe10 (b2) -0.008 0.009 -0.980 0.327 -0.008 -0.019 proe7 ~
sisoe5 (c1) -0.183 0.072 -2.534 0.011 -0.183 -0.064 ine10 ~
proe7 (d1) -0.044 0.009 -4.746 0.000 -0.044 -0.105 proe10 ~
sisoe7 (c2) -0.208 0.064 -3.273 0.001 -0.208 -0.080 ine12 ~
proe10 (d2) -0.044 0.010 -4.453 0.000 -0.044 -0.099
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
proe5 -0.936 0.101 -9.315 0.000 -0.936 -0.256 proe5 ~~
ine5 -1.213 0.131 -9.251 0.000 -1.213 -0.264 sisoe5 ~~
ine5 0.627 0.074 8.476 0.000 0.627 0.388 .sisoe7 ~~
.proe7 -0.551 0.076 -7.210 0.000 -0.551 -0.188 .proe7 ~~
.ine7 -0.508 0.078 -6.560 0.000 -0.508 -0.156 .sisoe7 ~~
.ine7 0.274 0.038 7.281 0.000 0.274 0.243 .sisoe10 ~~
.proe10 -0.738 0.082 -8.997 0.000 -0.738 -0.236 .proe10 ~~
.ine10 -0.559 0.090 -6.235 0.000 -0.559 -0.171 .sisoe10 ~~
.ine10 0.338 0.049 6.919 0.000 0.338 0.261 .sisoe12 ~~
.proe12 -0.606 0.086 -7.014 0.000 -0.606 -0.185 .proe12 ~~
.ine12 -0.509 0.088 -5.811 0.000 -0.509 -0.159 .sisoe12 ~~
.ine12 0.355 0.047 7.531 0.000 0.355 0.293
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.952 0.137 6.954 0.000 0.952 0.810 .sisoe10 0.667 0.137 4.860 0.000 0.667 0.514 .sisoe12 0.467 0.145 3.215 0.001 0.467 0.340 .proe7 9.730 0.344 28.259 0.000 9.730 2.999 .proe10 11.047 0.354 31.210 0.000 11.047 3.604 .proe12 9.422 0.439 21.449 0.000 9.422 2.876 .ine7 0.748 0.138 5.431 0.000 0.748 0.559 .ine10 0.997 0.152 6.544 0.000 0.997 0.739 .ine12 0.928 0.169 5.501 0.000 0.928 0.681 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 proe5 14.127 0.068 206.791 0.000 14.127 4.377 ine5 0.877 0.030 29.074 0.000 0.877 0.615
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all ine5 2.029 0.124 16.409 0.000 2.029 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 proe5 10.417 0.320 32.602 0.000 10.417 1.000 .ine7 1.257 0.072 17.403 0.000 1.257 0.703 .sisoe7 1.014 0.061 16.488 0.000 1.014 0.733 .proe7 8.488 0.240 35.387 0.000 8.488 0.806 .ine10 1.355 0.087 15.567 0.000 1.355 0.743 .sisoe10 1.244 0.076 16.458 0.000 1.244 0.739 .proe10 7.842 0.266 29.470 0.000 7.842 0.835 .ine12 1.188 0.085 14.057 0.000 1.188 0.640 .sisoe12 1.237 0.081 15.283 0.000 1.237 0.657 .proe12 8.679 0.291 29.875 0.000 8.679 0.809
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1a 0.004 0.002 1.633 0.103 0.004 0.004 indirect1b 0.001 0.002 0.906 0.365 0.001 0.001 indirect2a 0.008 0.004 2.201 0.028 0.008 0.007 indirect2b 0.009 0.003 2.826 0.005 0.009 0.008
med_inat.long2.pro <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Pro social bahviour
proe7 ~ proe5
proe10 ~ proe7
proe12 ~ proe10
## ADHD
ine7 ~ ine5
ine10 ~ ine7
ine12 ~ ine10
###### Cross lag paths ######
## Isolation
ine7 ~ e*sisoe5
ine10 ~ e*sisoe7
ine12 ~ e*sisoe10
## ADHD
sisoe7 ~ f*ine5
sisoe10 ~ f*ine7
sisoe12 ~ f*ine10
## Prosocial
sisoe7 ~ b*proe5
ine7 ~ d*proe5
proe12 ~ c*sisoe10
proe12 ~ a*ine10
###### mediation paths ######
## ADHD to Isolation
proe7 ~ a*ine5
sisoe10 ~ b*proe7
proe10 ~ a*ine7
sisoe12 ~ b*proe10
## Isolation to ADHD
proe7 ~ c*sisoe5
ine10 ~ d*proe7
proe10 ~ c*sisoe7
ine12 ~ d*proe10
###### Covariances ######
sisoe5 ~~ proe5
proe5 ~~ ine5
sisoe5 ~~ ine5
sisoe7 ~~ proe7
proe7 ~~ ine7
sisoe7 ~~ ine7
sisoe10 ~~ proe10
proe10 ~~ ine10
sisoe10 ~~ ine10
sisoe12 ~~ proe12
proe12 ~~ ine12
sisoe12 ~~ ine12
###### Variances ######
## Variances
ine5 ~~ ine5
sisoe5 ~~ sisoe5
proe5 ~~ proe5
## Residual variances
ine7 ~~ ine7
sisoe7 ~~ sisoe7
proe7 ~~ proe7
ine10 ~~ ine10
sisoe10 ~~ sisoe10
proe10 ~~ proe10
ine12 ~~ ine12
sisoe12 ~~ sisoe12
proe12 ~~ proe12
###### Indirect effects (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
med_inat.long2.pro.fit <- lavaan(model = med_inat.long2.pro,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_inat.long2.pro.fit.summary <- summary(med_inat.long2.pro.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 70 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 601.332 424.873 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.415 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7855.903 5065.773 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.551
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.928 0.923 Tucker-Lewis Index (TLI) 0.878 0.869
Robust Comparative Fit Index (CFI) 0.930 Robust Tucker-Lewis Index (TLI) 0.881
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -48086.865 -48086.865 Scaling correction factor 1.657 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.773 for the MLR correction
Akaike (AIC) 96275.730 96275.730 Bayesian (BIC) 96566.973 96566.973 Sample-size adjusted Bayesian (BIC) 96404.938 96404.938
Root Mean Square Error of Approximation:
RMSEA 0.080 0.067 90 Percent confidence interval - lower 0.075 0.062 90 Percent confidence interval - upper 0.086 0.071 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.079 90 Percent confidence interval - lower 0.073 90 Percent confidence interval - upper 0.086
Standardized Root Mean Square Residual:
SRMR 0.063 0.063
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.445 0.041 10.831 0.000 0.445 0.429 sisoe10 ~
sisoe7 0.479 0.034 14.064 0.000 0.479 0.435 sisoe12 ~
sisoe10 0.557 0.030 18.493 0.000 0.557 0.524 proe7 ~
proe5 0.373 0.020 18.319 0.000 0.373 0.373 proe10 ~
proe7 0.324 0.021 15.825 0.000 0.324 0.342 proe12 ~
proe10 0.400 0.024 16.356 0.000 0.400 0.374 ine7 ~
ine5 0.466 0.030 15.763 0.000 0.466 0.496 ine10 ~
ine7 0.452 0.031 14.472 0.000 0.452 0.449 ine12 ~
ine10 0.557 0.033 16.812 0.000 0.557 0.550 ine7 ~
sisoe5 (e) 0.045 0.016 2.706 0.007 0.045 0.038 ine10 ~
sisoe7 (e) 0.045 0.016 2.706 0.007 0.045 0.039 ine12 ~
sisoe10 (e) 0.045 0.016 2.706 0.007 0.045 0.042 sisoe7 ~
ine5 (f) 0.103 0.014 7.480 0.000 0.103 0.125 sisoe10 ~
ine7 (f) 0.103 0.014 7.480 0.000 0.103 0.107 sisoe12 ~
ine10 (f) 0.103 0.014 7.480 0.000 0.103 0.101 sisoe7 ~
proe5 (b) -0.023 0.005 -4.746 0.000 -0.023 -0.063 ine7 ~
proe5 (d) -0.041 0.005 -7.567 0.000 -0.041 -0.099 proe12 ~
sisoe10 (c) -0.206 0.037 -5.586 0.000 -0.206 -0.081 ine10 (a) -0.198 0.032 -6.275 0.000 -0.198 -0.081 proe7 ~
ine5 (a) -0.198 0.032 -6.275 0.000 -0.198 -0.087 sisoe10 ~
proe7 (b) -0.023 0.005 -4.746 0.000 -0.023 -0.057 proe10 ~
ine7 (a) -0.198 0.032 -6.275 0.000 -0.198 -0.087 sisoe12 ~
proe10 (b) -0.023 0.005 -4.746 0.000 -0.023 -0.051 proe7 ~
sisoe5 (c) -0.206 0.037 -5.586 0.000 -0.206 -0.072 ine10 ~
proe7 (d) -0.041 0.005 -7.567 0.000 -0.041 -0.098 proe10 ~
sisoe7 (c) -0.206 0.037 -5.586 0.000 -0.206 -0.079 ine12 ~
proe10 (d) -0.041 0.005 -7.567 0.000 -0.041 -0.092
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
proe5 -0.936 0.101 -9.315 0.000 -0.936 -0.256 proe5 ~~
ine5 -1.213 0.131 -9.251 0.000 -1.213 -0.264 sisoe5 ~~
ine5 0.627 0.074 8.476 0.000 0.627 0.388 .sisoe7 ~~
.proe7 -0.550 0.077 -7.166 0.000 -0.550 -0.187 .proe7 ~~
.ine7 -0.508 0.078 -6.553 0.000 -0.508 -0.156 .sisoe7 ~~
.ine7 0.273 0.038 7.231 0.000 0.273 0.241 .sisoe10 ~~
.proe10 -0.736 0.082 -8.970 0.000 -0.736 -0.236 .proe10 ~~
.ine10 -0.559 0.090 -6.217 0.000 -0.559 -0.171 .sisoe10 ~~
.ine10 0.338 0.049 6.909 0.000 0.338 0.260 .sisoe12 ~~
.proe12 -0.607 0.087 -7.010 0.000 -0.607 -0.185 .proe12 ~~
.ine12 -0.509 0.088 -5.802 0.000 -0.509 -0.158 .sisoe12 ~~
.ine12 0.355 0.047 7.514 0.000 0.355 0.292
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.703 0.083 8.437 0.000 0.703 0.598 .sisoe10 0.804 0.082 9.818 0.000 0.804 0.621 .sisoe12 0.698 0.084 8.342 0.000 0.698 0.507 .proe7 9.719 0.311 31.218 0.000 9.719 3.006 .proe10 11.110 0.322 34.535 0.000 11.110 3.621 .proe12 9.317 0.404 23.087 0.000 9.317 2.839 .ine7 0.852 0.088 9.665 0.000 0.852 0.636 .ine10 0.966 0.091 10.646 0.000 0.966 0.717 .ine12 0.865 0.095 9.144 0.000 0.865 0.635 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 proe5 14.127 0.068 206.791 0.000 14.127 4.377 ine5 0.877 0.030 29.074 0.000 0.877 0.615
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all ine5 2.029 0.124 16.409 0.000 2.029 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 proe5 10.417 0.320 32.602 0.000 10.417 1.000 .ine7 1.258 0.072 17.390 0.000 1.258 0.701 .sisoe7 1.017 0.062 16.428 0.000 1.017 0.737 .proe7 8.491 0.240 35.443 0.000 8.491 0.812 .ine10 1.355 0.087 15.571 0.000 1.355 0.748 .sisoe10 1.245 0.076 16.451 0.000 1.245 0.744 .proe10 7.844 0.266 29.478 0.000 7.844 0.833 .ine12 1.189 0.085 14.050 0.000 1.189 0.640 .sisoe12 1.239 0.081 15.267 0.000 1.239 0.655 .proe12 8.680 0.290 29.892 0.000 8.680 0.806
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1 0.005 0.001 3.812 0.000 0.005 0.005 indirect2 0.008 0.002 4.676 0.000 0.008 0.008
The cross-lag constraints gave a non-significant loss in model fit (p=0.3934). Therefore this model 2 will be carried forward.
# Model fit
med_inat.long2.pro.fit.summary.fit <- table.model.fit(med_inat.long2.pro.fit.summary)
# Coefficients
med_inat.long2.pro.fit.summary.reg <- table.model.coef(model = med_inat.long2.pro.fit.summary, step = "S2") %>% mutate_if(is.numeric, round, 3)
med_inat.long2.pro.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue)
ri.med_inat.long.pro.full <- '
###### Create random intercepts ######
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12
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*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
## antisocial
wpro5 =~ 1*proe5
wpro7 =~ 1*proe7
wpro10 =~ 1*proe10
wpro12 =~ 1*proe12
###### Autoregressive lags ######
## Isolation
wsi7 ~ wsi5
wsi10 ~ wsi7
wsi12 ~ wsi10
## antisocial bahviour
wpro7 ~ wpro5
wpro10 ~ wpro7
wpro12 ~ wpro10
## ADHD
wad7 ~ wad5
wad10 ~ wad7
wad12 ~ wad10
###### Cross lag paths ######
## Isolation
wad7 ~ wsi5
wad10 ~ wsi7
wad12 ~ wsi10
## ADHD
wsi7 ~ wad5
wsi10 ~ wad7
wsi12 ~ wad10
## antisocial
wsi7 ~ wpro5
wad7 ~ wpro5
wpro12 ~ wsi10
wpro12 ~ wad10
###### Mediation paths ######
## ADHD to Isolation
wpro7 ~ a1*wad5
wsi10 ~ b1*wpro7
wpro10 ~ a2*wad7
wsi12 ~ b2*wpro10
## Isolation to ADHD
wpro7 ~ wsi5
wad10 ~ wpro7
wpro10 ~ wsi7
wad12 ~ 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) ######
indirect1 := a1*b1
indirect2 := a2*b2
'
ri.med_inat.long.pro.full.fit <- lavaan(model = ri.med_inat.long.pro.full,
data = dat,
missing = 'ML',
meanstructure = TRUE,
se = "robust",
int.ov.free = TRUE,
estimator = "MLR")
ri.med_inat.long.pro.full.fit.summary <- summary(ri.med_inat.long.pro.full.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 125 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 80.046 59.556 Degrees of freedom 21 21 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.344 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7855.903 5065.773 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.551
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.992 Tucker-Lewis Index (TLI) 0.976 0.976
Robust Comparative Fit Index (CFI) 0.993 Robust Tucker-Lewis Index (TLI) 0.979
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -47826.222 -47826.222 Scaling correction factor 1.904 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.773 for the MLR correction
Akaike (AIC) 95790.444 95790.444 Bayesian (BIC) 96184.479 96184.479 Sample-size adjusted Bayesian (BIC) 95965.255 95965.255
Root Mean Square Error of Approximation:
RMSEA 0.035 0.029 90 Percent confidence interval - lower 0.027 0.021 90 Percent confidence interval - upper 0.044 0.036 P-value RMSEA <= 0.05 0.998 1.000
Robust RMSEA 0.033 90 Percent confidence interval - lower 0.023 90 Percent confidence interval - upper 0.043
Standardized Root Mean Square Residual:
SRMR 0.023 0.023
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.905 0.632 ine7 1.000 0.905 0.681 ine10 1.000 0.905 0.671 ine12 1.000 0.905 0.668 RIsi =~
sisoe5 1.000 0.679 0.592 sisoe7 1.000 0.679 0.579 sisoe10 1.000 0.679 0.526 sisoe12 1.000 0.679 0.502 RIpro =~
proe5 1.000 1.787 0.551 proe7 1.000 1.787 0.556 proe10 1.000 1.787 0.581 proe12 1.000 1.787 0.546 wsi5 =~
sisoe5 1.000 0.925 0.806 wsi7 =~
sisoe7 1.000 0.955 0.815 wsi10 =~
sisoe10 1.000 1.097 0.850 wsi12 =~
sisoe12 1.000 1.169 0.865 wad5 =~
ine5 1.000 1.108 0.775 wad7 =~
ine7 1.000 0.972 0.732 wad10 =~
ine10 1.000 1.000 0.741 wad12 =~
ine12 1.000 1.009 0.745 wpro5 =~
proe5 1.000 2.708 0.835 wpro7 =~
proe7 1.000 2.669 0.831 wpro10 =~
proe10 1.000 2.500 0.814 wpro12 =~
proe12 1.000 2.744 0.838
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.208 0.059 3.522 0.000 0.202 0.202 wsi10 ~
wsi7 0.283 0.058 4.872 0.000 0.247 0.247 wsi12 ~
wsi10 0.444 0.045 9.920 0.000 0.417 0.417 wpro7 ~
wpro5 0.148 0.031 4.839 0.000 0.150 0.150 wpro10 ~
wpro7 0.084 0.034 2.496 0.013 0.089 0.089 wpro12 ~
wpro10 0.146 0.039 3.790 0.000 0.133 0.133 wad7 ~
wad5 0.154 0.048 3.225 0.001 0.176 0.176 wad10 ~
wad7 0.031 0.062 0.493 0.622 0.030 0.030 wad12 ~
wad10 0.239 0.056 4.287 0.000 0.236 0.236 wad7 ~
wsi5 0.034 0.044 0.776 0.438 0.033 0.033 wad10 ~
wsi7 0.068 0.054 1.249 0.212 0.065 0.065 wad12 ~
wsi10 0.028 0.040 0.711 0.477 0.031 0.031 wsi7 ~
wad5 0.065 0.035 1.857 0.063 0.076 0.076 wsi10 ~
wad7 0.079 0.047 1.685 0.092 0.070 0.070 wsi12 ~
wad10 0.016 0.045 0.354 0.724 0.014 0.014 wsi7 ~
wpro5 -0.022 0.011 -2.049 0.040 -0.063 -0.063 wad7 ~
wpro5 -0.005 0.011 -0.431 0.667 -0.013 -0.013 wpro12 ~
wsi10 -0.184 0.087 -2.111 0.035 -0.074 -0.074 wad10 0.005 0.090 0.050 0.960 0.002 0.002 wpro7 ~
wad5 (a1) -0.078 0.072 -1.088 0.277 -0.033 -0.033 wsi10 ~
wpro7 (b1) 0.002 0.013 0.139 0.889 0.004 0.004 wpro10 ~
wad7 (a2) 0.134 0.093 1.435 0.151 0.052 0.052 wsi12 ~
wpro10 (b2) 0.017 0.013 1.274 0.203 0.036 0.036 wpro7 ~
wsi5 -0.040 0.097 -0.417 0.677 -0.014 -0.014 wad10 ~
wpro7 -0.020 0.013 -1.518 0.129 -0.053 -0.053 wpro10 ~
wsi7 -0.096 0.109 -0.874 0.382 -0.037 -0.037 wad12 ~
wpro10 -0.021 0.014 -1.548 0.122 -0.052 -0.052
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.330 0.092 -3.570 0.000 -0.132 -0.132 wad5 ~~
wpro5 -0.329 0.106 -3.119 0.002 -0.110 -0.110 wsi5 ~~
wad5 0.314 0.067 4.669 0.000 0.306 0.306 .wsi7 ~~
.wpro7 -0.383 0.088 -4.371 0.000 -0.157 -0.157 .wad7 ~~
.wpro7 -0.263 0.082 -3.213 0.001 -0.105 -0.105 .wsi7 ~~
.wad7 0.198 0.046 4.304 0.000 0.225 0.225 .wsi10 ~~
.wpro10 -0.566 0.094 -6.055 0.000 -0.216 -0.216 .wad10 ~~
.wpro10 -0.257 0.098 -2.628 0.009 -0.104 -0.104 .wsi10 ~~
.wad10 0.276 0.056 4.903 0.000 0.263 0.263 .wsi12 ~~
.wpro12 -0.414 0.083 -4.960 0.000 -0.144 -0.144 .wad12 ~~
.wpro12 -0.334 0.082 -4.067 0.000 -0.127 -0.127 .wsi12 ~~
.wad12 0.269 0.046 5.824 0.000 0.260 0.260 RIad ~~
RIsi 0.339 0.040 8.389 0.000 0.553 0.553 RIpro -0.865 0.087 -9.915 0.000 -0.535 -0.535 RIsi ~~
RIpro -0.667 0.080 -8.308 0.000 -0.550 -0.550
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.877 0.030 29.074 0.000 0.877 0.613 .ine7 0.718 0.029 25.148 0.000 0.718 0.541 .ine10 0.727 0.029 25.106 0.000 0.727 0.539 .ine12 0.674 0.029 23.146 0.000 0.674 0.497 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.708 .sisoe7 0.831 0.025 33.076 0.000 0.831 0.709 .sisoe10 0.940 0.028 33.735 0.000 0.940 0.729 .sisoe12 0.941 0.029 31.940 0.000 0.941 0.696 .proe5 14.127 0.068 206.791 0.000 14.127 4.354 .proe7 14.652 0.069 211.365 0.000 14.652 4.561 .proe10 15.547 0.066 235.145 0.000 15.547 5.059 .proe12 15.202 0.071 215.407 0.000 15.202 4.643 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 1.228 0.097 12.611 0.000 1.000 1.000 wsi5 0.856 0.102 8.426 0.000 1.000 1.000 wpro5 7.335 0.301 24.334 0.000 1.000 1.000 .wad7 0.910 0.077 11.862 0.000 0.964 0.964 .wsi7 0.854 0.072 11.903 0.000 0.936 0.936 .wpro7 6.943 0.260 26.680 0.000 0.974 0.974 .wad10 0.989 0.099 10.004 0.000 0.990 0.990 .wsi10 1.115 0.081 13.836 0.000 0.926 0.926 .wpro10 6.181 0.283 21.857 0.000 0.989 0.989 .wad12 0.951 0.078 12.171 0.000 0.933 0.933 .wsi12 1.131 0.081 13.881 0.000 0.828 0.828 .wpro12 7.322 0.284 25.775 0.000 0.973 0.973 RIad 0.819 0.067 12.140 0.000 1.000 1.000 RIsi 0.461 0.058 8.000 0.000 1.000 1.000 RIpro 3.192 0.230 13.904 0.000 1.000 1.000 .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 .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 indirect1 -0.000 0.001 -0.140 0.889 -0.000 -0.000 indirect2 0.002 0.003 0.875 0.382 0.002 0.002
ri.med_inat.long.pro.full2 <- '
###### Create random intercepts ######
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12
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*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
## 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 ~ e*wsi5
wad10 ~ e*wsi7
wad12 ~ e*wsi10
## ADHD
wsi7 ~ f*wad5
wsi10 ~ f*wad7
wsi12 ~ f*wad10
## prosocial
wsi7 ~ b*wpro5
wad7 ~ d*wpro5
wpro12 ~ c*wsi10
wpro12 ~ a*wad10
###### Mediation paths ######
## ADHD to Isolation
wpro7 ~ a*wad5
wsi10 ~ b*wpro7
wpro10 ~ a*wad7
wsi12 ~ b*wpro10
## Isolation to ADHD
wpro7 ~ c*wsi5
wad10 ~ d*wpro7
wpro10 ~ c*wsi7
wad12 ~ 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
###### Indirect effect (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
ri.med_inat.long.pro.full2.fit <- lavaan(model = ri.med_inat.long.pro.full2,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
ri.med_inat.long.pro.full2.fit.summary <- summary(ri.med_inat.long.pro.full2.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 115 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 102.917 74.423 Degrees of freedom 33 33 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.383 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 7855.903 5065.773 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.551
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.991 0.992 Tucker-Lewis Index (TLI) 0.982 0.983
Robust Comparative Fit Index (CFI) 0.993 Robust Tucker-Lewis Index (TLI) 0.985
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -47837.658 -47837.658 Scaling correction factor 1.652 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.773 for the MLR correction
Akaike (AIC) 95789.315 95789.315 Bayesian (BIC) 96114.822 96114.822 Sample-size adjusted Bayesian (BIC) 95933.724 95933.724
Root Mean Square Error of Approximation:
RMSEA 0.031 0.024 90 Percent confidence interval - lower 0.024 0.018 90 Percent confidence interval - upper 0.038 0.030 P-value RMSEA <= 0.05 1.000 1.000
Robust RMSEA 0.028 90 Percent confidence interval - lower 0.019 90 Percent confidence interval - upper 0.036
Standardized Root Mean Square Residual:
SRMR 0.025 0.025
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.903 0.633 ine7 1.000 0.903 0.678 ine10 1.000 0.903 0.670 ine12 1.000 0.903 0.665 RIsi =~
sisoe5 1.000 0.688 0.598 sisoe7 1.000 0.688 0.589 sisoe10 1.000 0.688 0.535 sisoe12 1.000 0.688 0.508 RIpro =~
proe5 1.000 1.785 0.551 proe7 1.000 1.785 0.557 proe10 1.000 1.785 0.579 proe12 1.000 1.785 0.546 wsi5 =~
sisoe5 1.000 0.922 0.801 wsi7 =~
sisoe7 1.000 0.944 0.808 wsi10 =~
sisoe10 1.000 1.088 0.845 wsi12 =~
sisoe12 1.000 1.167 0.861 wad5 =~
ine5 1.000 1.104 0.774 wad7 =~
ine7 1.000 0.978 0.735 wad10 =~
ine10 1.000 0.999 0.742 wad12 =~
ine12 1.000 1.014 0.747 wpro5 =~
proe5 1.000 2.702 0.834 wpro7 =~
proe7 1.000 2.665 0.831 wpro10 =~
proe10 1.000 2.513 0.815 wpro12 =~
proe12 1.000 2.741 0.838
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.211 0.057 3.702 0.000 0.206 0.206 wsi10 ~
wsi7 0.273 0.054 5.027 0.000 0.237 0.237 wsi12 ~
wsi10 0.423 0.041 10.384 0.000 0.394 0.394 wpro7 ~
wpro5 0.142 0.030 4.659 0.000 0.144 0.144 wpro10 ~
wpro7 0.083 0.033 2.534 0.011 0.088 0.088 wpro12 ~
wpro10 0.158 0.037 4.298 0.000 0.145 0.145 wad7 ~
wad5 0.152 0.047 3.261 0.001 0.172 0.172 wad10 ~
wad7 0.044 0.060 0.746 0.455 0.044 0.044 wad12 ~
wad10 0.249 0.053 4.706 0.000 0.245 0.245 wad7 ~
wsi5 (e) 0.027 0.029 0.937 0.349 0.025 0.025 wad10 ~
wsi7 (e) 0.027 0.029 0.937 0.349 0.025 0.025 wad12 ~
wsi10 (e) 0.027 0.029 0.937 0.349 0.029 0.029 wsi7 ~
wad5 (f) 0.048 0.026 1.805 0.071 0.056 0.056 wsi10 ~
wad7 (f) 0.048 0.026 1.805 0.071 0.043 0.043 wsi12 ~
wad10 (f) 0.048 0.026 1.805 0.071 0.041 0.041 wsi7 ~
wpro5 (b) -0.005 0.008 -0.658 0.511 -0.015 -0.015 wad7 ~
wpro5 (d) -0.018 0.007 -2.432 0.015 -0.050 -0.050 wpro12 ~
wsi10 (c) -0.113 0.061 -1.850 0.064 -0.045 -0.045 wad10 (a) 0.008 0.049 0.172 0.864 0.003 0.003 wpro7 ~
wad5 (a) 0.008 0.049 0.172 0.864 0.004 0.004 wsi10 ~
wpro7 (b) -0.005 0.008 -0.658 0.511 -0.013 -0.013 wpro10 ~
wad7 (a) 0.008 0.049 0.172 0.864 0.003 0.003 wsi12 ~
wpro10 (b) -0.005 0.008 -0.658 0.511 -0.011 -0.011 wpro7 ~
wsi5 (c) -0.113 0.061 -1.850 0.064 -0.039 -0.039 wad10 ~
wpro7 (d) -0.018 0.007 -2.432 0.015 -0.048 -0.048 wpro10 ~
wsi7 (c) -0.113 0.061 -1.850 0.064 -0.042 -0.042 wad12 ~
wpro10 (d) -0.018 0.007 -2.432 0.015 -0.045 -0.045
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wpro5 -0.309 0.092 -3.350 0.001 -0.124 -0.124 wad5 ~~
wpro5 -0.332 0.101 -3.280 0.001 -0.111 -0.111 wsi5 ~~
wad5 0.300 0.063 4.766 0.000 0.295 0.295 .wsi7 ~~
.wpro7 -0.377 0.085 -4.437 0.000 -0.156 -0.156 .wad7 ~~
.wpro7 -0.281 0.078 -3.596 0.000 -0.111 -0.111 .wsi7 ~~
.wad7 0.181 0.044 4.093 0.000 0.205 0.205 .wsi10 ~~
.wpro10 -0.578 0.087 -6.647 0.000 -0.220 -0.220 .wad10 ~~
.wpro10 -0.279 0.089 -3.119 0.002 -0.112 -0.112 .wsi10 ~~
.wad10 0.264 0.052 5.074 0.000 0.252 0.252 .wsi12 ~~
.wpro12 -0.439 0.082 -5.341 0.000 -0.152 -0.152 .wad12 ~~
.wpro12 -0.326 0.079 -4.142 0.000 -0.123 -0.123 .wsi12 ~~
.wad12 0.277 0.045 6.168 0.000 0.266 0.266 RIad ~~
RIsi 0.352 0.039 9.070 0.000 0.566 0.566 RIpro -0.850 0.083 -10.202 0.000 -0.527 -0.527 RIsi ~~
RIpro -0.664 0.080 -8.311 0.000 -0.540 -0.540
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.877 0.030 29.074 0.000 0.877 0.615 .ine7 0.718 0.029 25.146 0.000 0.718 0.540 .ine10 0.727 0.029 25.122 0.000 0.727 0.540 .ine12 0.674 0.029 23.159 0.000 0.674 0.496 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.707 .sisoe7 0.831 0.025 33.074 0.000 0.831 0.711 .sisoe10 0.940 0.028 33.731 0.000 0.940 0.730 .sisoe12 0.941 0.029 31.928 0.000 0.941 0.695 .proe5 14.127 0.068 206.791 0.000 14.127 4.362 .proe7 14.652 0.069 211.379 0.000 14.652 4.568 .proe10 15.548 0.066 235.240 0.000 15.548 5.043 .proe12 15.201 0.071 215.369 0.000 15.201 4.647 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 1.220 0.096 12.662 0.000 1.000 1.000 wsi5 0.850 0.097 8.752 0.000 1.000 1.000 wpro5 7.299 0.304 24.030 0.000 1.000 1.000 .wad7 0.920 0.077 11.937 0.000 0.962 0.962 .wsi7 0.844 0.069 12.176 0.000 0.947 0.947 .wpro7 6.936 0.257 27.014 0.000 0.977 0.977 .wad10 0.992 0.096 10.318 0.000 0.994 0.994 .wsi10 1.109 0.080 13.941 0.000 0.936 0.936 .wpro10 6.250 0.276 22.636 0.000 0.989 0.989 .wad12 0.956 0.078 12.254 0.000 0.930 0.930 .wsi12 1.135 0.082 13.897 0.000 0.833 0.833 .wpro12 7.317 0.282 25.968 0.000 0.974 0.974 RIad 0.815 0.065 12.481 0.000 1.000 1.000 RIsi 0.474 0.056 8.492 0.000 1.000 1.000 RIpro 3.188 0.229 13.912 0.000 1.000 1.000 .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 .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 indirect1 -0.000 0.000 -0.169 0.865 -0.000 -0.000 indirect2 0.002 0.001 1.478 0.139 0.002 0.002
lavTestLRT(ri.med_inat.long.pro.full.fit, ri.med_inat.long.pro.full2.fit, method = "satorra.bentler.2010")
The cross-lag constraints gave a non-significant loss in model fit (p=0.2155).
# Model fit
ri.med_inat.long.pro.full2.fit.summary.fit <- table.model.fit(ri.med_inat.long.pro.full2.fit.summary)
# Coefficients -
ri.med_inat.long.pro.full2.fit.summary.reg <- table.model.coef(model = ri.med_inat.long.pro.full2.fit.summary, step = "S4") %>% mutate_if(is.numeric, round, 3)
ri.med_inat.long.pro.full2.fit.summary.reg %>%
select(lhs, op, rhs, std.all, pvalue) %>%
filter(lhs == "indirect1" | lhs == "indirect2")
med.long.asb <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Anti social bahviour
asbe7 ~ asbe5
asbe10 ~ asbe7
asbe12 ~ asbe10
## ADHD
tadhde7 ~ tadhde5
tadhde10 ~ tadhde7
tadhde12 ~ tadhde10
###### Cross lag paths ######
## Isolation
tadhde7 ~ sisoe5
tadhde10 ~ sisoe7
tadhde12 ~ sisoe10
## ADHD
sisoe7 ~ tadhde5
sisoe10 ~ tadhde7
sisoe12 ~ tadhde10
## antisocial
sisoe7 ~ asbe5
tadhde7 ~ asbe5
asbe12 ~ sisoe10
asbe12 ~ tadhde10
###### Mediation paths ######
## ADHD to Isolation
asbe7 ~ a1*tadhde5
sisoe10 ~ b1*asbe7
asbe10 ~ a2*tadhde7
sisoe12 ~ b2*asbe10
## Isolation to ADHD
asbe7 ~ c1*sisoe5
tadhde10 ~ d1*asbe7
asbe10 ~ c2*sisoe7
tadhde12 ~ d2*asbe10
###### Covariances ######
sisoe5 ~~ asbe5
asbe5 ~~ tadhde5
sisoe5 ~~ tadhde5
sisoe7 ~~ asbe7
asbe7 ~~ tadhde7
sisoe7 ~~ tadhde7
sisoe10 ~~ asbe10
asbe10 ~~ tadhde10
sisoe10 ~~ tadhde10
sisoe12 ~~ asbe12
asbe12 ~~ tadhde12
sisoe12 ~~ tadhde12
###### Variances ######
## Variances
tadhde5 ~~ tadhde5
sisoe5 ~~ sisoe5
asbe5 ~~ asbe5
## Residual variances
tadhde7 ~~ tadhde7
sisoe7 ~~ sisoe7
asbe7 ~~ asbe7
tadhde10 ~~ tadhde10
sisoe10 ~~ sisoe10
asbe10 ~~ asbe10
tadhde12 ~~ tadhde12
sisoe12 ~~ sisoe12
asbe12 ~~ asbe12
###### Indirect effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
med.long.asb.fit <- lavaan(model = med.long.asb,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med.long.asb.fit.summary <- summary(med.long.asb.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 151 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 585.234 372.950 Degrees of freedom 27 27 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.569 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 15084.484 8357.268 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.805
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.963 0.958 Tucker-Lewis Index (TLI) 0.909 0.898
Robust Comparative Fit Index (CFI) 0.964 Robust Tucker-Lewis Index (TLI) 0.911
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -59516.469 -59516.469 Scaling correction factor 2.227 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.030 for the MLR correction
Akaike (AIC) 119158.938 119158.938 Bayesian (BIC) 119518.709 119518.709 Sample-size adjusted Bayesian (BIC) 119318.548 119318.548
Root Mean Square Error of Approximation:
RMSEA 0.096 0.076 90 Percent confidence interval - lower 0.090 0.070 90 Percent confidence interval - upper 0.103 0.081 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.095 90 Percent confidence interval - lower 0.086 90 Percent confidence interval - upper 0.104
Standardized Root Mean Square Residual:
SRMR 0.064 0.064
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.426 0.044 9.763 0.000 0.426 0.410 sisoe10 ~
sisoe7 0.459 0.039 11.895 0.000 0.459 0.416 sisoe12 ~
sisoe10 0.517 0.034 15.227 0.000 0.517 0.488 asbe7 ~
asbe5 0.633 0.029 21.699 0.000 0.633 0.642 asbe10 ~
asbe7 0.638 0.036 17.518 0.000 0.638 0.594 asbe12 ~
asbe10 0.703 0.032 22.142 0.000 0.703 0.676 tadhde7 ~
tadhde5 0.459 0.034 13.700 0.000 0.459 0.489 tadhde10 ~
tadhde7 0.422 0.038 11.229 0.000 0.422 0.442 tadhde12 ~
tadhde10 0.547 0.040 13.524 0.000 0.547 0.532 tadhde7 ~
sisoe5 0.032 0.059 0.542 0.588 0.032 0.014 tadhde10 ~
sisoe7 0.015 0.064 0.237 0.812 0.015 0.007 tadhde12 ~
sisoe10 -0.092 0.048 -1.909 0.056 -0.092 -0.047 sisoe7 ~
tadhde5 0.019 0.014 1.378 0.168 0.019 0.044 sisoe10 ~
tadhde7 0.051 0.016 3.127 0.002 0.051 0.102 sisoe12 ~
tadhde10 0.029 0.016 1.773 0.076 0.029 0.053 sisoe7 ~
asbe5 0.020 0.005 4.362 0.000 0.020 0.153 tadhde7 ~
asbe5 0.041 0.009 4.704 0.000 0.041 0.146 asbe12 ~
sisoe10 -0.170 0.172 -0.988 0.323 -0.170 -0.022 tadhde10 0.281 0.109 2.586 0.010 0.281 0.069 asbe7 ~
tadhde5 (a1) 0.150 0.091 1.637 0.102 0.150 0.046 sisoe10 ~
asbe7 (b1) 0.011 0.005 2.127 0.033 0.011 0.075 asbe10 ~
tadhde7 (a2) 0.234 0.114 2.049 0.040 0.234 0.062 sisoe12 ~
asbe10 (b2) 0.019 0.005 3.769 0.000 0.019 0.133 asbe7 ~
sisoe5 (c1) -0.134 0.179 -0.749 0.454 -0.134 -0.017 tadhde10 ~
asbe7 (d1) 0.049 0.009 5.409 0.000 0.049 0.179 asbe10 ~
sisoe7 (c2) 0.093 0.216 0.429 0.668 0.093 0.011 tadhde12 ~
asbe10 (d2) 0.053 0.009 6.063 0.000 0.053 0.204
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
asbe5 4.469 0.407 10.986 0.000 4.469 0.429 asbe5 ~~
tadhde5 17.032 1.043 16.331 0.000 17.032 0.671 sisoe5 ~~
tadhde5 1.152 0.128 8.998 0.000 1.152 0.368 .sisoe7 ~~
.asbe7 3.002 0.296 10.141 0.000 3.002 0.442 .asbe7 ~~
.tadhde7 7.810 0.569 13.716 0.000 7.810 0.558 .sisoe7 ~~
.tadhde7 0.512 0.073 7.005 0.000 0.512 0.246 .sisoe10 ~~
.asbe10 3.560 0.304 11.710 0.000 3.560 0.429 .asbe10 ~~
.tadhde10 7.675 0.637 12.045 0.000 7.675 0.509 .sisoe10 ~~
.tadhde10 0.626 0.084 7.477 0.000 0.626 0.278 .sisoe12 ~~
.asbe12 3.044 0.317 9.599 0.000 3.044 0.388 .asbe12 ~~
.tadhde12 7.190 0.662 10.870 0.000 7.190 0.526 .sisoe12 ~~
.tadhde12 0.556 0.086 6.490 0.000 0.556 0.263
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.211 0.038 5.615 0.000 0.211 0.179 .sisoe10 0.353 0.038 9.171 0.000 0.353 0.272 .sisoe12 0.217 0.038 5.774 0.000 0.217 0.158 .asbe7 2.728 0.247 11.051 0.000 2.728 0.301 .asbe10 3.042 0.268 11.333 0.000 3.042 0.312 .asbe12 2.917 0.248 11.756 0.000 2.917 0.288 .tadhde7 0.266 0.073 3.622 0.000 0.266 0.103 .tadhde10 0.274 0.068 4.057 0.000 0.274 0.110 .tadhde12 0.141 0.061 2.314 0.021 0.141 0.055 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 asbe5 11.841 0.194 60.901 0.000 11.841 1.289 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 7.641 0.397 19.265 0.000 7.641 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 asbe5 84.369 4.076 20.697 0.000 84.369 1.000 .tadhde7 4.294 0.234 18.335 0.000 4.294 0.637 .sisoe7 1.010 0.060 16.728 0.000 1.010 0.730 .asbe7 45.616 2.601 17.538 0.000 45.616 0.556 .tadhde10 4.090 0.260 15.719 0.000 4.090 0.664 .sisoe10 1.239 0.076 16.227 0.000 1.239 0.736 .asbe10 55.662 3.247 17.142 0.000 55.662 0.587 .tadhde12 3.690 0.264 13.990 0.000 3.690 0.565 .sisoe12 1.214 0.079 15.462 0.000 1.214 0.644 .asbe12 50.699 2.881 17.596 0.000 50.699 0.494
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1a 0.002 0.001 1.292 0.197 0.002 0.003 indirect1b 0.004 0.002 1.796 0.073 0.004 0.008 indirect2a -0.007 0.009 -0.745 0.456 -0.007 -0.003 indirect2b 0.005 0.011 0.432 0.666 0.005 0.002
med.long2.asb <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Anti social bahviour
asbe7 ~ asbe5
asbe10 ~ asbe7
asbe12 ~ asbe10
## ADHD
tadhde7 ~ tadhde5
tadhde10 ~ tadhde7
tadhde12 ~ tadhde10
###### Cross lag paths ######
## Isolation
tadhde7 ~ e*sisoe5
tadhde10 ~ e*sisoe7
tadhde12 ~ e*sisoe10
## ADHD
sisoe7 ~ f*tadhde5
sisoe10 ~ f*tadhde7
sisoe12 ~ f*tadhde10
## Antisocial
sisoe7 ~ b*asbe5
tadhde7 ~ d*asbe5
asbe12 ~ c*sisoe10
asbe12 ~ a*tadhde10
###### Mediation paths ######
## ADHD to Isolation
asbe7 ~ a*tadhde5
sisoe10 ~ b*asbe7
asbe10 ~ a*tadhde7
sisoe12 ~ b*asbe10
## Isolation to ADHD
asbe7 ~ c*sisoe5
tadhde10 ~ d*asbe7
asbe10 ~ c*sisoe7
tadhde12 ~ d*asbe10
###### Covariances ######
sisoe5 ~~ asbe5
asbe5 ~~ tadhde5
sisoe5 ~~ tadhde5
sisoe7 ~~ asbe7
asbe7 ~~ tadhde7
sisoe7 ~~ tadhde7
sisoe10 ~~ asbe10
asbe10 ~~ tadhde10
sisoe10 ~~ tadhde10
sisoe12 ~~ asbe12
asbe12 ~~ tadhde12
sisoe12 ~~ tadhde12
###### Variances ######
## Variances
tadhde5 ~~ tadhde5
sisoe5 ~~ sisoe5
asbe5 ~~ asbe5
## Residual variances
tadhde7 ~~ tadhde7
sisoe7 ~~ sisoe7
asbe7 ~~ asbe7
tadhde10 ~~ tadhde10
sisoe10 ~~ sisoe10
asbe10 ~~ asbe10
tadhde12 ~~ tadhde12
sisoe12 ~~ sisoe12
asbe12 ~~ asbe12
###### Indirect effects (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
med.long2.asb.fit <- lavaan(model = med.long2.asb,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med.long2.asb.fit.summary <- summary(med.long2.asb.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 116 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 601.318 368.699 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.631 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 15084.484 8357.268 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.805
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.963 0.960 Tucker-Lewis Index (TLI) 0.937 0.933
Robust Comparative Fit Index (CFI) 0.964 Robust Tucker-Lewis Index (TLI) 0.939
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -59524.511 -59524.511 Scaling correction factor 1.890 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.030 for the MLR correction
Akaike (AIC) 119151.022 119151.022 Bayesian (BIC) 119442.265 119442.265 Sample-size adjusted Bayesian (BIC) 119280.230 119280.230
Root Mean Square Error of Approximation:
RMSEA 0.080 0.062 90 Percent confidence interval - lower 0.075 0.057 90 Percent confidence interval - upper 0.086 0.066 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.079 90 Percent confidence interval - lower 0.071 90 Percent confidence interval - upper 0.086
Standardized Root Mean Square Residual:
SRMR 0.064 0.064
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.429 0.040 10.846 0.000 0.429 0.412 sisoe10 ~
sisoe7 0.441 0.034 13.003 0.000 0.441 0.403 sisoe12 ~
sisoe10 0.526 0.031 16.744 0.000 0.526 0.496 asbe7 ~
asbe5 0.626 0.023 26.953 0.000 0.626 0.631 asbe10 ~
asbe7 0.654 0.027 23.895 0.000 0.654 0.611 asbe12 ~
asbe10 0.705 0.025 27.874 0.000 0.705 0.681 tadhde7 ~
tadhde5 0.459 0.028 16.278 0.000 0.459 0.486 tadhde10 ~
tadhde7 0.427 0.031 13.752 0.000 0.427 0.449 tadhde12 ~
tadhde10 0.539 0.035 15.397 0.000 0.539 0.526 tadhde7 ~
sisoe5 (e) -0.022 0.030 -0.716 0.474 -0.022 -0.009 tadhde10 ~
sisoe7 (e) -0.022 0.030 -0.716 0.474 -0.022 -0.010 tadhde12 ~
sisoe10 (e) -0.022 0.030 -0.716 0.474 -0.022 -0.011 sisoe7 ~
tadhde5 (f) 0.031 0.009 3.532 0.000 0.031 0.073 sisoe10 ~
tadhde7 (f) 0.031 0.009 3.532 0.000 0.031 0.063 sisoe12 ~
tadhde10 (f) 0.031 0.009 3.532 0.000 0.031 0.057 sisoe7 ~
asbe5 (b) 0.017 0.003 6.085 0.000 0.017 0.131 tadhde7 ~
asbe5 (d) 0.048 0.005 9.072 0.000 0.048 0.170 asbe12 ~
sisoe10 (c) -0.092 0.103 -0.894 0.371 -0.092 -0.012 tadhde10 (a) 0.210 0.059 3.533 0.000 0.210 0.052 asbe7 ~
tadhde5 (a) 0.210 0.059 3.533 0.000 0.210 0.064 sisoe10 ~
asbe7 (b) 0.017 0.003 6.085 0.000 0.017 0.118 asbe10 ~
tadhde7 (a) 0.210 0.059 3.533 0.000 0.210 0.056 sisoe12 ~
asbe10 (b) 0.017 0.003 6.085 0.000 0.017 0.120 asbe7 ~
sisoe5 (c) -0.092 0.103 -0.894 0.371 -0.092 -0.011 tadhde10 ~
asbe7 (d) 0.048 0.005 9.072 0.000 0.048 0.178 asbe10 ~
sisoe7 (c) -0.092 0.103 -0.894 0.371 -0.092 -0.011 tadhde12 ~
asbe10 (d) 0.048 0.005 9.072 0.000 0.048 0.186
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
asbe5 4.469 0.407 10.986 0.000 4.469 0.429 asbe5 ~~
tadhde5 17.033 1.043 16.331 0.000 17.033 0.671 sisoe5 ~~
tadhde5 1.152 0.128 8.998 0.000 1.152 0.368 .sisoe7 ~~
.asbe7 3.005 0.295 10.190 0.000 3.005 0.442 .asbe7 ~~
.tadhde7 7.811 0.568 13.751 0.000 7.811 0.558 .sisoe7 ~~
.tadhde7 0.512 0.073 7.019 0.000 0.512 0.245 .sisoe10 ~~
.asbe10 3.565 0.304 11.710 0.000 3.565 0.429 .asbe10 ~~
.tadhde10 7.682 0.640 12.001 0.000 7.682 0.509 .sisoe10 ~~
.tadhde10 0.626 0.084 7.450 0.000 0.626 0.278 .sisoe12 ~~
.asbe12 3.045 0.317 9.598 0.000 3.045 0.388 .asbe12 ~~
.tadhde12 7.202 0.663 10.860 0.000 7.202 0.526 .sisoe12 ~~
.tadhde12 0.557 0.086 6.486 0.000 0.557 0.263
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.213 0.031 6.848 0.000 0.213 0.181 .sisoe10 0.340 0.029 11.674 0.000 0.340 0.263 .sisoe12 0.224 0.028 8.057 0.000 0.224 0.164 .asbe7 2.650 0.217 12.211 0.000 2.650 0.291 .asbe10 3.074 0.220 13.943 0.000 3.074 0.315 .asbe12 2.934 0.217 13.517 0.000 2.934 0.290 .tadhde7 0.223 0.055 4.042 0.000 0.223 0.085 .tadhde10 0.304 0.047 6.452 0.000 0.304 0.122 .tadhde12 0.139 0.043 3.251 0.001 0.139 0.055 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 asbe5 11.841 0.194 60.901 0.000 11.841 1.289 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 7.641 0.397 19.265 0.000 7.641 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 asbe5 84.369 4.076 20.697 0.000 84.369 1.000 .tadhde7 4.300 0.234 18.362 0.000 4.300 0.629 .sisoe7 1.011 0.060 16.732 0.000 1.011 0.726 .asbe7 45.634 2.596 17.577 0.000 45.634 0.550 .tadhde10 4.092 0.261 15.699 0.000 4.092 0.664 .sisoe10 1.241 0.077 16.204 0.000 1.241 0.741 .asbe10 55.703 3.257 17.104 0.000 55.703 0.585 .tadhde12 3.697 0.265 13.960 0.000 3.697 0.572 .sisoe12 1.215 0.079 15.451 0.000 1.215 0.644 .asbe12 50.725 2.879 17.617 0.000 50.725 0.497
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1 0.004 0.001 3.502 0.000 0.004 0.007 indirect2 -0.004 0.005 -0.878 0.380 -0.004 -0.002
The cross-lag constraints gave a non-significant loss in model fit (p=0.6973). Therefore this model 2 will be carried forward.
# Model fit
med.long2.asb.fit.summary.fit <- table.model.fit(med.long2.asb.fit.summary)
# Coefficients
med.long2.asb.fit.summary.reg <- table.model.coef(model = med.long2.asb.fit.summary, step = "S2") %>% mutate_if(is.numeric, round, 3)
med.long2.asb.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue)
ri.med.long.asb.full <- '
###### 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
## Anti social bahviour
wasb7 ~ wasb5
wasb10 ~ wasb7
wasb12 ~ wasb10
## ADHD
wad7 ~ wad5
wad10 ~ wad7
wad12 ~ wad10
###### Cross lag paths ######
## Isolation
wad7 ~ wsi5
wad10 ~ wsi7
wad12 ~ wsi10
## ADHD
wsi7 ~ wad5
wsi10 ~ wad7
wsi12 ~ wad10
## asbsocial
wsi7 ~ wasb5
wad7 ~ wasb5
wasb12 ~ wsi10
wasb12 ~ wad10
###### Mediation paths ######
## ADHD to Isolation
wasb7 ~ a1*wad5
wsi10 ~ b1*wasb7
wasb10 ~ a2*wad7
wsi12 ~ b2*wasb10
## Isolation to ADHD
wasb7 ~ wsi5
wad10 ~ wasb7
wasb10 ~ wsi7
wad12 ~ 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) ######
indirect1 := a1*b1
indirect2 := a2*b2
'
ri.med.long.asb.full.fit <- lavaan(model = ri.med.long.asb.full,
data = dat,
missing = 'ML',
meanstructure = TRUE,
se = "robust",
int.ov.free = TRUE,
estimator = "MLR")
ri.med.long.asb.full.fit.summary <- summary(ri.med.long.asb.full.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 358 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 87.640 59.552 Degrees of freedom 21 21 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.472 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 15084.484 8357.268 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.805
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.996 0.995 Tucker-Lewis Index (TLI) 0.986 0.985
Robust Comparative Fit Index (CFI) 0.996 Robust Tucker-Lewis Index (TLI) 0.988
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -59267.672 -59267.672 Scaling correction factor 2.199 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.030 for the MLR correction
Akaike (AIC) 118673.344 118673.344 Bayesian (BIC) 119067.379 119067.379 Sample-size adjusted Bayesian (BIC) 118848.156 118848.156
Root Mean Square Error of Approximation:
RMSEA 0.038 0.029 90 Percent confidence interval - lower 0.030 0.022 90 Percent confidence interval - upper 0.046 0.036 P-value RMSEA <= 0.05 0.993 1.000
Robust RMSEA 0.035 90 Percent confidence interval - lower 0.025 90 Percent confidence interval - upper 0.045
Standardized Root Mean Square Residual:
SRMR 0.031 0.031
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.781 0.641 tadhde7 1.000 1.781 0.695 tadhde10 1.000 1.781 0.713 tadhde12 1.000 1.781 0.703 RIsi =~
sisoe5 1.000 0.686 0.597 sisoe7 1.000 0.686 0.585 sisoe10 1.000 0.686 0.532 sisoe12 1.000 0.686 0.507 RIasb =~
asbe5 1.000 6.849 0.743 asbe7 1.000 6.849 0.762 asbe10 1.000 6.849 0.706 asbe12 1.000 6.849 0.686 wsi5 =~
sisoe5 1.000 0.921 0.802 wsi7 =~
sisoe7 1.000 0.952 0.811 wsi10 =~
sisoe10 1.000 1.091 0.847 wsi12 =~
sisoe12 1.000 1.166 0.862 wad5 =~
tadhde5 1.000 2.135 0.768 wad7 =~
tadhde7 1.000 1.841 0.719 wad10 =~
tadhde10 1.000 1.749 0.701 wad12 =~
tadhde12 1.000 1.799 0.711 wasb5 =~
asbe5 1.000 6.170 0.669 wasb7 =~
asbe7 1.000 5.819 0.647 wasb10 =~
asbe10 1.000 6.870 0.708 wasb12 =~
asbe12 1.000 7.259 0.727
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.197 0.057 3.435 0.001 0.190 0.190 wsi10 ~
wsi7 0.263 0.059 4.478 0.000 0.230 0.230 wsi12 ~
wsi10 0.385 0.047 8.218 0.000 0.360 0.360 wasb7 ~
wasb5 0.200 0.066 3.049 0.002 0.213 0.213 wasb10 ~
wasb7 0.197 0.068 2.877 0.004 0.167 0.167 wasb12 ~
wasb10 0.459 0.052 8.785 0.000 0.434 0.434 wad7 ~
wad5 0.220 0.043 5.128 0.000 0.255 0.255 wad10 ~
wad7 0.075 0.065 1.148 0.251 0.079 0.079 wad12 ~
wad10 0.217 0.071 3.072 0.002 0.211 0.211 wad7 ~
wsi5 0.056 0.087 0.642 0.521 0.028 0.028 wad10 ~
wsi7 0.119 0.106 1.126 0.260 0.065 0.065 wad12 ~
wsi10 -0.053 0.075 -0.703 0.482 -0.032 -0.032 wsi7 ~
wad5 0.027 0.019 1.402 0.161 0.060 0.060 wsi10 ~
wad7 0.043 0.028 1.541 0.123 0.072 0.072 wsi12 ~
wad10 -0.002 0.028 -0.086 0.931 -0.004 -0.004 wsi7 ~
wasb5 0.009 0.009 1.071 0.284 0.060 0.060 wad7 ~
wasb5 -0.000 0.016 -0.024 0.981 -0.001 -0.001 wasb12 ~
wsi10 0.015 0.261 0.058 0.954 0.002 0.002 wad10 -0.102 0.201 -0.508 0.612 -0.025 -0.025 wasb7 ~
wad5 (a1) 0.121 0.132 0.917 0.359 0.044 0.044 wsi10 ~
wasb7 (b1) 0.003 0.009 0.318 0.750 0.015 0.015 wasb10 ~
wad7 (a2) 0.031 0.204 0.154 0.878 0.008 0.008 wsi12 ~
wasb10 (b2) 0.018 0.007 2.628 0.009 0.108 0.108 wasb7 ~
wsi5 -0.241 0.301 -0.801 0.423 -0.038 -0.038 wad10 ~
wasb7 0.014 0.017 0.852 0.394 0.047 0.047 wasb10 ~
wsi7 0.653 0.363 1.798 0.072 0.091 0.091 wad12 ~
wasb10 0.041 0.013 3.052 0.002 0.157 0.157
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.846 0.395 4.677 0.000 0.325 0.325 wad5 ~~
wasb5 7.525 0.813 9.254 0.000 0.571 0.571 wsi5 ~~
wad5 0.553 0.114 4.850 0.000 0.282 0.282 .wsi7 ~~
.wasb7 2.404 0.372 6.461 0.000 0.460 0.460 .wad7 ~~
.wasb7 5.118 0.683 7.490 0.000 0.509 0.509 .wsi7 ~~
.wad7 0.405 0.090 4.481 0.000 0.247 0.247 .wsi10 ~~
.wasb10 3.130 0.338 9.262 0.000 0.445 0.445 .wad10 ~~
.wasb10 5.531 0.770 7.183 0.000 0.478 0.478 .wsi10 ~~
.wad10 0.532 0.099 5.389 0.000 0.293 0.293 .wsi12 ~~
.wasb12 2.670 0.306 8.711 0.000 0.384 0.384 .wad12 ~~
.wasb12 5.663 0.604 9.376 0.000 0.503 0.503 .wsi12 ~~
.wad12 0.443 0.084 5.268 0.000 0.244 0.244 RIad ~~
RIsi 0.647 0.076 8.501 0.000 0.529 0.529 RIasb 9.612 0.736 13.056 0.000 0.788 0.788 RIsi ~~
RIasb 2.889 0.309 9.350 0.000 0.615 0.615
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.809 .tadhde7 1.812 0.055 32.729 0.000 1.812 0.707 .tadhde10 1.567 0.053 29.499 0.000 1.567 0.628 .tadhde12 1.455 0.055 26.688 0.000 1.455 0.575 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.708 .sisoe7 0.832 0.025 33.074 0.000 0.832 0.708 .sisoe10 0.940 0.028 33.754 0.000 0.940 0.729 .sisoe12 0.941 0.029 31.939 0.000 0.941 0.696 .asbe5 11.841 0.194 60.901 0.000 11.841 1.284 .asbe7 10.453 0.193 54.182 0.000 10.453 1.163 .asbe10 10.224 0.209 48.990 0.000 10.224 1.054 .asbe12 10.387 0.217 47.915 0.000 10.387 1.041 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.557 0.321 14.184 0.000 1.000 1.000 wsi5 0.848 0.100 8.480 0.000 1.000 1.000 wasb5 38.074 3.240 11.751 0.000 1.000 1.000 .wad7 3.152 0.244 12.931 0.000 0.930 0.930 .wsi7 0.851 0.071 12.001 0.000 0.939 0.939 .wasb7 32.062 3.151 10.174 0.000 0.947 0.947 .wad10 2.991 0.312 9.577 0.000 0.978 0.978 .wsi10 1.105 0.080 13.745 0.000 0.928 0.928 .wasb10 44.743 3.622 12.352 0.000 0.948 0.948 .wad12 2.934 0.248 11.823 0.000 0.906 0.906 .wsi12 1.121 0.080 13.920 0.000 0.824 0.824 .wasb12 43.222 2.622 16.486 0.000 0.820 0.820 RIad 3.171 0.239 13.260 0.000 1.000 1.000 RIsi 0.471 0.057 8.306 0.000 1.000 1.000 RIasb 46.908 3.066 15.302 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 indirect1 0.000 0.001 0.299 0.765 0.001 0.001 indirect2 0.001 0.004 0.152 0.879 0.001 0.001
ri.med.long.asb.full2 <- '
###### 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
## asb social bahviour
wasb7 ~ wasb5
wasb10 ~ wasb7
wasb12 ~ wasb10
## ADHD
wad7 ~ wad5
wad10 ~ wad7
wad12 ~ wad10
###### Cross lag paths ######
## Isolation
wad7 ~ e*wsi5
wad10 ~ e*wsi7
wad12 ~ e*wsi10
## ADHD
wsi7 ~ f*wad5
wsi10 ~ f*wad7
wsi12 ~ f*wad10
## asbsocial
wsi7 ~ b*wasb5
wad7 ~ d*wasb5
wasb12 ~ c*wsi10
wasb12 ~ a*wad10
###### Mediation paths ######
## ADHD to Isolation
wasb7 ~ a*wad5
wsi10 ~ b*wasb7
wasb10 ~ a*wad7
wsi12 ~ b*wasb10
## Isolation to ADHD
wasb7 ~ c*wsi5
wad10 ~ d*wasb7
wasb10 ~ c*wsi7
wad12 ~ 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
###### Indirect effect (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
ri.med.long.asb.full2.fit <- lavaan(model = ri.med.long.asb.full2,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
ri.med.long.asb.full2.fit.summary <- summary(ri.med.long.asb.full2.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 239 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 112.613 71.429 Degrees of freedom 33 33 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.577 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 15084.484 8357.268 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.805
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.995 0.995 Tucker-Lewis Index (TLI) 0.989 0.991
Robust Comparative Fit Index (CFI) 0.996 Robust Tucker-Lewis Index (TLI) 0.992
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -59280.158 -59280.158 Scaling correction factor 1.893 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.030 for the MLR correction
Akaike (AIC) 118674.317 118674.317 Bayesian (BIC) 118999.824 118999.824 Sample-size adjusted Bayesian (BIC) 118818.726 118818.726
Root Mean Square Error of Approximation:
RMSEA 0.033 0.023 90 Percent confidence interval - lower 0.026 0.017 90 Percent confidence interval - upper 0.040 0.029 P-value RMSEA <= 0.05 1.000 1.000
Robust RMSEA 0.029 90 Percent confidence interval - lower 0.020 90 Percent confidence interval - upper 0.038
Standardized Root Mean Square Residual:
SRMR 0.034 0.034
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
tadhde5 1.000 1.775 0.639 tadhde7 1.000 1.775 0.690 tadhde10 1.000 1.775 0.712 tadhde12 1.000 1.775 0.702 RIsi =~
sisoe5 1.000 0.685 0.594 sisoe7 1.000 0.685 0.582 sisoe10 1.000 0.685 0.534 sisoe12 1.000 0.685 0.507 RIasb =~
asbe5 1.000 6.787 0.734 asbe7 1.000 6.787 0.748 asbe10 1.000 6.787 0.704 asbe12 1.000 6.787 0.687 wsi5 =~
sisoe5 1.000 0.927 0.804 wsi7 =~
sisoe7 1.000 0.957 0.813 wsi10 =~
sisoe10 1.000 1.083 0.845 wsi12 =~
sisoe12 1.000 1.163 0.862 wad5 =~
tadhde5 1.000 2.134 0.769 wad7 =~
tadhde7 1.000 1.859 0.723 wad10 =~
tadhde10 1.000 1.750 0.702 wad12 =~
tadhde12 1.000 1.799 0.712 wasb5 =~
asbe5 1.000 6.280 0.679 wasb7 =~
asbe7 1.000 6.016 0.663 wasb10 =~
asbe10 1.000 6.855 0.711 wasb12 =~
asbe12 1.000 7.182 0.727
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.213 0.052 4.115 0.000 0.206 0.206 wsi10 ~
wsi7 0.227 0.053 4.273 0.000 0.200 0.200 wsi12 ~
wsi10 0.393 0.043 9.234 0.000 0.366 0.366 wasb7 ~
wasb5 0.256 0.051 5.025 0.000 0.267 0.267 wasb10 ~
wasb7 0.253 0.061 4.185 0.000 0.222 0.222 wasb12 ~
wasb10 0.421 0.048 8.830 0.000 0.402 0.402 wad7 ~
wad5 0.189 0.040 4.729 0.000 0.217 0.217 wad10 ~
wad7 0.077 0.057 1.356 0.175 0.081 0.081 wad12 ~
wad10 0.246 0.057 4.348 0.000 0.239 0.239 wad7 ~
wsi5 (e) 0.012 0.055 0.215 0.830 0.006 0.006 wad10 ~
wsi7 (e) 0.012 0.055 0.215 0.830 0.006 0.006 wad12 ~
wsi10 (e) 0.012 0.055 0.215 0.830 0.007 0.007 wsi7 ~
wad5 (f) 0.017 0.015 1.098 0.272 0.037 0.037 wsi10 ~
wad7 (f) 0.017 0.015 1.098 0.272 0.029 0.029 wsi12 ~
wad10 (f) 0.017 0.015 1.098 0.272 0.025 0.025 wsi7 ~
wasb5 (b) 0.012 0.005 2.496 0.013 0.079 0.079 wad7 ~
wasb5 (d) 0.024 0.010 2.408 0.016 0.079 0.079 wasb12 ~
wsi10 (c) 0.099 0.185 0.537 0.591 0.015 0.015 wad10 (a) 0.006 0.110 0.055 0.956 0.001 0.001 wasb7 ~
wad5 (a) 0.006 0.110 0.055 0.956 0.002 0.002 wsi10 ~
wasb7 (b) 0.012 0.005 2.496 0.013 0.067 0.067 wasb10 ~
wad7 (a) 0.006 0.110 0.055 0.956 0.002 0.002 wsi12 ~
wasb10 (b) 0.012 0.005 2.496 0.013 0.071 0.071 wasb7 ~
wsi5 (c) 0.099 0.185 0.537 0.591 0.015 0.015 wad10 ~
wasb7 (d) 0.024 0.010 2.408 0.016 0.081 0.081 wasb10 ~
wsi7 (c) 0.099 0.185 0.537 0.591 0.014 0.014 wad12 ~
wasb10 (d) 0.024 0.010 2.408 0.016 0.090 0.090
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 2.009 0.335 6.003 0.000 0.345 0.345 wad5 ~~
wasb5 7.698 0.755 10.199 0.000 0.574 0.574 wsi5 ~~
wad5 0.550 0.107 5.141 0.000 0.278 0.278 .wsi7 ~~
.wasb7 2.448 0.339 7.213 0.000 0.458 0.458 .wad7 ~~
.wasb7 5.376 0.664 8.097 0.000 0.519 0.519 .wsi7 ~~
.wad7 0.383 0.089 4.294 0.000 0.232 0.232 .wsi10 ~~
.wasb10 3.074 0.315 9.754 0.000 0.440 0.440 .wad10 ~~
.wasb10 5.433 0.706 7.695 0.000 0.470 0.470 .wsi10 ~~
.wad10 0.515 0.091 5.666 0.000 0.284 0.284 .wsi12 ~~
.wasb12 2.668 0.306 8.727 0.000 0.384 0.384 .wad12 ~~
.wasb12 5.632 0.584 9.650 0.000 0.500 0.500 .wsi12 ~~
.wad12 0.457 0.082 5.545 0.000 0.251 0.251 RIad ~~
RIsi 0.657 0.074 8.906 0.000 0.541 0.541 RIasb 9.498 0.727 13.060 0.000 0.789 0.789 RIsi ~~
RIasb 2.821 0.290 9.736 0.000 0.607 0.607
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.811 .tadhde7 1.812 0.055 32.729 0.000 1.812 0.705 .tadhde10 1.566 0.053 29.511 0.000 1.566 0.628 .tadhde12 1.455 0.055 26.687 0.000 1.455 0.576 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.706 .sisoe7 0.831 0.025 33.089 0.000 0.831 0.707 .sisoe10 0.940 0.028 33.742 0.000 0.940 0.734 .sisoe12 0.941 0.029 31.937 0.000 0.941 0.697 .asbe5 11.841 0.194 60.901 0.000 11.841 1.281 .asbe7 10.454 0.193 54.177 0.000 10.454 1.153 .asbe10 10.224 0.209 48.992 0.000 10.224 1.060 .asbe12 10.386 0.217 47.927 0.000 10.386 1.051 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.552 0.316 14.391 0.000 1.000 1.000 wsi5 0.859 0.098 8.788 0.000 1.000 1.000 wasb5 39.439 2.901 13.596 0.000 1.000 1.000 .wad7 3.200 0.246 12.991 0.000 0.926 0.926 .wsi7 0.852 0.068 12.552 0.000 0.931 0.931 .wasb7 33.477 3.030 11.048 0.000 0.925 0.925 .wad10 2.997 0.289 10.380 0.000 0.979 0.979 .wsi10 1.098 0.080 13.721 0.000 0.937 0.937 .wasb10 44.509 3.584 12.419 0.000 0.947 0.947 .wad12 2.952 0.244 12.113 0.000 0.912 0.912 .wsi12 1.122 0.081 13.920 0.000 0.829 0.829 .wasb12 42.922 2.636 16.285 0.000 0.832 0.832 RIad 3.149 0.234 13.447 0.000 1.000 1.000 RIsi 0.469 0.055 8.581 0.000 1.000 1.000 RIasb 46.063 3.042 15.144 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 indirect1 0.000 0.001 0.055 0.956 0.000 0.000 indirect2 0.002 0.004 0.554 0.580 0.001 0.001
The cross-lag constraints gave a non-significant loss in model fit (p=0.3114).
# Model fit
ri.med.long.asb.full2.fit.summary.fit <- table.model.fit(ri.med.long.asb.full2.fit.summary)
# Coefficients -
ri.med.long.asb.full2.fit.summary.reg <- table.model.coef(model = ri.med.long.asb.full2.fit.summary, step = "S4") %>% mutate_if(is.numeric, round, 3)
ri.med.long.asb.full2.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue) %>%
filter(lhs == "indirect1" | lhs == "indirect2")
med_hyp.long.asb <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Anti social bahviour
asbe7 ~ asbe5
asbe10 ~ asbe7
asbe12 ~ asbe10
## ADHD
hye7 ~ hye5
hye10 ~ hye7
hye12 ~ hye10
###### Cross lag paths ######
## Isolation
hye7 ~ sisoe5
hye10 ~ sisoe7
hye12 ~ sisoe10
## ADHD
sisoe7 ~ hye5
sisoe10 ~ hye7
sisoe12 ~ hye10
## Antisocial
sisoe7 ~ asbe5
hye7 ~ asbe5
asbe12 ~ sisoe10
asbe12 ~ hye10
###### mediation paths ######
## ADHD to Isolation
asbe7 ~ a1*hye5
sisoe10 ~ b1*asbe7
asbe10 ~ a2*hye7
sisoe12 ~ b2*asbe10
## Isolation to ADHD
asbe7 ~ c1*sisoe5
hye10 ~ d1*asbe7
asbe10 ~ c2*sisoe7
hye12 ~ d2*asbe10
###### Covariances ######
sisoe5 ~~ asbe5
asbe5 ~~ hye5
sisoe5 ~~ hye5
sisoe7 ~~ asbe7
asbe7 ~~ hye7
sisoe7 ~~ hye7
sisoe10 ~~ asbe10
asbe10 ~~ hye10
sisoe10 ~~ hye10
sisoe12 ~~ asbe12
asbe12 ~~ hye12
sisoe12 ~~ hye12
###### Variances ######
## Variances
hye5 ~~ hye5
sisoe5 ~~ sisoe5
asbe5 ~~ asbe5
## Residual variances
hye7 ~~ hye7
sisoe7 ~~ sisoe7
asbe7 ~~ asbe7
hye10 ~~ hye10
sisoe10 ~~ sisoe10
asbe10 ~~ asbe10
hye12 ~~ hye12
sisoe12 ~~ sisoe12
asbe12 ~~ asbe12
###### Indirect effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
med_hyp.long.asb.fit <- lavaan(model = med_hyp.long.asb,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_hyp.long.asb.fit.summary <- summary(med_hyp.long.asb.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 115 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 559.039 367.491 Degrees of freedom 27 27 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.521 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 14870.152 8522.911 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.745
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.964 0.960 Tucker-Lewis Index (TLI) 0.912 0.902
Robust Comparative Fit Index (CFI) 0.965 Robust Tucker-Lewis Index (TLI) 0.914
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54721.141 -54721.141 Scaling correction factor 2.151 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.962 for the MLR correction
Akaike (AIC) 109568.281 109568.281 Bayesian (BIC) 109928.052 109928.052 Sample-size adjusted Bayesian (BIC) 109727.891 109727.891
Root Mean Square Error of Approximation:
RMSEA 0.094 0.075 90 Percent confidence interval - lower 0.087 0.070 90 Percent confidence interval - upper 0.101 0.081 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.093 90 Percent confidence interval - lower 0.084 90 Percent confidence interval - upper 0.101
Standardized Root Mean Square Residual:
SRMR 0.061 0.061
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.430 0.044 9.829 0.000 0.430 0.415 sisoe10 ~
sisoe7 0.467 0.038 12.151 0.000 0.467 0.424 sisoe12 ~
sisoe10 0.521 0.034 15.327 0.000 0.521 0.493 asbe7 ~
asbe5 0.650 0.030 21.670 0.000 0.650 0.659 asbe10 ~
asbe7 0.625 0.038 16.458 0.000 0.625 0.582 asbe12 ~
asbe10 0.701 0.033 21.571 0.000 0.701 0.674 hye7 ~
hye5 0.381 0.030 12.735 0.000 0.381 0.405 hye10 ~
hye7 0.381 0.034 11.241 0.000 0.381 0.416 hye12 ~
hye10 0.533 0.042 12.558 0.000 0.533 0.516 hye7 ~
sisoe5 -0.001 0.029 -0.020 0.984 -0.001 -0.000 hye10 ~
sisoe7 0.008 0.035 0.215 0.830 0.008 0.006 hye12 ~
sisoe10 -0.059 0.025 -2.355 0.019 -0.059 -0.054 sisoe7 ~
hye5 0.001 0.023 0.062 0.950 0.001 0.002 sisoe10 ~
hye7 0.054 0.027 1.986 0.047 0.054 0.062 sisoe12 ~
hye10 0.031 0.028 1.112 0.266 0.031 0.031 sisoe7 ~
asbe5 0.023 0.005 4.990 0.000 0.023 0.180 hye7 ~
asbe5 0.038 0.005 7.477 0.000 0.038 0.232 asbe12 ~
sisoe10 -0.129 0.174 -0.743 0.458 -0.129 -0.017 hye10 0.484 0.202 2.397 0.017 0.484 0.066 asbe7 ~
hye5 (a1) 0.099 0.159 0.626 0.531 0.099 0.018 sisoe10 ~
asbe7 (b1) 0.014 0.005 2.683 0.007 0.014 0.097 asbe10 ~
hye7 (a2) 0.475 0.187 2.538 0.011 0.475 0.074 sisoe12 ~
asbe10 (b2) 0.020 0.005 4.107 0.000 0.020 0.144 asbe7 ~
sisoe5 (c1) -0.097 0.178 -0.545 0.586 -0.097 -0.012 hye10 ~
asbe7 (d1) 0.029 0.005 5.386 0.000 0.029 0.187 asbe10 ~
sisoe7 (c2) 0.143 0.216 0.663 0.507 0.143 0.017 hye12 ~
asbe10 (d2) 0.028 0.005 5.344 0.000 0.028 0.192
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
asbe5 4.469 0.407 10.986 0.000 4.469 0.429 asbe5 ~~
hye5 10.127 0.562 18.010 0.000 10.127 0.688 sisoe5 ~~
hye5 0.527 0.061 8.625 0.000 0.527 0.290 .sisoe7 ~~
.asbe7 3.014 0.298 10.123 0.000 3.014 0.443 .asbe7 ~~
.hye7 4.607 0.344 13.407 0.000 4.607 0.559 .sisoe7 ~~
.hye7 0.237 0.042 5.627 0.000 0.237 0.194 .sisoe10 ~~
.asbe10 3.572 0.305 11.704 0.000 3.572 0.429 .asbe10 ~~
.hye10 4.485 0.386 11.627 0.000 4.485 0.526 .sisoe10 ~~
.hye10 0.304 0.045 6.813 0.000 0.304 0.238 .sisoe12 ~~
.asbe12 3.057 0.318 9.621 0.000 3.057 0.389 .asbe12 ~~
.hye12 3.943 0.361 10.917 0.000 3.943 0.502 .sisoe12 ~~
.hye12 0.244 0.047 5.131 0.000 0.244 0.200
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.207 0.038 5.518 0.000 0.207 0.176 .sisoe10 0.348 0.038 9.102 0.000 0.348 0.268 .sisoe12 0.217 0.038 5.777 0.000 0.217 0.158 .asbe7 2.706 0.247 10.968 0.000 2.706 0.299 .asbe10 3.038 0.268 11.329 0.000 3.038 0.312 .asbe12 2.937 0.248 11.848 0.000 2.937 0.290 .hye7 0.119 0.041 2.893 0.004 0.119 0.079 .hye10 0.114 0.038 2.995 0.003 0.114 0.082 .hye12 0.103 0.035 2.976 0.003 0.103 0.072 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 asbe5 11.841 0.194 60.901 0.000 11.841 1.289 hye5 1.371 0.034 40.447 0.000 1.371 0.856
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all hye5 2.566 0.114 22.496 0.000 2.566 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 asbe5 84.369 4.076 20.697 0.000 84.369 1.000 .hye7 1.484 0.080 18.608 0.000 1.484 0.653 .sisoe7 1.012 0.060 16.766 0.000 1.012 0.731 .asbe7 45.694 2.611 17.498 0.000 45.694 0.557 .hye10 1.308 0.080 16.338 0.000 1.308 0.683 .sisoe10 1.245 0.077 16.157 0.000 1.245 0.740 .asbe10 55.583 3.262 17.039 0.000 55.583 0.586 .hye12 1.218 0.084 14.495 0.000 1.218 0.596 .sisoe12 1.216 0.079 15.453 0.000 1.216 0.645 .asbe12 50.737 2.886 17.580 0.000 50.737 0.495
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1a 0.001 0.002 0.602 0.547 0.001 0.002 indirect1b 0.010 0.004 2.163 0.031 0.010 0.011 indirect2a -0.003 0.005 -0.544 0.586 -0.003 -0.002 indirect2b 0.004 0.006 0.665 0.506 0.004 0.003
med_hyp.long2.asb <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Anti social bahviour
asbe7 ~ asbe5
asbe10 ~ asbe7
asbe12 ~ asbe10
## ADHD
hye7 ~ hye5
hye10 ~ hye7
hye12 ~ hye10
###### Cross lag paths ######
## Isolation
hye7 ~ e*sisoe5
hye10 ~ e*sisoe7
hye12 ~ e*sisoe10
## ADHD
sisoe7 ~ f*hye5
sisoe10 ~ f*hye7
sisoe12 ~ f*hye10
## Antisocial
sisoe7 ~ b*asbe5
hye7 ~ d*asbe5
asbe12 ~ c*sisoe10
asbe12 ~ a*hye10
###### mediation paths ######
## ADHD to Isolation
asbe7 ~ a*hye5
sisoe10 ~ b*asbe7
asbe10 ~ a*hye7
sisoe12 ~ b*asbe10
## Isolation to ADHD
asbe7 ~ c*sisoe5
hye10 ~ d*asbe7
asbe10 ~ c*sisoe7
hye12 ~ d*asbe10
###### Covariances ######
sisoe5 ~~ asbe5
asbe5 ~~ hye5
sisoe5 ~~ hye5
sisoe7 ~~ asbe7
asbe7 ~~ hye7
sisoe7 ~~ hye7
sisoe10 ~~ asbe10
asbe10 ~~ hye10
sisoe10 ~~ hye10
sisoe12 ~~ asbe12
asbe12 ~~ hye12
sisoe12 ~~ hye12
###### Variances ######
## Variances
hye5 ~~ hye5
sisoe5 ~~ sisoe5
asbe5 ~~ asbe5
## Residual variances
hye7 ~~ hye7
sisoe7 ~~ sisoe7
asbe7 ~~ asbe7
hye10 ~~ hye10
sisoe10 ~~ sisoe10
asbe10 ~~ asbe10
hye12 ~~ hye12
sisoe12 ~~ sisoe12
asbe12 ~~ asbe12
###### Indirect effects (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
med_hyp.long2.asb.fit <- lavaan(model = med_hyp.long2.asb,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_hyp.long2.asb.fit.summary <- summary(med_hyp.long2.asb.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 92 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 577.193 366.313 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.576 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 14870.152 8522.911 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.745
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.964 0.961 Tucker-Lewis Index (TLI) 0.938 0.935
Robust Comparative Fit Index (CFI) 0.965 Robust Tucker-Lewis Index (TLI) 0.941
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54730.218 -54730.218 Scaling correction factor 1.828 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.962 for the MLR correction
Akaike (AIC) 109562.435 109562.435 Bayesian (BIC) 109853.678 109853.678 Sample-size adjusted Bayesian (BIC) 109691.643 109691.643
Root Mean Square Error of Approximation:
RMSEA 0.079 0.061 90 Percent confidence interval - lower 0.073 0.057 90 Percent confidence interval - upper 0.084 0.066 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.077 90 Percent confidence interval - lower 0.070 90 Percent confidence interval - upper 0.084
Standardized Root Mean Square Residual:
SRMR 0.063 0.063
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.434 0.039 10.999 0.000 0.434 0.418 sisoe10 ~
sisoe7 0.447 0.034 13.167 0.000 0.447 0.407 sisoe12 ~
sisoe10 0.531 0.032 16.660 0.000 0.531 0.501 asbe7 ~
asbe5 0.610 0.024 25.602 0.000 0.610 0.622 asbe10 ~
asbe7 0.656 0.028 23.304 0.000 0.656 0.608 asbe12 ~
asbe10 0.717 0.026 27.960 0.000 0.717 0.686 hye7 ~
hye5 0.421 0.025 16.715 0.000 0.421 0.447 hye10 ~
hye7 0.373 0.030 12.604 0.000 0.373 0.408 hye12 ~
hye10 0.502 0.037 13.549 0.000 0.502 0.485 hye7 ~
sisoe5 (e) -0.023 0.015 -1.501 0.133 -0.023 -0.017 hye10 ~
sisoe7 (e) -0.023 0.015 -1.501 0.133 -0.023 -0.020 hye12 ~
sisoe10 (e) -0.023 0.015 -1.501 0.133 -0.023 -0.021 sisoe7 ~
hye5 (f) 0.025 0.015 1.712 0.087 0.025 0.035 sisoe10 ~
hye7 (f) 0.025 0.015 1.712 0.087 0.025 0.030 sisoe12 ~
hye10 (f) 0.025 0.015 1.712 0.087 0.025 0.025 sisoe7 ~
asbe5 (b) 0.020 0.003 7.059 0.000 0.020 0.152 hye7 ~
asbe5 (d) 0.031 0.003 9.733 0.000 0.031 0.191 asbe12 ~
sisoe10 (c) -0.057 0.101 -0.558 0.577 -0.057 -0.007 hye10 (a) 0.332 0.102 3.240 0.001 0.332 0.045 asbe7 ~
hye5 (a) 0.332 0.102 3.240 0.001 0.332 0.059 sisoe10 ~
asbe7 (b) 0.020 0.003 7.059 0.000 0.020 0.136 asbe10 ~
hye7 (a) 0.332 0.102 3.240 0.001 0.332 0.052 sisoe12 ~
asbe10 (b) 0.020 0.003 7.059 0.000 0.020 0.138 asbe7 ~
sisoe5 (c) -0.057 0.101 -0.558 0.577 -0.057 -0.007 hye10 ~
asbe7 (d) 0.031 0.003 9.733 0.000 0.031 0.205 asbe10 ~
sisoe7 (c) -0.057 0.101 -0.558 0.577 -0.057 -0.007 hye12 ~
asbe10 (d) 0.031 0.003 9.733 0.000 0.031 0.213
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
asbe5 4.469 0.407 10.986 0.000 4.469 0.429 asbe5 ~~
hye5 10.127 0.562 18.010 0.000 10.127 0.688 sisoe5 ~~
hye5 0.527 0.061 8.625 0.000 0.527 0.290 .sisoe7 ~~
.asbe7 3.021 0.297 10.169 0.000 3.021 0.444 .asbe7 ~~
.hye7 4.619 0.343 13.472 0.000 4.619 0.560 .sisoe7 ~~
.hye7 0.239 0.042 5.652 0.000 0.239 0.194 .sisoe10 ~~
.asbe10 3.581 0.305 11.724 0.000 3.581 0.430 .asbe10 ~~
.hye10 4.493 0.387 11.613 0.000 4.493 0.526 .sisoe10 ~~
.hye10 0.304 0.045 6.815 0.000 0.304 0.238 .sisoe12 ~~
.asbe12 3.060 0.318 9.624 0.000 3.060 0.389 .asbe12 ~~
.hye12 3.952 0.363 10.892 0.000 3.952 0.502 .sisoe12 ~~
.hye12 0.244 0.048 5.128 0.000 0.244 0.200
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.213 0.031 6.827 0.000 0.213 0.181 .sisoe10 0.337 0.029 11.605 0.000 0.337 0.260 .sisoe12 0.220 0.028 7.863 0.000 0.220 0.160 .asbe7 2.828 0.222 12.729 0.000 2.828 0.314 .asbe10 3.037 0.220 13.827 0.000 3.037 0.312 .asbe12 2.833 0.215 13.155 0.000 2.833 0.279 .hye7 0.164 0.033 5.027 0.000 0.164 0.109 .hye10 0.120 0.027 4.478 0.000 0.120 0.087 .hye12 0.062 0.024 2.561 0.010 0.062 0.043 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 asbe5 11.841 0.194 60.901 0.000 11.841 1.289 hye5 1.371 0.034 40.447 0.000 1.371 0.856
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all hye5 2.566 0.114 22.496 0.000 2.566 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 asbe5 84.369 4.076 20.697 0.000 84.369 1.000 .hye7 1.488 0.080 18.577 0.000 1.488 0.654 .sisoe7 1.012 0.060 16.774 0.000 1.012 0.730 .asbe7 45.761 2.608 17.548 0.000 45.761 0.564 .hye10 1.309 0.080 16.305 0.000 1.309 0.688 .sisoe10 1.247 0.077 16.160 0.000 1.247 0.745 .asbe10 55.657 3.271 17.017 0.000 55.657 0.589 .hye12 1.222 0.084 14.469 0.000 1.222 0.597 .sisoe12 1.217 0.079 15.438 0.000 1.217 0.645 .asbe12 50.767 2.886 17.592 0.000 50.767 0.492
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1 0.006 0.002 3.328 0.001 0.006 0.007 indirect2 -0.002 0.003 -0.554 0.580 -0.002 -0.001
The cross-lag constraints gave a non-significant loss in model fit (p=0.5619). Therefore this model 2 will be carried forward.
# Model fit
med_hyp.long2.asb.fit.summary.fit <- table.model.fit(med_hyp.long2.asb.fit.summary)
# Coefficients
med_hyp.long2.asb.fit.summary.reg <- table.model.coef(model = med_hyp.long2.asb.fit.summary, step = "S2") %>% mutate_if(is.numeric, round, 3)
med_hyp.long2.asb.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue)
ri.med_hyp.long.asb.full <- '
###### Create random intercepts ######
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12
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*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
## asbsocial
wasb5 =~ 1*asbe5
wasb7 =~ 1*asbe7
wasb10 =~ 1*asbe10
wasb12 =~ 1*asbe12
###### Autoregressive lags ######
## Isolation
wsi7 ~ wsi5
wsi10 ~ wsi7
wsi12 ~ wsi10
## asb social bahviour
wasb7 ~ wasb5
wasb10 ~ wasb7
wasb12 ~ wasb10
## ADHD
wad7 ~ wad5
wad10 ~ wad7
wad12 ~ wad10
###### Cross lag paths ######
## Isolation
wad7 ~ wsi5
wad10 ~ wsi7
wad12 ~ wsi10
## ADHD
wsi7 ~ wad5
wsi10 ~ wad7
wsi12 ~ wad10
## asbsocial
wsi7 ~ wasb5
wad7 ~ wasb5
wasb12 ~ wsi10
wasb12 ~ wad10
###### Mediation paths ######
## ADHD to Isolation
wasb7 ~ a1*wad5
wsi10 ~ b1*wasb7
wasb10 ~ a2*wad7
wsi12 ~ b2*wasb10
## Isolation to ADHD
wasb7 ~ wsi5
wad10 ~ wasb7
wasb10 ~ wsi7
wad12 ~ 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) ######
indirect1 := a1*b1
indirect2 := a2*b2
'
ri.med_hyp.long.asb.full.fit <- lavaan(model = ri.med_hyp.long.asb.full,
data = dat,
missing = 'ML',
meanstructure = TRUE,
se = "robust",
int.ov.free = TRUE,
estimator = "MLR")
ri.med_hyp.long.asb.full.fit.summary <- summary(ri.med_hyp.long.asb.full.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 290 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 82.539 57.047 Degrees of freedom 21 21 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.447 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 14870.152 8522.911 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.745
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.996 0.996 Tucker-Lewis Index (TLI) 0.987 0.987
Robust Comparative Fit Index (CFI) 0.996 Robust Tucker-Lewis Index (TLI) 0.989
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54482.891 -54482.891 Scaling correction factor 2.119 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.962 for the MLR correction
Akaike (AIC) 109103.782 109103.782 Bayesian (BIC) 109497.817 109497.817 Sample-size adjusted Bayesian (BIC) 109278.593 109278.593
Root Mean Square Error of Approximation:
RMSEA 0.036 0.028 90 Percent confidence interval - lower 0.028 0.021 90 Percent confidence interval - upper 0.045 0.035 P-value RMSEA <= 0.05 0.997 1.000
Robust RMSEA 0.033 90 Percent confidence interval - lower 0.023 90 Percent confidence interval - upper 0.044
Standardized Root Mean Square Residual:
SRMR 0.029 0.029
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.967 0.603 hye7 1.000 0.967 0.652 hye10 1.000 0.967 0.695 hye12 1.000 0.967 0.679 RIsi =~
sisoe5 1.000 0.698 0.609 sisoe7 1.000 0.698 0.596 sisoe10 1.000 0.698 0.540 sisoe12 1.000 0.698 0.514 RIasb =~
asbe5 1.000 6.753 0.737 asbe7 1.000 6.753 0.753 asbe10 1.000 6.753 0.695 asbe12 1.000 6.753 0.676 wsi5 =~
sisoe5 1.000 0.910 0.793 wsi7 =~
sisoe7 1.000 0.941 0.803 wsi10 =~
sisoe10 1.000 1.087 0.841 wsi12 =~
sisoe12 1.000 1.165 0.858 wad5 =~
hye5 1.000 1.281 0.798 wad7 =~
hye7 1.000 1.125 0.758 wad10 =~
hye10 1.000 1.000 0.719 wad12 =~
hye12 1.000 1.046 0.734 wasb5 =~
asbe5 1.000 6.195 0.676 wasb7 =~
asbe7 1.000 5.902 0.658 wasb10 =~
asbe10 1.000 6.979 0.719 wasb12 =~
asbe12 1.000 7.357 0.737
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.185 0.057 3.246 0.001 0.179 0.179 wsi10 ~
wsi7 0.253 0.060 4.247 0.000 0.219 0.219 wsi12 ~
wsi10 0.376 0.046 8.119 0.000 0.351 0.351 wasb7 ~
wasb5 0.204 0.071 2.853 0.004 0.214 0.214 wasb10 ~
wasb7 0.181 0.069 2.624 0.009 0.153 0.153 wasb12 ~
wasb10 0.473 0.052 9.060 0.000 0.449 0.449 wad7 ~
wad5 0.169 0.039 4.321 0.000 0.193 0.193 wad10 ~
wad7 0.095 0.054 1.761 0.078 0.107 0.107 wad12 ~
wad10 0.216 0.067 3.207 0.001 0.207 0.207 wad7 ~
wsi5 0.003 0.048 0.063 0.949 0.002 0.002 wad10 ~
wsi7 0.053 0.059 0.894 0.371 0.049 0.049 wad12 ~
wsi10 -0.042 0.037 -1.121 0.262 -0.044 -0.044 wsi7 ~
wad5 0.019 0.033 0.584 0.559 0.026 0.026 wsi10 ~
wad7 0.063 0.042 1.483 0.138 0.065 0.065 wsi12 ~
wad10 0.011 0.043 0.252 0.801 0.009 0.009 wsi7 ~
wasb5 0.011 0.009 1.224 0.221 0.076 0.076 wad7 ~
wasb5 0.024 0.009 2.580 0.010 0.134 0.134 wasb12 ~
wsi10 -0.006 0.262 -0.024 0.981 -0.001 -0.001 wad10 -0.122 0.359 -0.339 0.734 -0.017 -0.017 wasb7 ~
wad5 (a1) 0.296 0.226 1.310 0.190 0.064 0.064 wsi10 ~
wasb7 (b1) 0.005 0.009 0.531 0.595 0.027 0.027 wasb10 ~
wad7 (a2) 0.503 0.312 1.615 0.106 0.081 0.081 wsi12 ~
wasb10 (b2) 0.019 0.007 2.840 0.005 0.113 0.113 wasb7 ~
wsi5 -0.305 0.301 -1.012 0.311 -0.047 -0.047 wad10 ~
wasb7 0.010 0.010 1.062 0.288 0.060 0.060 wasb10 ~
wsi7 0.605 0.366 1.652 0.099 0.082 0.082 wad12 ~
wasb10 0.025 0.008 3.191 0.001 0.169 0.169
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.763 0.388 4.548 0.000 0.313 0.313 wad5 ~~
wasb5 4.909 0.465 10.563 0.000 0.619 0.619 wsi5 ~~
wad5 0.226 0.055 4.138 0.000 0.194 0.194 .wsi7 ~~
.wasb7 2.386 0.374 6.372 0.000 0.455 0.455 .wad7 ~~
.wasb7 3.396 0.402 8.444 0.000 0.553 0.553 .wsi7 ~~
.wad7 0.198 0.051 3.902 0.000 0.201 0.201 .wsi10 ~~
.wasb10 3.164 0.335 9.458 0.000 0.447 0.447 .wad10 ~~
.wasb10 3.397 0.442 7.685 0.000 0.511 0.511 .wsi10 ~~
.wad10 0.267 0.051 5.189 0.000 0.258 0.258 .wsi12 ~~
.wasb12 2.706 0.309 8.744 0.000 0.387 0.387 .wad12 ~~
.wasb12 3.148 0.342 9.216 0.000 0.480 0.480 .wsi12 ~~
.wad12 0.203 0.046 4.436 0.000 0.193 0.193 RIad ~~
RIsi 0.306 0.041 7.464 0.000 0.454 0.454 RIasb 5.113 0.385 13.271 0.000 0.783 0.783 RIsi ~~
RIasb 2.880 0.310 9.297 0.000 0.611 0.611
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.854 .hye7 1.093 0.032 33.953 0.000 1.093 0.736 .hye10 0.836 0.030 28.224 0.000 0.836 0.601 .hye12 0.780 0.031 25.531 0.000 0.780 0.547 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.709 .sisoe7 0.832 0.025 33.068 0.000 0.832 0.710 .sisoe10 0.940 0.028 33.749 0.000 0.940 0.728 .sisoe12 0.941 0.029 31.951 0.000 0.941 0.693 .asbe5 11.841 0.194 60.901 0.000 11.841 1.292 .asbe7 10.453 0.193 54.173 0.000 10.453 1.165 .asbe10 10.223 0.209 48.983 0.000 10.223 1.053 .asbe12 10.389 0.217 47.911 0.000 10.389 1.040 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 1.641 0.099 16.565 0.000 1.000 1.000 wsi5 0.828 0.098 8.483 0.000 1.000 1.000 wasb5 38.377 3.274 11.721 0.000 1.000 1.000 .wad7 1.155 0.084 13.741 0.000 0.913 0.913 .wsi7 0.841 0.071 11.766 0.000 0.949 0.949 .wasb7 32.691 3.177 10.289 0.000 0.938 0.938 .wad10 0.970 0.093 10.386 0.000 0.970 0.970 .wsi10 1.102 0.081 13.667 0.000 0.933 0.933 .wasb10 45.521 3.550 12.823 0.000 0.935 0.935 .wad12 0.987 0.080 12.344 0.000 0.902 0.902 .wsi12 1.119 0.080 13.987 0.000 0.824 0.824 .wasb12 43.644 2.653 16.450 0.000 0.806 0.806 RIad 0.935 0.070 13.428 0.000 1.000 1.000 RIsi 0.487 0.056 8.673 0.000 1.000 1.000 RIasb 45.600 3.081 14.800 0.000 1.000 1.000 .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 .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 indirect1 0.001 0.003 0.494 0.621 0.002 0.002 indirect2 0.009 0.007 1.381 0.167 0.009 0.009
ri.med_hyp.long.asb.full2 <- '
###### Create random intercepts ######
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12
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*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
## asbsocial
wasb5 =~ 1*asbe5
wasb7 =~ 1*asbe7
wasb10 =~ 1*asbe10
wasb12 =~ 1*asbe12
###### Autoregressive lags ######
## Isolation
wsi7 ~ wsi5
wsi10 ~ wsi7
wsi12 ~ wsi10
## asb social bahviour
wasb7 ~ wasb5
wasb10 ~ wasb7
wasb12 ~ wasb10
## ADHD
wad7 ~ wad5
wad10 ~ wad7
wad12 ~ wad10
###### Cross lag paths ######
## Isolation
wad7 ~ e*wsi5
wad10 ~ e*wsi7
wad12 ~ e*wsi10
## ADHD
wsi7 ~ f*wad5
wsi10 ~ f*wad7
wsi12 ~ f*wad10
## asbsocial
wsi7 ~ b*wasb5
wad7 ~ d*wasb5
wasb12 ~ c*wsi10
wasb12 ~ a*wad10
###### Mediation paths ######
## ADHD to Isolation
wasb7 ~ a*wad5
wsi10 ~ b*wasb7
wasb10 ~ a*wad7
wsi12 ~ b*wasb10
## Isolation to ADHD
wasb7 ~ c*wsi5
wad10 ~ d*wasb7
wasb10 ~ c*wsi7
wad12 ~ 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
###### Indirect effect (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
ri.med_hyp.long.asb.full2.fit <- lavaan(model = ri.med_hyp.long.asb.full2,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
ri.med_hyp.long.asb.full2.fit.summary <- summary(ri.med_hyp.long.asb.full2.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 205 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 102.248 66.659 Degrees of freedom 33 33 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.534 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 14870.152 8522.911 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.745
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.995 0.996 Tucker-Lewis Index (TLI) 0.991 0.992
Robust Comparative Fit Index (CFI) 0.997 Robust Tucker-Lewis Index (TLI) 0.993
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54492.745 -54492.745 Scaling correction factor 1.826 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.962 for the MLR correction
Akaike (AIC) 109099.490 109099.490 Bayesian (BIC) 109424.997 109424.997 Sample-size adjusted Bayesian (BIC) 109243.899 109243.899
Root Mean Square Error of Approximation:
RMSEA 0.031 0.021 90 Percent confidence interval - lower 0.024 0.015 90 Percent confidence interval - upper 0.038 0.027 P-value RMSEA <= 0.05 1.000 1.000
Robust RMSEA 0.026 90 Percent confidence interval - lower 0.017 90 Percent confidence interval - upper 0.036
Standardized Root Mean Square Residual:
SRMR 0.032 0.032
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
hye5 1.000 0.968 0.605 hye7 1.000 0.968 0.656 hye10 1.000 0.968 0.693 hye12 1.000 0.968 0.677 RIsi =~
sisoe5 1.000 0.694 0.602 sisoe7 1.000 0.694 0.590 sisoe10 1.000 0.694 0.541 sisoe12 1.000 0.694 0.513 RIasb =~
asbe5 1.000 6.746 0.737 asbe7 1.000 6.746 0.749 asbe10 1.000 6.746 0.696 asbe12 1.000 6.746 0.677 wsi5 =~
sisoe5 1.000 0.920 0.798 wsi7 =~
sisoe7 1.000 0.949 0.807 wsi10 =~
sisoe10 1.000 1.079 0.841 wsi12 =~
sisoe12 1.000 1.160 0.858 wad5 =~
hye5 1.000 1.273 0.796 wad7 =~
hye7 1.000 1.115 0.755 wad10 =~
hye10 1.000 1.006 0.721 wad12 =~
hye12 1.000 1.053 0.736 wasb5 =~
asbe5 1.000 6.186 0.676 wasb7 =~
asbe7 1.000 5.961 0.662 wasb10 =~
asbe10 1.000 6.968 0.718 wasb12 =~
asbe12 1.000 7.329 0.736
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.207 0.052 3.988 0.000 0.200 0.200 wsi10 ~
wsi7 0.223 0.054 4.148 0.000 0.196 0.196 wsi12 ~
wsi10 0.392 0.043 9.083 0.000 0.365 0.365 wasb7 ~
wasb5 0.213 0.055 3.884 0.000 0.221 0.221 wasb10 ~
wasb7 0.261 0.059 4.450 0.000 0.223 0.223 wasb12 ~
wasb10 0.440 0.045 9.721 0.000 0.419 0.419 wad7 ~
wad5 0.173 0.035 4.962 0.000 0.197 0.197 wad10 ~
wad7 0.070 0.049 1.435 0.151 0.078 0.078 wad12 ~
wad10 0.244 0.055 4.445 0.000 0.233 0.233 wad7 ~
wsi5 (e) -0.019 0.030 -0.648 0.517 -0.016 -0.016 wad10 ~
wsi7 (e) -0.019 0.030 -0.648 0.517 -0.018 -0.018 wad12 ~
wsi10 (e) -0.019 0.030 -0.648 0.517 -0.020 -0.020 wsi7 ~
wad5 (f) 0.014 0.024 0.593 0.553 0.019 0.019 wsi10 ~
wad7 (f) 0.014 0.024 0.593 0.553 0.015 0.015 wsi12 ~
wad10 (f) 0.014 0.024 0.593 0.553 0.012 0.012 wsi7 ~
wasb5 (b) 0.013 0.005 2.688 0.007 0.083 0.083 wad7 ~
wasb5 (d) 0.021 0.006 3.647 0.000 0.114 0.114 wasb12 ~
wsi10 (c) 0.020 0.181 0.109 0.914 0.003 0.003 wad10 (a) 0.195 0.183 1.069 0.285 0.027 0.027 wasb7 ~
wad5 (a) 0.195 0.183 1.069 0.285 0.042 0.042 wsi10 ~
wasb7 (b) 0.013 0.005 2.688 0.007 0.070 0.070 wasb10 ~
wad7 (a) 0.195 0.183 1.069 0.285 0.031 0.031 wsi12 ~
wasb10 (b) 0.013 0.005 2.688 0.007 0.076 0.076 wasb7 ~
wsi5 (c) 0.020 0.181 0.109 0.914 0.003 0.003 wad10 ~
wasb7 (d) 0.021 0.006 3.647 0.000 0.122 0.122 wasb10 ~
wsi7 (c) 0.020 0.181 0.109 0.914 0.003 0.003 wad12 ~
wasb10 (d) 0.021 0.006 3.647 0.000 0.136 0.136
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.876 0.324 5.798 0.000 0.330 0.330 wad5 ~~
wasb5 4.784 0.447 10.696 0.000 0.607 0.607 wsi5 ~~
wad5 0.220 0.050 4.387 0.000 0.188 0.188 .wsi7 ~~
.wasb7 2.406 0.337 7.135 0.000 0.453 0.453 .wad7 ~~
.wasb7 3.328 0.398 8.352 0.000 0.538 0.538 .wsi7 ~~
.wad7 0.179 0.050 3.561 0.000 0.182 0.182 .wsi10 ~~
.wasb10 3.079 0.311 9.901 0.000 0.435 0.435 .wad10 ~~
.wasb10 3.432 0.411 8.349 0.000 0.512 0.512 .wsi10 ~~
.wad10 0.253 0.048 5.287 0.000 0.244 0.244 .wsi12 ~~
.wasb12 2.668 0.305 8.754 0.000 0.382 0.382 .wad12 ~~
.wasb12 3.188 0.328 9.711 0.000 0.484 0.484 .wsi12 ~~
.wad12 0.201 0.045 4.494 0.000 0.190 0.190 RIad ~~
RIsi 0.323 0.040 8.056 0.000 0.481 0.481 RIasb 5.152 0.384 13.403 0.000 0.789 0.789 RIsi ~~
RIasb 2.880 0.290 9.924 0.000 0.615 0.615
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.858 .hye7 1.092 0.032 33.955 0.000 1.092 0.740 .hye10 0.837 0.030 28.251 0.000 0.837 0.599 .hye12 0.780 0.031 25.534 0.000 0.780 0.545 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.706 .sisoe7 0.831 0.025 33.090 0.000 0.831 0.707 .sisoe10 0.940 0.028 33.749 0.000 0.940 0.733 .sisoe12 0.941 0.029 31.948 0.000 0.941 0.696 .asbe5 11.841 0.194 60.901 0.000 11.841 1.294 .asbe7 10.453 0.193 54.181 0.000 10.453 1.161 .asbe10 10.224 0.209 48.990 0.000 10.224 1.054 .asbe12 10.387 0.217 47.929 0.000 10.387 1.043 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 1.621 0.099 16.375 0.000 1.000 1.000 wsi5 0.846 0.096 8.831 0.000 1.000 1.000 wasb5 38.266 2.942 13.007 0.000 1.000 1.000 .wad7 1.147 0.085 13.444 0.000 0.923 0.923 .wsi7 0.845 0.068 12.466 0.000 0.938 0.938 .wasb7 33.318 3.068 10.861 0.000 0.938 0.938 .wad10 0.982 0.087 11.297 0.000 0.971 0.971 .wsi10 1.096 0.081 13.617 0.000 0.941 0.941 .wasb10 45.667 3.486 13.099 0.000 0.941 0.941 .wad12 0.996 0.078 12.790 0.000 0.898 0.898 .wsi12 1.120 0.080 13.942 0.000 0.833 0.833 .wasb12 43.560 2.640 16.500 0.000 0.811 0.811 RIad 0.937 0.069 13.638 0.000 1.000 1.000 RIsi 0.481 0.054 8.873 0.000 1.000 1.000 RIasb 45.515 3.060 14.874 0.000 1.000 1.000 .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 .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 indirect1 0.002 0.002 1.079 0.280 0.002 0.002 indirect2 0.000 0.004 0.109 0.913 0.000 0.000
lavTestLRT(ri.med_hyp.long.asb.full.fit, ri.med_hyp.long.asb.full2.fit, method = "satorra.bentler.2010")
The cross-lag constraints gave a non-significant loss in model fit (p=0.4799).
# Model fit
ri.med_hyp.long.asb.full2.fit.summary.fit <- table.model.fit(ri.med_hyp.long.asb.full2.fit.summary)
# Coefficients -
ri.med_hyp.long.asb.full2.fit.summary.reg <- table.model.coef(model = ri.med_hyp.long.asb.full2.fit.summary, step = "S4") %>% mutate_if(is.numeric, round, 3)
ri.med_hyp.long.asb.full2.fit.summary.reg %>%
select(lhs, op, rhs, std.all, pvalue) %>%
filter(lhs == "indirect1" | lhs == "indirect2")
med_inat.long.asb <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Anti social bahviour
asbe7 ~ asbe5
asbe10 ~ asbe7
asbe12 ~ asbe10
## ADHD
ine7 ~ ine5
ine10 ~ ine7
ine12 ~ ine10
###### Cross lag paths ######
## Isolation
ine7 ~ sisoe5
ine10 ~ sisoe7
ine12 ~ sisoe10
## ADHD
sisoe7 ~ ine5
sisoe10 ~ ine7
sisoe12 ~ ine10
## Antisocial
sisoe7 ~ asbe5
ine7 ~ asbe5
asbe12 ~ sisoe10
asbe12 ~ ine10
###### mediation paths ######
## ADHD to Isolation
asbe7 ~ a1*ine5
sisoe10 ~ b1*asbe7
asbe10 ~ a2*ine7
sisoe12 ~ b2*asbe10
## Isolation to ADHD
asbe7 ~ c1*sisoe5
ine10 ~ d1*asbe7
asbe10 ~ c2*sisoe7
ine12 ~ d2*asbe10
###### Covariances ######
sisoe5 ~~ asbe5
asbe5 ~~ ine5
sisoe5 ~~ ine5
sisoe7 ~~ asbe7
asbe7 ~~ ine7
sisoe7 ~~ ine7
sisoe10 ~~ asbe10
asbe10 ~~ ine10
sisoe10 ~~ ine10
sisoe12 ~~ asbe12
asbe12 ~~ ine12
sisoe12 ~~ ine12
###### Variances ######
## Variances
ine5 ~~ ine5
sisoe5 ~~ sisoe5
asbe5 ~~ asbe5
## Residual variances
ine7 ~~ ine7
sisoe7 ~~ sisoe7
asbe7 ~~ asbe7
ine10 ~~ ine10
sisoe10 ~~ sisoe10
asbe10 ~~ asbe10
ine12 ~~ ine12
sisoe12 ~~ sisoe12
asbe12 ~~ asbe12
###### Indirect effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
med_inat.long.asb.fit <- lavaan(model = med_inat.long.asb,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_inat.long.asb.fit.summary <- summary(med_inat.long.asb.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 118 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 630.327 392.911 Degrees of freedom 27 27 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.604 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 13024.596 7222.535 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.803
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.953 0.949 Tucker-Lewis Index (TLI) 0.886 0.875
Robust Comparative Fit Index (CFI) 0.955 Robust Tucker-Lewis Index (TLI) 0.889
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54986.363 -54986.363 Scaling correction factor 2.244 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.052 for the MLR correction
Akaike (AIC) 110098.725 110098.725 Bayesian (BIC) 110458.496 110458.496 Sample-size adjusted Bayesian (BIC) 110258.335 110258.335
Root Mean Square Error of Approximation:
RMSEA 0.100 0.078 90 Percent confidence interval - lower 0.093 0.073 90 Percent confidence interval - upper 0.107 0.083 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.099 90 Percent confidence interval - lower 0.090 90 Percent confidence interval - upper 0.107
Standardized Root Mean Square Residual:
SRMR 0.065 0.065
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.417 0.044 9.572 0.000 0.417 0.402 sisoe10 ~
sisoe7 0.448 0.039 11.597 0.000 0.448 0.407 sisoe12 ~
sisoe10 0.514 0.034 15.006 0.000 0.514 0.485 asbe7 ~
asbe5 0.639 0.026 24.370 0.000 0.639 0.647 asbe10 ~
asbe7 0.666 0.032 21.010 0.000 0.666 0.619 asbe12 ~
asbe10 0.725 0.029 24.808 0.000 0.725 0.697 ine7 ~
ine5 0.450 0.034 13.086 0.000 0.450 0.479 ine10 ~
ine7 0.399 0.035 11.292 0.000 0.399 0.395 ine12 ~
ine10 0.499 0.036 14.044 0.000 0.499 0.494 ine7 ~
sisoe5 0.034 0.035 0.972 0.331 0.034 0.029 ine10 ~
sisoe7 0.011 0.034 0.329 0.742 0.011 0.010 ine12 ~
sisoe10 -0.027 0.029 -0.925 0.355 -0.027 -0.026 sisoe7 ~
ine5 0.052 0.024 2.181 0.029 0.052 0.063 sisoe10 ~
ine7 0.101 0.028 3.535 0.000 0.101 0.104 sisoe12 ~
ine10 0.051 0.029 1.766 0.077 0.051 0.050 sisoe7 ~
asbe5 0.020 0.004 4.961 0.000 0.020 0.153 ine7 ~
asbe5 0.013 0.004 3.119 0.002 0.013 0.089 asbe12 ~
sisoe10 -0.177 0.173 -1.023 0.306 -0.177 -0.023 ine10 0.357 0.162 2.204 0.028 0.357 0.048 asbe7 ~
ine5 (a1) 0.338 0.153 2.211 0.027 0.338 0.053 sisoe10 ~
asbe7 (b1) 0.014 0.005 2.960 0.003 0.014 0.094 asbe10 ~
ine7 (a2) 0.239 0.195 1.227 0.220 0.239 0.033 sisoe12 ~
asbe10 (b2) 0.020 0.005 4.388 0.000 0.020 0.143 asbe7 ~
sisoe5 (c1) -0.183 0.180 -1.016 0.310 -0.183 -0.023 ine10 ~
asbe7 (d1) 0.027 0.004 6.211 0.000 0.027 0.181 asbe10 ~
sisoe7 (c2) 0.077 0.216 0.359 0.720 0.077 0.009 ine12 ~
asbe10 (d2) 0.029 0.004 6.802 0.000 0.029 0.210
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
asbe5 4.469 0.407 10.986 0.000 4.469 0.429 asbe5 ~~
ine5 6.896 0.541 12.744 0.000 6.896 0.527 sisoe5 ~~
ine5 0.627 0.074 8.476 0.000 0.627 0.388 .sisoe7 ~~
.asbe7 2.988 0.296 10.091 0.000 2.988 0.441 .asbe7 ~~
.ine7 3.170 0.264 12.006 0.000 3.170 0.419 .sisoe7 ~~
.ine7 0.272 0.037 7.314 0.000 0.272 0.241 .sisoe10 ~~
.asbe10 3.575 0.304 11.776 0.000 3.575 0.431 .asbe10 ~~
.ine10 3.227 0.300 10.745 0.000 3.227 0.374 .sisoe10 ~~
.ine10 0.326 0.049 6.710 0.000 0.326 0.253 .sisoe12 ~~
.asbe12 3.049 0.316 9.637 0.000 3.049 0.388 .asbe12 ~~
.ine12 3.258 0.342 9.518 0.000 3.258 0.426 .sisoe12 ~~
.ine12 0.323 0.045 7.190 0.000 0.323 0.273
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.215 0.037 5.744 0.000 0.215 0.182 .sisoe10 0.353 0.039 9.133 0.000 0.353 0.272 .sisoe12 0.215 0.037 5.723 0.000 0.215 0.156 .asbe7 2.746 0.246 11.158 0.000 2.746 0.303 .asbe10 3.022 0.267 11.309 0.000 3.022 0.310 .asbe12 2.885 0.248 11.620 0.000 2.885 0.285 .ine7 0.142 0.040 3.523 0.000 0.142 0.106 .ine10 0.149 0.037 4.051 0.000 0.149 0.110 .ine12 0.038 0.033 1.161 0.245 0.038 0.028 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 asbe5 11.841 0.194 60.901 0.000 11.841 1.289 ine5 0.877 0.030 29.074 0.000 0.877 0.615
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all ine5 2.029 0.124 16.409 0.000 2.029 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 asbe5 84.369 4.076 20.697 0.000 84.369 1.000 .ine7 1.258 0.072 17.517 0.000 1.258 0.703 .sisoe7 1.008 0.060 16.666 0.000 1.008 0.728 .asbe7 45.550 2.600 17.516 0.000 45.550 0.555 .ine10 1.336 0.086 15.580 0.000 1.336 0.733 .sisoe10 1.236 0.076 16.288 0.000 1.236 0.734 .asbe10 55.797 3.244 17.199 0.000 55.797 0.588 .ine12 1.153 0.082 14.132 0.000 1.153 0.621 .sisoe12 1.214 0.079 15.460 0.000 1.214 0.644 .asbe12 50.808 2.874 17.678 0.000 50.808 0.495
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1a 0.005 0.003 1.805 0.071 0.005 0.005 indirect1b 0.005 0.004 1.177 0.239 0.005 0.005 indirect2a -0.005 0.005 -1.000 0.317 -0.005 -0.004 indirect2b 0.002 0.006 0.361 0.718 0.002 0.002
med_inat.long2.asb <- '
###### Autoregressive lags ######
## Isolation
sisoe7 ~ sisoe5
sisoe10 ~ sisoe7
sisoe12 ~ sisoe10
## Anti social bahviour
asbe7 ~ asbe5
asbe10 ~ asbe7
asbe12 ~ asbe10
## ADHD
ine7 ~ ine5
ine10 ~ ine7
ine12 ~ ine10
###### Cross lag paths ######
## Isolation
ine7 ~ e*sisoe5
ine10 ~ e*sisoe7
ine12 ~ e*sisoe10
## ADHD
sisoe7 ~ f*ine5
sisoe10 ~ f*ine7
sisoe12 ~ f*ine10
## Antisocial
sisoe7 ~ b*asbe5
ine7 ~ d*asbe5
asbe12 ~ c*sisoe10
asbe12 ~ a*ine10
###### mediation paths ######
## ADHD to Isolation
asbe7 ~ a*ine5
sisoe10 ~ b*asbe7
asbe10 ~ a*ine7
sisoe12 ~ b*asbe10
## Isolation to ADHD
asbe7 ~ c*sisoe5
ine10 ~ d*asbe7
asbe10 ~ c*sisoe7
ine12 ~ d*asbe10
###### Covariances ######
sisoe5 ~~ asbe5
asbe5 ~~ ine5
sisoe5 ~~ ine5
sisoe7 ~~ asbe7
asbe7 ~~ ine7
sisoe7 ~~ ine7
sisoe10 ~~ asbe10
asbe10 ~~ ine10
sisoe10 ~~ ine10
sisoe12 ~~ asbe12
asbe12 ~~ ine12
sisoe12 ~~ ine12
###### Variances ######
## Variances
ine5 ~~ ine5
sisoe5 ~~ sisoe5
asbe5 ~~ asbe5
## Residual variances
ine7 ~~ ine7
sisoe7 ~~ sisoe7
asbe7 ~~ asbe7
ine10 ~~ ine10
sisoe10 ~~ sisoe10
asbe10 ~~ asbe10
ine12 ~~ ine12
sisoe12 ~~ sisoe12
asbe12 ~~ asbe12
###### Indirect effects (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
med_inat.long2.asb.fit <- lavaan(model = med_inat.long2.asb,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
med_inat.long2.asb.fit.summary <- summary(med_inat.long2.asb.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 87 iterations
Estimator ML Optimization method NLMINB Number of model parameters 63 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 657.472 399.256 Degrees of freedom 39 39 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.647 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 13024.596 7222.535 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.803
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.952 0.950 Tucker-Lewis Index (TLI) 0.919 0.915
Robust Comparative Fit Index (CFI) 0.954 Robust Tucker-Lewis Index (TLI) 0.922
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54999.935 -54999.935 Scaling correction factor 1.912 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.052 for the MLR correction
Akaike (AIC) 110101.870 110101.870 Bayesian (BIC) 110393.113 110393.113 Sample-size adjusted Bayesian (BIC) 110231.078 110231.078
Root Mean Square Error of Approximation:
RMSEA 0.084 0.064 90 Percent confidence interval - lower 0.079 0.060 90 Percent confidence interval - upper 0.090 0.069 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.083 90 Percent confidence interval - lower 0.075 90 Percent confidence interval - upper 0.090
Standardized Root Mean Square Residual:
SRMR 0.065 0.065
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe7 ~
sisoe5 0.422 0.039 10.728 0.000 0.422 0.405 sisoe10 ~
sisoe7 0.435 0.034 12.720 0.000 0.435 0.397 sisoe12 ~
sisoe10 0.518 0.031 16.640 0.000 0.518 0.488 asbe7 ~
asbe5 0.650 0.022 29.552 0.000 0.650 0.653 asbe10 ~
asbe7 0.670 0.026 25.672 0.000 0.670 0.627 asbe12 ~
asbe10 0.715 0.025 28.587 0.000 0.715 0.692 ine7 ~
ine5 0.427 0.031 13.908 0.000 0.427 0.451 ine10 ~
ine7 0.412 0.031 13.454 0.000 0.412 0.412 ine12 ~
ine10 0.507 0.032 15.846 0.000 0.507 0.505 ine7 ~
sisoe5 (e) 0.006 0.018 0.344 0.731 0.006 0.005 ine10 ~
sisoe7 (e) 0.006 0.018 0.344 0.731 0.006 0.006 ine12 ~
sisoe10 (e) 0.006 0.018 0.344 0.731 0.006 0.006 sisoe7 ~
ine5 (f) 0.066 0.016 4.273 0.000 0.066 0.080 sisoe10 ~
ine7 (f) 0.066 0.016 4.273 0.000 0.066 0.069 sisoe12 ~
ine10 (f) 0.066 0.016 4.273 0.000 0.066 0.065 sisoe7 ~
asbe5 (b) 0.018 0.002 7.324 0.000 0.018 0.140 ine7 ~
asbe5 (d) 0.023 0.003 9.054 0.000 0.023 0.158 asbe12 ~
sisoe10 (c) -0.105 0.104 -1.009 0.313 -0.105 -0.013 ine10 (a) 0.308 0.097 3.185 0.001 0.308 0.041 asbe7 ~
ine5 (a) 0.308 0.097 3.185 0.001 0.308 0.048 sisoe10 ~
asbe7 (b) 0.018 0.002 7.324 0.000 0.018 0.127 asbe10 ~
ine7 (a) 0.308 0.097 3.185 0.001 0.308 0.043 sisoe12 ~
asbe10 (b) 0.018 0.002 7.324 0.000 0.018 0.128 asbe7 ~
sisoe5 (c) -0.105 0.104 -1.009 0.313 -0.105 -0.013 ine10 ~
asbe7 (d) 0.023 0.003 9.054 0.000 0.023 0.157 asbe10 ~
sisoe7 (c) -0.105 0.104 -1.009 0.313 -0.105 -0.013 ine12 ~
asbe10 (d) 0.023 0.003 9.054 0.000 0.023 0.167
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all sisoe5 ~~
asbe5 4.469 0.407 10.986 0.000 4.469 0.429 asbe5 ~~
ine5 6.896 0.541 12.744 0.000 6.896 0.527 sisoe5 ~~
ine5 0.627 0.074 8.476 0.000 0.627 0.388 .sisoe7 ~~
.asbe7 2.988 0.295 10.120 0.000 2.988 0.441 .asbe7 ~~
.ine7 3.178 0.264 12.051 0.000 3.178 0.419 .sisoe7 ~~
.ine7 0.271 0.037 7.320 0.000 0.271 0.240 .sisoe10 ~~
.asbe10 3.574 0.304 11.751 0.000 3.574 0.430 .asbe10 ~~
.ine10 3.229 0.301 10.713 0.000 3.229 0.374 .sisoe10 ~~
.ine10 0.325 0.049 6.671 0.000 0.325 0.252 .sisoe12 ~~
.asbe12 3.050 0.317 9.630 0.000 3.050 0.388 .asbe12 ~~
.ine12 3.267 0.343 9.518 0.000 3.267 0.426 .sisoe12 ~~
.ine12 0.324 0.045 7.176 0.000 0.324 0.273
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .sisoe7 0.217 0.031 6.961 0.000 0.217 0.184 .sisoe10 0.342 0.029 11.673 0.000 0.342 0.264 .sisoe12 0.220 0.028 7.981 0.000 0.220 0.161 .asbe7 2.574 0.218 11.822 0.000 2.574 0.282 .asbe10 3.082 0.224 13.778 0.000 3.082 0.316 .asbe12 2.959 0.222 13.353 0.000 2.959 0.294 .ine7 0.064 0.028 2.276 0.023 0.064 0.048 .ine10 0.182 0.027 6.758 0.000 0.182 0.135 .ine12 0.064 0.024 2.677 0.007 0.064 0.047 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717 asbe5 11.841 0.194 60.901 0.000 11.841 1.289 ine5 0.877 0.030 29.074 0.000 0.877 0.615
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all ine5 2.029 0.124 16.409 0.000 2.029 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 asbe5 84.369 4.076 20.697 0.000 84.369 1.000 .ine7 1.265 0.072 17.520 0.000 1.265 0.694 .sisoe7 1.008 0.061 16.658 0.000 1.008 0.724 .asbe7 45.572 2.599 17.538 0.000 45.572 0.545 .ine10 1.337 0.086 15.578 0.000 1.337 0.733 .sisoe10 1.238 0.076 16.240 0.000 1.238 0.739 .asbe10 55.830 3.250 17.181 0.000 55.830 0.585 .ine12 1.156 0.082 14.082 0.000 1.156 0.629 .sisoe12 1.214 0.079 15.456 0.000 1.214 0.644 .asbe12 50.827 2.874 17.686 0.000 50.827 0.500
Defined Parameters: Estimate Std.Err z-value P(>|z|) Std.lv Std.all indirect1 0.006 0.002 3.140 0.002 0.006 0.006 indirect2 -0.002 0.002 -0.981 0.326 -0.002 -0.002
The cross-lag constraints gave a non-significant loss in model fit (p=0.2127). Therefore this model 2 will be carried forward.
# Model fit
med_inat.long2.asb.fit.summary.fit <- table.model.fit(med_inat.long2.asb.fit.summary)
# Coefficients
med_inat.long2.asb.fit.summary.reg <- table.model.coef(model = med_inat.long2.asb.fit.summary, step = "S2") %>% mutate_if(is.numeric, round, 3)
med_inat.long2.asb.fit.summary.reg %>%
select(lhs, op, rhs, label, std.all, pvalue)
ri.med_inat.long.asb.full <- '
###### Create random intercepts ######
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12
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*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
## 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 ~ wsi5
wad10 ~ wsi7
wad12 ~ wsi10
## ADHD
wsi7 ~ wad5
wsi10 ~ wad7
wsi12 ~ wad10
## antisocial
wsi7 ~ wasb5
wad7 ~ wasb5
wasb12 ~ wsi10
wasb12 ~ wad10
###### Mediation paths ######
## ADHD to Isolation
wasb7 ~ a1*wad5
wsi10 ~ b1*wasb7
wasb10 ~ a2*wad7
wsi12 ~ b2*wasb10
## Isolation to ADHD
wasb7 ~ c1*wsi5
wad10 ~ d1*wasb7
wasb10 ~ c2*wsi7
wad12 ~ d2*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 effects (a*b) ######
indirect1a := a1*b1
indirect1b := a2*b2
indirect2a := c1*d1
indirect2b := c2*d2
'
ri.med_inat.long.asb.full.fit <- lavaan(model = ri.med_inat.long.asb.full,
data = dat,
missing = 'ML',
meanstructure = TRUE,
se = "robust",
int.ov.free = TRUE,
estimator = "MLR")
ri.med_inat.long.asb.full.fit.summary <- summary(ri.med_inat.long.asb.full.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 301 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 95.823 62.955 Degrees of freedom 21 21 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.522 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 13024.596 7222.535 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.803
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.994 0.994 Tucker-Lewis Index (TLI) 0.982 0.982
Robust Comparative Fit Index (CFI) 0.995 Robust Tucker-Lewis Index (TLI) 0.984
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54719.111 -54719.111 Scaling correction factor 2.213 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.052 for the MLR correction
Akaike (AIC) 109576.221 109576.221 Bayesian (BIC) 109970.256 109970.256 Sample-size adjusted Bayesian (BIC) 109751.033 109751.033
Root Mean Square Error of Approximation:
RMSEA 0.040 0.030 90 Percent confidence interval - lower 0.032 0.023 90 Percent confidence interval - upper 0.048 0.037 P-value RMSEA <= 0.05 0.978 1.000
Robust RMSEA 0.037 90 Percent confidence interval - lower 0.027 90 Percent confidence interval - upper 0.048
Standardized Root Mean Square Residual:
SRMR 0.030 0.030
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.910 0.635 ine7 1.000 0.910 0.684 ine10 1.000 0.910 0.671 ine12 1.000 0.910 0.673 RIsi =~
sisoe5 1.000 0.687 0.596 sisoe7 1.000 0.687 0.584 sisoe10 1.000 0.687 0.534 sisoe12 1.000 0.687 0.509 RIasb =~
asbe5 1.000 6.910 0.749 asbe7 1.000 6.910 0.770 asbe10 1.000 6.910 0.711 asbe12 1.000 6.910 0.690 wsi5 =~
sisoe5 1.000 0.926 0.803 wsi7 =~
sisoe7 1.000 0.954 0.812 wsi10 =~
sisoe10 1.000 1.088 0.846 wsi12 =~
sisoe12 1.000 1.160 0.860 wad5 =~
ine5 1.000 1.107 0.773 wad7 =~
ine7 1.000 0.970 0.730 wad10 =~
ine10 1.000 1.004 0.741 wad12 =~
ine12 1.000 0.999 0.739 wasb5 =~
asbe5 1.000 6.109 0.662 wasb7 =~
asbe7 1.000 5.734 0.639 wasb10 =~
asbe10 1.000 6.843 0.704 wasb12 =~
asbe12 1.000 7.252 0.724
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.201 0.057 3.527 0.000 0.196 0.196 wsi10 ~
wsi7 0.268 0.059 4.577 0.000 0.235 0.235 wsi12 ~
wsi10 0.389 0.047 8.204 0.000 0.365 0.365 wasb7 ~
wasb5 0.205 0.060 3.437 0.001 0.218 0.218 wasb10 ~
wasb7 0.215 0.065 3.299 0.001 0.180 0.180 wasb12 ~
wasb10 0.457 0.049 9.313 0.000 0.431 0.431 wad7 ~
wad5 0.182 0.049 3.734 0.000 0.207 0.207 wad10 ~
wad7 0.032 0.061 0.519 0.604 0.031 0.031 wad12 ~
wad10 0.209 0.055 3.818 0.000 0.210 0.210 wad7 ~
wsi5 0.055 0.046 1.201 0.230 0.052 0.052 wad10 ~
wsi7 0.062 0.057 1.088 0.276 0.059 0.059 wad12 ~
wsi10 -0.021 0.043 -0.484 0.629 -0.022 -0.022 wsi7 ~
wad5 0.056 0.035 1.586 0.113 0.065 0.065 wsi10 ~
wad7 0.060 0.047 1.294 0.196 0.054 0.054 wsi12 ~
wad10 -0.020 0.046 -0.429 0.668 -0.017 -0.017 wsi7 ~
wasb5 0.008 0.008 1.077 0.281 0.054 0.054 wad7 ~
wasb5 -0.016 0.008 -2.047 0.041 -0.099 -0.099 wasb12 ~
wsi10 -0.055 0.252 -0.217 0.828 -0.008 -0.008 wad10 -0.135 0.273 -0.497 0.620 -0.019 -0.019 wasb7 ~
wad5 (a1) 0.013 0.234 0.055 0.956 0.002 0.002 wsi10 ~
wasb7 (b1) 0.003 0.009 0.344 0.731 0.015 0.015 wasb10 ~
wad7 (a2) -0.439 0.339 -1.294 0.195 -0.062 -0.062 wsi12 ~
wasb10 (b2) 0.016 0.007 2.478 0.013 0.097 0.097 wasb7 ~
wsi5 (c1) -0.252 0.298 -0.845 0.398 -0.041 -0.041 wad10 ~
wasb7 (d1) 0.006 0.009 0.644 0.520 0.033 0.033 wasb10 ~
wsi7 (c2) 0.622 0.365 1.704 0.088 0.087 0.087 wad12 ~
wasb10 (d2) 0.018 0.007 2.774 0.006 0.125 0.125
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 1.788 0.391 4.575 0.000 0.316 0.316 wad5 ~~
wasb5 2.547 0.411 6.194 0.000 0.377 0.377 wsi5 ~~
wad5 0.314 0.067 4.652 0.000 0.306 0.306 .wsi7 ~~
.wasb7 2.337 0.375 6.236 0.000 0.451 0.451 .wad7 ~~
.wasb7 1.696 0.333 5.093 0.000 0.319 0.319 .wsi7 ~~
.wad7 0.199 0.047 4.279 0.000 0.227 0.227 .wsi10 ~~
.wasb10 3.064 0.338 9.060 0.000 0.437 0.437 .wad10 ~~
.wasb10 2.207 0.363 6.078 0.000 0.331 0.331 .wsi10 ~~
.wad10 0.264 0.056 4.706 0.000 0.251 0.251 .wsi12 ~~
.wasb12 2.617 0.302 8.678 0.000 0.377 0.377 .wad12 ~~
.wasb12 2.551 0.305 8.364 0.000 0.403 0.403 .wsi12 ~~
.wad12 0.246 0.045 5.514 0.000 0.242 0.242 RIad ~~
RIsi 0.351 0.040 8.681 0.000 0.561 0.561 RIasb 4.438 0.383 11.588 0.000 0.706 0.706 RIsi ~~
RIasb 3.030 0.308 9.852 0.000 0.639 0.639
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.877 0.030 29.074 0.000 0.877 0.612 .ine7 0.718 0.029 25.144 0.000 0.718 0.540 .ine10 0.726 0.029 25.103 0.000 0.726 0.536 .ine12 0.673 0.029 23.136 0.000 0.673 0.498 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.705 .sisoe7 0.831 0.025 33.076 0.000 0.831 0.707 .sisoe10 0.940 0.028 33.757 0.000 0.940 0.731 .sisoe12 0.941 0.029 31.929 0.000 0.941 0.698 .asbe5 11.841 0.194 60.901 0.000 11.841 1.284 .asbe7 10.452 0.193 54.182 0.000 10.452 1.164 .asbe10 10.226 0.209 49.003 0.000 10.226 1.051 .asbe12 10.386 0.217 47.921 0.000 10.386 1.037 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 1.225 0.098 12.512 0.000 1.000 1.000 wsi5 0.858 0.101 8.482 0.000 1.000 1.000 wasb5 37.314 3.170 11.770 0.000 1.000 1.000 .wad7 0.901 0.078 11.618 0.000 0.957 0.957 .wsi7 0.853 0.071 12.070 0.000 0.938 0.938 .wasb7 31.428 3.187 9.861 0.000 0.956 0.956 .wad10 0.999 0.099 10.102 0.000 0.991 0.991 .wsi10 1.103 0.080 13.701 0.000 0.932 0.932 .wasb10 44.561 3.624 12.296 0.000 0.952 0.952 .wad12 0.926 0.076 12.213 0.000 0.927 0.927 .wsi12 1.116 0.080 13.907 0.000 0.830 0.830 .wasb12 43.262 2.595 16.672 0.000 0.823 0.823 RIad 0.827 0.068 12.236 0.000 1.000 1.000 RIsi 0.472 0.057 8.296 0.000 1.000 1.000 RIasb 47.754 3.034 15.738 0.000 1.000 1.000 .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 .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 indirect1a 0.000 0.001 0.054 0.957 0.000 0.000 indirect1b -0.007 0.006 -1.220 0.223 -0.006 -0.006 indirect2a -0.001 0.003 -0.456 0.649 -0.001 -0.001 indirect2b 0.011 0.007 1.638 0.101 0.011 0.011
ri.med_inat.long.asb.full2 <- '
###### Create random intercepts ######
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12
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*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
## asbsocial
wasb5 =~ 1*asbe5
wasb7 =~ 1*asbe7
wasb10 =~ 1*asbe10
wasb12 =~ 1*asbe12
###### Autoregressive lags ######
## Isolation
wsi7 ~ wsi5
wsi10 ~ wsi7
wsi12 ~ wsi10
## asb social bahviour
wasb7 ~ wasb5
wasb10 ~ wasb7
wasb12 ~ wasb10
## ADHD
wad7 ~ wad5
wad10 ~ wad7
wad12 ~ wad10
###### Cross lag paths ######
## Isolation
wad7 ~ e*wsi5
wad10 ~ e*wsi7
wad12 ~ e*wsi10
## ADHD
wsi7 ~ f*wad5
wsi10 ~ f*wad7
wsi12 ~ f*wad10
## asbsocial
wsi7 ~ b*wasb5
wad7 ~ d*wasb5
wasb12 ~ c*wsi10
wasb12 ~ a*wad10
###### Mediation paths ######
## ADHD to Isolation
wasb7 ~ a*wad5
wsi10 ~ b*wasb7
wasb10 ~ a*wad7
wsi12 ~ b*wasb10
## Isolation to ADHD
wasb7 ~ c*wsi5
wad10 ~ d*wasb7
wasb10 ~ c*wsi7
wad12 ~ 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
###### Indirect effect (a*b) ######
indirect1 := a*b
indirect2 := c*d
'
ri.med_inat.long.asb.full2.fit <- lavaan(model = ri.med_inat.long.asb.full2,
data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
estimator = "MLR")
ri.med_inat.long.asb.full2.fit.summary <- summary(ri.med_inat.long.asb.full2.fit, standardized = TRUE, fit.measures = TRUE)
lavaan 0.6-10 ended normally after 195 iterations
Estimator ML Optimization method NLMINB Number of model parameters 69 Number of equality constraints 12
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 134.675 84.720 Degrees of freedom 33 33 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.590 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 13024.596 7222.535 Degrees of freedom 66 66 P-value 0.000 0.000 Scaling correction factor 1.803
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.993 Tucker-Lewis Index (TLI) 0.984 0.986
Robust Comparative Fit Index (CFI) 0.994 Robust Tucker-Lewis Index (TLI) 0.987
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -54738.537 -54738.537 Scaling correction factor 1.916 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.052 for the MLR correction
Akaike (AIC) 109591.073 109591.073 Bayesian (BIC) 109916.580 109916.580 Sample-size adjusted Bayesian (BIC) 109735.482 109735.482
Root Mean Square Error of Approximation:
RMSEA 0.037 0.026 90 Percent confidence interval - lower 0.031 0.021 90 Percent confidence interval - upper 0.044 0.032 P-value RMSEA <= 0.05 0.999 1.000
Robust RMSEA 0.033 90 Percent confidence interval - lower 0.025 90 Percent confidence interval - upper 0.042
Standardized Root Mean Square Residual:
SRMR 0.034 0.034
Parameter Estimates:
Standard errors Sandwich Information bread Observed Observed information based on Hessian
Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~
ine5 1.000 0.901 0.629 ine7 1.000 0.901 0.671 ine10 1.000 0.901 0.669 ine12 1.000 0.901 0.671 RIsi =~
sisoe5 1.000 0.684 0.592 sisoe7 1.000 0.684 0.582 sisoe10 1.000 0.684 0.535 sisoe12 1.000 0.684 0.508 RIasb =~
asbe5 1.000 6.863 0.739 asbe7 1.000 6.863 0.757 asbe10 1.000 6.863 0.712 asbe12 1.000 6.863 0.694 wsi5 =~
sisoe5 1.000 0.931 0.806 wsi7 =~
sisoe7 1.000 0.956 0.813 wsi10 =~
sisoe10 1.000 1.081 0.845 wsi12 =~
sisoe12 1.000 1.160 0.861 wad5 =~
ine5 1.000 1.112 0.777 wad7 =~
ine7 1.000 0.995 0.741 wad10 =~
ine10 1.000 1.001 0.743 wad12 =~
ine12 1.000 0.996 0.742 wasb5 =~
asbe5 1.000 6.260 0.674 wasb7 =~
asbe7 1.000 5.933 0.654 wasb10 =~
asbe10 1.000 6.777 0.703 wasb12 =~
asbe12 1.000 7.111 0.720
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi7 ~
wsi5 0.216 0.052 4.165 0.000 0.210 0.210 wsi10 ~
wsi7 0.229 0.054 4.283 0.000 0.203 0.203 wsi12 ~
wsi10 0.394 0.042 9.267 0.000 0.367 0.367 wasb7 ~
wasb5 0.252 0.049 5.157 0.000 0.265 0.265 wasb10 ~
wasb7 0.240 0.062 3.858 0.000 0.210 0.210 wasb12 ~
wasb10 0.413 0.048 8.584 0.000 0.394 0.394 wad7 ~
wad5 0.163 0.046 3.513 0.000 0.182 0.182 wad10 ~
wad7 0.057 0.056 1.024 0.306 0.057 0.057 wad12 ~
wad10 0.226 0.049 4.613 0.000 0.227 0.227 wad7 ~
wsi5 (e) 0.023 0.029 0.794 0.427 0.022 0.022 wad10 ~
wsi7 (e) 0.023 0.029 0.794 0.427 0.022 0.022 wad12 ~
wsi10 (e) 0.023 0.029 0.794 0.427 0.025 0.025 wsi7 ~
wad5 (f) 0.031 0.027 1.146 0.252 0.036 0.036 wsi10 ~
wad7 (f) 0.031 0.027 1.146 0.252 0.028 0.028 wsi12 ~
wad10 (f) 0.031 0.027 1.146 0.252 0.026 0.026 wsi7 ~
wasb5 (b) 0.011 0.005 2.424 0.015 0.074 0.074 wad7 ~
wasb5 (d) 0.006 0.005 1.172 0.241 0.036 0.036 wasb12 ~
wsi10 (c) 0.118 0.184 0.644 0.520 0.018 0.018 wad10 (a) -0.138 0.170 -0.812 0.417 -0.019 -0.019 wasb7 ~
wad5 (a) -0.138 0.170 -0.812 0.417 -0.026 -0.026 wsi10 ~
wasb7 (b) 0.011 0.005 2.424 0.015 0.062 0.062 wasb10 ~
wad7 (a) -0.138 0.170 -0.812 0.417 -0.020 -0.020 wsi12 ~
wasb10 (b) 0.011 0.005 2.424 0.015 0.066 0.066 wasb7 ~
wsi5 (c) 0.118 0.184 0.644 0.520 0.019 0.019 wad10 ~
wasb7 (d) 0.006 0.005 1.172 0.241 0.034 0.034 wasb10 ~
wsi7 (c) 0.118 0.184 0.644 0.520 0.017 0.017 wad12 ~
wasb10 (d) 0.006 0.005 1.172 0.241 0.039 0.039
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wsi5 ~~
wasb5 2.007 0.336 5.979 0.000 0.344 0.344 wad5 ~~
wasb5 2.776 0.370 7.495 0.000 0.399 0.399 wsi5 ~~
wad5 0.315 0.065 4.874 0.000 0.304 0.304 .wsi7 ~~
.wasb7 2.395 0.339 7.066 0.000 0.453 0.453 .wad7 ~~
.wasb7 1.998 0.297 6.722 0.000 0.359 0.359 .wsi7 ~~
.wad7 0.192 0.044 4.399 0.000 0.214 0.214 .wsi10 ~~
.wasb10 3.032 0.316 9.603 0.000 0.437 0.437 .wad10 ~~
.wasb10 2.087 0.330 6.319 0.000 0.316 0.316 .wsi10 ~~
.wad10 0.259 0.052 4.966 0.000 0.248 0.248 .wsi12 ~~
.wasb12 2.632 0.303 8.697 0.000 0.381 0.381 .wad12 ~~
.wasb12 2.476 0.296 8.376 0.000 0.393 0.393 .wsi12 ~~
.wad12 0.259 0.044 5.920 0.000 0.254 0.254 RIad ~~
RIsi 0.347 0.039 8.901 0.000 0.564 0.564 RIasb 4.321 0.375 11.533 0.000 0.699 0.699 RIsi ~~
RIasb 2.906 0.287 10.115 0.000 0.619 0.619
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.877 0.030 29.074 0.000 0.877 0.613 .ine7 0.718 0.029 25.148 0.000 0.718 0.535 .ine10 0.726 0.029 25.104 0.000 0.726 0.539 .ine12 0.673 0.029 23.136 0.000 0.673 0.501 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.704 .sisoe7 0.831 0.025 33.084 0.000 0.831 0.707 .sisoe10 0.940 0.028 33.745 0.000 0.940 0.735 .sisoe12 0.941 0.029 31.930 0.000 0.941 0.699 .asbe5 11.841 0.194 60.901 0.000 11.841 1.275 .asbe7 10.453 0.193 54.172 0.000 10.453 1.152 .asbe10 10.224 0.209 49.001 0.000 10.224 1.060 .asbe12 10.387 0.217 47.931 0.000 10.387 1.051 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 1.237 0.096 12.878 0.000 1.000 1.000 wsi5 0.867 0.099 8.774 0.000 1.000 1.000 wasb5 39.184 2.879 13.610 0.000 1.000 1.000 .wad7 0.947 0.076 12.452 0.000 0.957 0.957 .wsi7 0.852 0.068 12.539 0.000 0.932 0.932 .wasb7 32.766 3.041 10.774 0.000 0.931 0.931 .wad10 0.995 0.094 10.622 0.000 0.992 0.992 .wsi10 1.096 0.080 13.735 0.000 0.938 0.938 .wasb10 43.873 3.620 12.119 0.000 0.955 0.955 .wad12 0.930 0.076 12.199 0.000 0.937 0.937 .wsi12 1.121 0.081 13.895 0.000 0.833 0.833 .wasb12 42.636 2.609 16.345 0.000 0.843 0.843 RIad 0.811 0.066 12.363 0.000 1.000 1.000 RIsi 0.468 0.055 8.542 0.000 1.000 1.000 RIasb 47.102 3.034 15.525 0.000 1.000 1.000 .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 .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 indirect1 -0.002 0.002 -0.757 0.449 -0.001 -0.001 indirect2 0.001 0.001 0.624 0.533 0.001 0.001
lavTestLRT(ri.med_inat.long.asb.full.fit, ri.med_inat.long.asb.full2.fit, method = "satorra.bentler.2010")
The cross-lag constraints gave a non-significant loss in model fit (p=0.04084). THIS MODEL SHOULD USE THE UNCONSTRAINED MODEL
# Model fit
ri.med_inat.long.asb.full.fit.summary.fit <- table.model.fit(ri.med_inat.long.asb.full.fit.summary)
# Coefficients -
ri.med_inat.long.asb.full.fit.summary.reg <- table.model.coef(model = ri.med_inat.long.asb.full.fit.summary, step = "S3") %>% mutate_if(is.numeric, round, 3)
ri.med_inat.long.asb.full.fit.summary.reg %>%
select(lhs, op, rhs, std.all, pvalue) %>%
filter(lhs == "indirect1" | lhs == "indirect2")
Work by Katherine N Thompson
katherine.n.thompson@kcl.ac.uk