<- read_dta(paste0(data.raw_path, "Katie_19Jan22.dta"))
dat.raw
<- dat.raw %>%
dat ::select(id = atwinid,
dplyr
sampsex,
seswq35,
sethnic,# social isolation mother report
sisoem5,
sisoem7,
sisoem10,
sisoem12,# social isolation teacher report
sisoet5,
sisoet7,
sisoet10,
sisoet12,# total ADHD mother report
tadhdem5,
tadhdem7,
tadhdem10,
tadhdem12,# total ADHD teacher report
tadhdet5,
tadhdet7,
tadhdet10,
tadhdet12,# hyperactivity ADHD mother report
hyem5,
hyem7,
hyem10,
hyem12, # hyperactivity ADHD teacher report
hyet5,
hyet7,
hyet10,
hyet12,# inattention ADHD mother report
inem5,
inem7,
inem10,
inem12,# inattention ADHD teacher report
inet5,
inet7,
inet10,
inet12,
sisoe5,
sisoe7,
sisoe10,
sisoe12
)
colnames(dat)
[1] “id” “sampsex” “seswq35” “sethnic” “sisoem5” “sisoem7”
[7] “sisoem10” “sisoem12” “sisoet5” “sisoet7” “sisoet10” “sisoet12” [13] “tadhdem5” “tadhdem7” “tadhdem10” “tadhdem12” “tadhdet5” “tadhdet7” [19] “tadhdet10” “tadhdet12” “hyem5” “hyem7” “hyem10” “hyem12”
[25] “hyet5” “hyet7” “hyet10” “hyet12” “inem5” “inem7”
[31] “inem10” “inem12” “inet5” “inet7” “inet10” “inet12”
[37] “sisoe5” “sisoe7” “sisoe10” “sisoe12”
# Table of model fit
<- function(model){
table.model.fit <- as.data.frame(t(as.data.frame(model$FIT))) %>%
model.fit ::select(chisq, df, chisq.scaled, cfi.robust, tli.robust, aic, bic, bic2, rmsea.robust, rmsea.ci.lower.robust, rmsea.ci.upper.robust, srmr) #can only be used with "MLR" estimator
dplyrreturn(model.fit)
}
# Table of regression and correlation (standardised covariance) coefficients
<- function(model, type, constraints){
table.model.coef if (type == "RICLPM" & constraints == "No"){
<- as.tibble(model$PE[c(17:32),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
model.coef return(model.coef)
else if(type == "RICLPM" & constraints == "Yes"){
} <- as.tibble(model$PE[c(17:32),]) %>% dplyr::select(-exo, -label, -std.lv, -std.nox)
model.coef return(model.coef)
else if(type == "CLPM" & constraints == "No"){
} <- as.tibble(model$PE[c(1:16),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
model.coef return(model.coef)
else if(type == "CLPM" & constraints == "Yes"){
} <- as.tibble(model$PE[c(1:16),]) %>% dplyr::select(-exo, -std.lv, -std.nox)
model.coef return(model.coef)
else {model.coef <- NULL}
} }
# 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)))))
)
<- readRDS(file = paste0(data_path2, "class_joined_preprocessed_isolation_data_full_sample.rds")) %>%
dat2 select(id, acorn_05)
<- list(dat, dat2)
dataframes_acorn
<- plyr::join_all(
dat
dataframes_acorn,by = "id"
)
colnames(dat)
[1] “id” “sampsex” “seswq35” “sethnic” “sisoem5” “sisoem7”
[7] “sisoem10” “sisoem12” “sisoet5” “sisoet7” “sisoet10” “sisoet12” [13] “tadhdem5” “tadhdem7” “tadhdem10” “tadhdem12” “tadhdet5” “tadhdet7” [19] “tadhdet10” “tadhdet12” “hyem5” “hyem7” “hyem10” “hyem12”
[25] “hyet5” “hyet7” “hyet10” “hyet12” “inem5” “inem7”
[31] “inem10” “inem12” “inet5” “inet7” “inet10” “inet12”
[37] “sisoe5” “sisoe7” “sisoe10” “sisoe12” “tadhde5” “tadhde7”
[43] “tadhde10” “tadhde12” “hye5” “hye7” “hye10” “hye12”
[49] “ine5” “ine7” “ine10” “ine12” “acorn_05”
<- dat %>%
dat mutate(
sex =
recode_factor(as_factor(sampsex),
"1" = "Male",
"2" = "Female"))
table(dat$sex)
Male Female 1092 1140
<- dat %>%
dat mutate(
SES =
recode_factor(as_factor(seswq35),
"1" = "Low",
"2" = "Middle",
"3" = "High"))
table(dat$SES)
Low Middle High 742 738 752
<- dat %>%
dat mutate(
ethnicity =
recode_factor(as_factor(sethnic),
"1" = "White",
"2" = "Asian",
"3" = "Black",
"4" = "Mixed race",
"5" = "Other"))
table(dat$ethnicity)
White Asian Black Mixed race Other Missing
2018 90 42 8 74 0
<- dat %>%
dat mutate(
sisoe5.numeric = as.numeric(sisoe5),
sisoe7.numeric = as.numeric(sisoe7),
sisoe10.numeric = as.numeric(sisoe10),
sisoe12.numeric = as.numeric(sisoe12)
)
<- dat %>% filter(sex == "Female")
data.female <- dat %>% filter (sex == "Male") data.male
<- dat %>% #create object to bind later on
ethnicity_descriptives.raw count(sex, ethnicity) %>%
mutate(Prop = round(n/sum(n)*100, 2)) %>%
pivot_wider(names_from = sex, values_from = c(n, Prop)) %>%
mutate(Total = n_Male + n_Female,
Prop_total = Prop_Male + Prop_Female) %>%
select(
"Descriptive" = ethnicity,
"Male" = n_Male,
"% Male" = Prop_Male,
"Female" = n_Female,
"% Female" = Prop_Female,
"Total" = Total,
"% Total" = Prop_total)
<- ethnicity_descriptives.raw[-c(7), ]
ethnicity_descriptives ethnicity_descriptives
<- dat %>% #create object to bind later on
fam_ses_descriptives.raw count(sex, SES) %>%
mutate(Prop = round(n/sum(n)*100, 2)) %>%
pivot_wider(names_from = sex, values_from = c(n, Prop)) %>%
mutate(Total = n_Male + n_Female,
Prop_total = Prop_Male + Prop_Female) %>%
select(
"Descriptive" = SES,
"Male" = n_Male,
"% Male" = Prop_Male,
"Female" = n_Female,
"% Female" = Prop_Female,
"Total" = Total,
"% Total" = Prop_total)
<- fam_ses_descriptives.raw[-c(7), ]
fam_ses_descriptives fam_ses_descriptives
<- dat %>% #create object to bind later on
neigh_ses_descriptives.raw count(sex, acorn_05) %>%
mutate(Prop = round(n/sum(n)*100, 2)) %>%
pivot_wider(names_from = sex, values_from = c(n, Prop)) %>%
mutate(Total = n_Male + n_Female,
Prop_total = Prop_Male + Prop_Female) %>%
select(
"Descriptive" = acorn_05,
"Male" = n_Male,
"% Male" = Prop_Male,
"Female" = n_Female,
"% Female" = Prop_Female,
"Total" = Total,
"% Total" = Prop_total)
<- neigh_ses_descriptives.raw[-c(7), ]
neigh_ses_descriptives neigh_ses_descriptives
<- bind_rows(
descriptives
continuous_isolation_descriptives5,
continuous_adhd_descriptives5,
ethnicity_descriptives,
fam_ses_descriptives,
neigh_ses_descriptives
)
#add in column to show which descriptives they are
<- descriptives %>%
descriptives mutate(
Category =
c("Social isolation", "Social isolation", "Social isolation",
"ADHD symptoms", "ADHD symptoms", "ADHD symptoms",
"Ethnicity", "Ethnicity", "Ethnicity", "Ethnicity", "Ethnicity",
"Family SES", "Family SES", "Family SES",
"Neighbourhood SES", "Neighbourhood SES", "Neighbourhood SES", "Neighbourhood SES", "Neighbourhood SES", "Neighbourhood SES"),
Male = round(Male, 2),
Female = round(Female, 2),
Total = round(Total, 2),
`% Male /SD`= round(`% Male`, 2),
`% Female /SD`= round(`% Female`, 2),
`% Total`= round(`% Total`, 2)) %>%
select(
Category,
Descriptive,
Male,`% Male /SD`,
Female,`% Female /SD`,
Total,`% Total`)
#final table to be viewed in word
kable(descriptives)
Category | Descriptive | Male | % Male /SD | Female | % Female /SD | Total | % Total |
---|---|---|---|---|---|---|---|
Social isolation | mean | 0.88 | 1.23 | 0.75 | 1.03 | 0.81 | 1.13 |
Social isolation | min | 0.00 | NA | 0.00 | NA | 0.00 | NA |
Social isolation | max | 12.00 | NA | 9.00 | NA | 12.00 | NA |
ADHD symptoms | mean | 2.67 | 3.01 | 1.85 | 2.45 | 2.25 | 2.76 |
ADHD symptoms | min | 0.00 | NA | 0.00 | NA | 0.00 | NA |
ADHD symptoms | max | 16.00 | NA | 18.00 | NA | 18.00 | NA |
Ethnicity | White | 998.00 | 44.71 | 1020.00 | 45.70 | 2018.00 | 90.41 |
Ethnicity | Asian | 36.00 | 1.61 | 54.00 | 2.42 | 90.00 | 4.03 |
Ethnicity | Black | 18.00 | 0.81 | 24.00 | 1.08 | 42.00 | 1.89 |
Ethnicity | Mixed race | 4.00 | 0.18 | 4.00 | 0.18 | 8.00 | 0.36 |
Ethnicity | Other | 36.00 | 1.61 | 38.00 | 1.70 | 74.00 | 3.31 |
Family SES | Low | 360.00 | 16.13 | 382.00 | 17.11 | 742.00 | 33.24 |
Family SES | Middle | 370.00 | 16.58 | 368.00 | 16.49 | 738.00 | 33.07 |
Family SES | High | 362.00 | 16.22 | 390.00 | 17.47 | 752.00 | 33.69 |
Neighbourhood SES | Wealthy Achievers | 250.00 | 11.20 | 248.00 | 11.11 | 498.00 | 22.31 |
Neighbourhood SES | Urban Prosperity | 60.00 | 2.69 | 64.00 | 2.87 | 124.00 | 5.56 |
Neighbourhood SES | Comfortably Off | 294.00 | 13.17 | 322.00 | 14.43 | 616.00 | 27.60 |
Neighbourhood SES | Moderate Means | 158.00 | 7.08 | 166.00 | 7.44 | 324.00 | 14.52 |
Neighbourhood SES | Hard Pressed | 310.00 | 13.89 | 316.00 | 14.16 | 626.00 | 28.05 |
Neighbourhood SES | NA | 20.00 | 0.90 | 24.00 | 1.08 | 44.00 | 1.98 |
The below introductory notes have been adapted from Hamaker, Kuiper, and Grasman, 2015
The CLPM only accounts for temporal stability through the inclusion of autoregressive parameters. Thus, it is implicitly assumed that every person varies over time around the same means μt and πt, and that there are no trait-like individual differences that endure. this is a rather problematic assumption, as it is difficult to imagine a psychological construct – whether behavioral, cognitive, emotional or psychophysiological – that is not to some extent characterized by stable individual differences (if not for the entire lifespan, then at least for the duration of the study; Hamaker, ). Longitudinal data can actually be thought of as multilevel data, in which occasions are nested within individuals (or other systems, like dyads). When considering this perspective, it becomes clear that we need to separate the within-person level from the between-person level.
The random intercepts cross lagged panel model (RI-CLPM) accounts not only for temporal stability, but also for time-invariant, trait-like stability through the inclusion of a random intercept. The cross-lagged parameters indicate the extent to which the two variables influence each other. The cross-lagged relationships pertain to a process that takes place at the within-person level and they are therefore of key interest when the interest is in reciprocal influences over time within individuals or dyads. The cross-lagged parameter indicates the extent to which the change in y can be predicted from the individual’s prior deviation from their expected score on the other variable, while controlling for the structural change in y and the prior deviation from one’s expected score on y.
The CLPM requires only two waves of data, but the RI-CLPM requires at least three waves of data, in which case there is 1 degree of freedom (df). If the intervals are of the same size, and if we assume that the effects the variables have on each other remain stable over time, we could decide to constrain the lagged parameters over time, giving us an additional 4 df (i.e., 5 df in total). If we are not willing to make these assumptions, and we are not sure whether the effect of the time-invariant stability components κi and ωi are equal over time, we may wish to remove the constraint on the factor loadings. This relaxation may especially be of interest when the observations are made further apart in time, and we expect that we are also measuring some structural changes. However, this would imply that κi and ωi no longer represents random intercepts (as in multilevel modeling), but rather represent latent variables or traits (as common in SEM). Even more so, it would imply we need more waves of data to estimate this model. The gaps in our time waves may be a problem here.
# items
<- c("tadhde5",
items "sisoe5",
"tadhde7",
"sisoe7",
"tadhde10",
"sisoe10",
"tadhde12",
"sisoe12",
"tadhdem5",
"sisoem5",
"tadhdem7",
"sisoem7",
"tadhdem10",
"sisoem10",
"tadhdem12",
"sisoem12",
"tadhdet5",
"sisoet5",
"tadhdet7",
"sisoet7",
"tadhdet10",
"sisoet10",
"tadhdet12",
"sisoet12")
# create data frame
<- as.data.frame(dat[,items])
items.df is.data.frame(items.df) #check
[1] TRUE
colnames(items.df) <- c("Combined ADHD age 5",
"Combined Social isolation age 5",
"Combined ADHD age 7",
"Combined Social isolation age 7",
"Combined ADHD age 10",
"Combined Social isolation age 10",
"Combined ADHD age 12",
"Combined Social isolation age 12",
"Mother ADHD age 5",
"Mother Social isolation age 5",
"Mother ADHD age 7",
"Mother Social isolation age 7",
"Mother ADHD age 10",
"Mother Social isolation age 10",
"Mother ADHD age 12",
"Mother Social isolation age 12",
"Teacher ADHD age 5",
"Teacher Social isolation age 5",
"Teacher ADHD age 7",
"Teacher Social isolation age 7",
"Teacher ADHD age 10",
"Teacher Social isolation age 10",
"Teacher ADHD age 12",
"Teacher Social isolation age 12"
)
<- cor(items.df,
item.cor.matrix method = "pearson",
use = "pairwise.complete.obs")
as.data.frame(item.cor.matrix) %>% mutate_if(is.numeric, round, 2)
# check they are all signficant
<- Hmisc::rcorr(as.matrix(items.df),
item.cor.matrix.sig type = "pearson")
# item.cor.matrix.sig$P
Children that have complete data at all time points: 2078 (93.10%)
# missing isolation
<- dat %>%
dat mutate(missing.isolation =
if_else(
!is.na(sisoe5) &
!is.na(sisoe7) &
!is.na(sisoe10) &
!is.na(sisoe12),
true = "No",
false = "Yes"
))# table(dat$missing.isolation)
# missing adhd
<- dat %>%
dat mutate(missing.adhd =
if_else(
!is.na(tadhde5) &
!is.na(tadhde7) &
!is.na(tadhde10) &
!is.na(tadhde12),
true = "No",
false = "Yes"
))# table(dat$missing.adhd)
<- dat %>%
dat mutate(missing.both =
if_else(
== "No" &
missing.isolation == "No",
missing.adhd true = "No",
false = "Yes"
))table(dat$missing.both)
No Yes 2078 154
Model | Description |
---|---|
CLPMcomb | Cross-lagged panel model without random intercepts using combined mother and teacher report and total ADHD scores |
RICLPMcomb | Basic RI-CLPM model using combined mother and teacher report ratings for AD and SI, and total ADHD scores |
RICLPMcomb2 | RICLPMcomb but with fixed autoregressive and cross-lagged relations over time |
RICLPMcomb3 | RICLPMcomb but with constrained grand means for AD and SI |
RICLPMcomb_hyp | Basic RI-CLPM model using combined mother and teacher report ratings for AD and SI, and hyperactivity scores |
RICLPMcomb_hyp2 | RICLPMcomb_hyp but with fixed autoregressive and cross-lagged relations over time |
RICLPMcomb_hyp3 | RICLPMcomb_hyp but with constrained grand means for AD and SI |
RICLPMcomb_inat | Basic RI-CLPM model using combined mother and teacher report ratings for AD and SI, and inattention scores |
RICLPMcomb_inat2 | RICLPMcomb_inat but with fixed autoregressive and cross-lagged relations over time |
RICLPMcomb_inat3 | RICLPMcomb_inat but with constrained grand means for AD and SI |
CLPMadt | Cross-lagged panel model without random intercepts using teacher report and total ADHD scores |
RICLPMadt | Basic RI-CLPM model using teacher report ADHD and combined report isolation, and total ADHD scores |
RICLPMadt2 | RICLPMadt but with fixed autoregressive and cross-lagged relations over time |
RICLPMadt3 | RICLPMadt but with constrained grand means for AD and SI |
RICLPMadt_hyp | Basic RI-CLPM model using teacher report ADHD and combined report isolation, and hyperactivity scores |
RICLPMadt_hyp2 | RICLPMadt_hyp but with fixed autoregressive and cross-lagged relations over time |
RICLPMadt_hyp3 | RICLPMadt_hyp but with constrained grand means for AD and SI |
RICLPMadt_inat | Basic RI-CLPM model using teacher report ADHD and combined report isolation, and inattention scores |
RICLPMadt_inat2 | RICLPMadt_inat but with fixed autoregressive and cross-lagged relations over time |
RICLPMadt_inat3 | RICLPMadt_inat but with constrained grand means for AD and SI |
CLPMadm | Cross-lagged panel model without random intercepts using mother report and total ADHD scores |
RICLPMadm | Basic RI-CLPM model using mother report ADHD and combined report isolation, and total ADHD scores |
RICLPMadm2 | RICLPMadm but with fixed autoregressive and cross-lagged relations over time |
RICLPMadm3 | RICLPMadm but with constrained grand means for AD and SI |
RICLPMadm_hyp | Basic RI-CLPM model using mother report ADHD and combined report isolation, and hyperactivity scores |
RICLPMadm_hyp2 | RICLPMadm_hyp but with fixed autoregressive and cross-lagged relations over time |
RICLPMadm_hyp3 | RICLPMadm_hyp but with constrained grand means for AD and SI |
RICLPMadm_inat | Basic RI-CLPM model using mother report ADHD and combined report isolation, and inattention scores |
RICLPMadm_inat2 | RICLPMadm_inat but with fixed autoregressive and cross-lagged relations over time |
RICLPMadm_inat3 | RICLPMadm_inat but with constrained grand means for AD and SI |
For SEM in lavaan, we use three different formula types: latent variabele definitions (using the =~
operator, which can be read as is “measured by”), regression formulas (using the ~
operator), and (co)variance formulas (using the ~~
operator). The regression formulas are similar to ordinary formulas in R. The expression y1 ~~ y2
allows the residual variances of the two observed variables to be correlated. This is sometimes done if it is believed that the two variables have something in common that is not captured by the latent variables. Note that the two expressions y2 ~~ y4
and y2 ~~ y6
, can be combined into the expression y2 ~~ y4 + y6
, because the variable on the left of the ~~
operator (y2) is the same. This is just a shorthand notation. In general, to fix a parameter in a lavaan formula, you need to pre-multiply the corresponding variable in the formula by a numerical value. This is called the pre-multiplication mechanism and will be used for many purposes e.g. 1*x2
. If you wish to fix the correlation (or covariance) between a pair of latent variables to zero, you need to explicity add a covariance-formula for this pair, and fix the parameter to zero.
To specify the RI-CLPM we need four parts: notes from Mulder’s webpage.
A between part, consisting of the random intercepts. It is specified using the =~ command, RIx =~ 1*x1 1*x2 ...
, where 1* fixes the factor loading to one.
A within part, consisting of within-unit fluctuations. It is also specified using the =~ command, wx1 =~ 1*x1; wx2 =~ 1*x2;
The lagged regressions between the within-unit components, using wx2 ~ wx1 wy1; wx3 ~ wx2 wy2; ...
. Here, this is written with two variables on the left hand side of the ~
, this is doing the same thing as calculating just regression paths - but combining DVs that have the same paths leading to them, e.g. wx2 ~ wx1 + wy1
and wy2 ~ wx1 + wy1
becomes wx2+ wy2 ~ wx1 + wy1
.
Relevant covariances in both the between and within part. In the within part the components at wave 1, and their residuals at waves 2 and further are correlated within each wave, using wx1 ~~ wy1; wx2 ~~ wy2;...
. We also need to specify their (residual) variances here using wx1 ~~ wx1; wx2 ~~ wx2; ...
. For the between part we have to specify the variances and covariance of the random intercepts using RIx ~~ RIy;
.
Tips for interpreting the output: - Model Test User Model: which provides a test statistic, degrees of freedom, and a p-value for the model that was specified by the user. - Model Test Baseline Model: The baseline is a null model, typically in which all of your observed variables are constrained to covary with no other variables (put another way, the covariances are fixed to 0)–just individual variances are estimated.
<- '
CLPMcomb # Estimate the lagged effects between the observed variables.
tadhde7 + sisoe7 ~ tadhde5 + sisoe5
tadhde10 + sisoe10 ~ tadhde7 + sisoe7
tadhde12 + sisoe12 ~ tadhde10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
tadhde5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
tadhde7 ~~ sisoe7
tadhde10 ~~ sisoe10
tadhde12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
tadhde5 ~~ tadhde5 # Variances
sisoe5 ~~ sisoe5
tadhde7 ~~ tadhde7 # Residual variances
sisoe7 ~~ sisoe7
tadhde10 ~~ tadhde10
sisoe10 ~~ sisoe10
tadhde12 ~~ tadhde12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMcomb,
CLPMcomb.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMcomb.fit,
CLPMcomb.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 32 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 408.342 231.914 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.761 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6336.986 3173.081 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.997
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.937 0.930 Tucker-Lewis Index (TLI) 0.853 0.837
Robust Comparative Fit Index (CFI) 0.938 Robust Tucker-Lewis Index (TLI) 0.856
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -31883.991 -31883.991 Scaling correction factor 2.539 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.327 for the MLR correction
Akaike (AIC) 63831.982 63831.982 Bayesian (BIC) 64014.723 64014.723 Sample-size adjusted Bayesian (BIC) 63913.054 63913.054
Root Mean Square Error of Approximation:
RMSEA 0.122 0.091 90 Percent confidence interval - lower 0.112 0.083 90 Percent confidence interval - upper 0.132 0.098 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.120 90 Percent confidence interval - lower 0.107 90 Percent confidence interval - upper 0.134
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 tadhde7 ~
tadhde5 0.540 0.026 20.382 0.000 0.540 0.575 sisoe5 0.105 0.060 1.737 0.082 0.105 0.046 sisoe7 ~
tadhde5 0.057 0.010 5.451 0.000 0.057 0.134 sisoe5 0.460 0.043 10.718 0.000 0.460 0.444 tadhde10 ~
tadhde7 0.516 0.031 16.922 0.000 0.516 0.540 sisoe7 0.133 0.066 2.025 0.043 0.133 0.063 sisoe10 ~
tadhde7 0.071 0.014 5.247 0.000 0.071 0.143 sisoe7 0.485 0.036 13.335 0.000 0.485 0.440 tadhde12 ~
tadhde10 0.656 0.034 19.184 0.000 0.656 0.637 sisoe10 0.031 0.048 0.656 0.512 0.031 0.016 sisoe12 ~
tadhde10 0.067 0.014 4.902 0.000 0.067 0.121 sisoe10 0.560 0.032 17.380 0.000 0.560 0.530
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 ~~
sisoe5 1.152 0.128 8.998 0.000 1.152 0.368 .tadhde7 ~~
.sisoe7 0.548 0.076 7.220 0.000 0.548 0.259 .tadhde10 ~~
.sisoe10 0.648 0.085 7.667 0.000 0.648 0.284 .tadhde12 ~~
.sisoe12 0.604 0.089 6.818 0.000 0.604 0.278
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde7 0.514 0.062 8.250 0.000 0.514 0.198 .sisoe7 0.329 0.034 9.746 0.000 0.329 0.279 .tadhde10 0.517 0.056 9.310 0.000 0.517 0.208 .sisoe10 0.407 0.031 13.329 0.000 0.407 0.313 .tadhde12 0.400 0.049 8.142 0.000 0.400 0.156 .sisoe12 0.308 0.028 10.908 0.000 0.308 0.225 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
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 .tadhde7 4.366 0.238 18.330 0.000 4.366 0.648 .sisoe7 1.026 0.062 16.453 0.000 1.026 0.741 .tadhde10 4.186 0.265 15.807 0.000 4.186 0.679 .sisoe10 1.244 0.076 16.327 0.000 1.244 0.739 .tadhde12 3.825 0.278 13.746 0.000 3.825 0.586 .sisoe12 1.231 0.080 15.369 0.000 1.231 0.654
#Table of model fit
<- table.model.fit(CLPMcomb.fit.summary)
CLPMcomb.fit.summary.fit CLPMcomb.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMcomb.fit.summary, type = "CLPM", constraints = "No")
CLPMcomb.fit.summary.reg CLPMcomb.fit.summary.reg
%>%
CLPMcomb.fit.summary.reg select(lhs, op, rhs, std.all, pvalue) %>%
mutate_if(is.numeric, round, 3)
%>%
CLPMcomb.fit.summary.fit select(-aic, -bic, -chisq ) %>%
mutate_if(is.numeric, round, 2)
<- '
CLPMcomb2 # Estimate the lagged effects between the observed variables - constrained
tadhde7 ~ tadhde5 + d*sisoe5
sisoe7 ~ c*tadhde5 + sisoe5
tadhde10 ~ tadhde7 + d*sisoe7
sisoe10 ~ c*tadhde7 + sisoe7
tadhde12 ~ tadhde10 + d*sisoe10
sisoe12 ~ c*tadhde10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
tadhde5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
tadhde7 ~~ sisoe7
tadhde10 ~~ sisoe10
tadhde12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
tadhde5 ~~ tadhde5 # Variances
sisoe5 ~~ sisoe5
tadhde7 ~~ tadhde7 # Residual variances
sisoe7 ~~ sisoe7
tadhde10 ~~ tadhde10
sisoe10 ~~ sisoe10
tadhde12 ~~ tadhde12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMcomb2,
CLPMcomb2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMcomb2.fit,
CLPMcomb2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 29 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32 Number of equality constraints 4
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 413.577 225.030 Degrees of freedom 16 16 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.838 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6336.986 3173.081 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.997
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.937 0.934 Tucker-Lewis Index (TLI) 0.890 0.884
Robust Comparative Fit Index (CFI) 0.939 Robust Tucker-Lewis Index (TLI) 0.893
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -31886.608 -31886.608 Scaling correction factor 2.281 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.327 for the MLR correction
Akaike (AIC) 63829.217 63829.217 Bayesian (BIC) 63989.115 63989.115 Sample-size adjusted Bayesian (BIC) 63900.155 63900.155
Root Mean Square Error of Approximation:
RMSEA 0.106 0.077 90 Percent confidence interval - lower 0.097 0.070 90 Percent confidence interval - upper 0.114 0.083 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.104 90 Percent confidence interval - lower 0.092 90 Percent confidence interval - upper 0.116
Standardized Root Mean Square Residual:
SRMR 0.066 0.066
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 tadhde7 ~
tadhde5 0.546 0.026 21.359 0.000 0.546 0.580 sisoe5 (d) 0.084 0.030 2.859 0.004 0.084 0.037 sisoe7 ~
tadhde5 (c) 0.064 0.007 9.182 0.000 0.064 0.151 sisoe5 0.452 0.041 11.101 0.000 0.452 0.435 tadhde10 ~
tadhde7 0.521 0.028 18.647 0.000 0.521 0.547 sisoe7 (d) 0.084 0.030 2.859 0.004 0.084 0.040 sisoe10 ~
tadhde7 (c) 0.064 0.007 9.182 0.000 0.064 0.129 sisoe7 0.484 0.033 14.550 0.000 0.484 0.441 tadhde12 ~
tadhde10 0.644 0.033 19.290 0.000 0.644 0.625 sisoe10 (d) 0.084 0.030 2.859 0.004 0.084 0.043 sisoe12 ~
tadhde10 (c) 0.064 0.007 9.182 0.000 0.064 0.116 sisoe10 0.569 0.030 18.755 0.000 0.569 0.535
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 ~~
sisoe5 1.152 0.128 8.998 0.000 1.152 0.368 .tadhde7 ~~
.sisoe7 0.548 0.076 7.225 0.000 0.548 0.259 .tadhde10 ~~
.sisoe10 0.649 0.085 7.649 0.000 0.649 0.284 .tadhde12 ~~
.sisoe12 0.604 0.089 6.816 0.000 0.604 0.278
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde7 0.516 0.052 9.876 0.000 0.516 0.199 .sisoe7 0.319 0.030 10.618 0.000 0.319 0.271 .tadhde10 0.549 0.046 11.954 0.000 0.549 0.222 .sisoe10 0.420 0.027 15.496 0.000 0.420 0.325 .tadhde12 0.368 0.041 8.904 0.000 0.368 0.144 .sisoe12 0.304 0.026 11.661 0.000 0.304 0.221 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
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 .tadhde7 4.367 0.238 18.337 0.000 4.367 0.646 .sisoe7 1.027 0.062 16.489 0.000 1.027 0.740 .tadhde10 4.189 0.266 15.768 0.000 4.189 0.683 .sisoe10 1.245 0.076 16.318 0.000 1.245 0.745 .tadhde12 3.830 0.278 13.753 0.000 3.830 0.587 .sisoe12 1.231 0.080 15.360 0.000 1.231 0.652
#Table of model fit
<- table.model.fit(CLPMcomb2.fit.summary)
CLPMcomb2.fit.summary.fit CLPMcomb2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMcomb2.fit.summary, type = "CLPM", constraints = "Yes")
CLPMcomb2.fit.summary.reg CLPMcomb2.fit.summary.reg
%>%
CLPMcomb2.fit.summary.reg select(lhs, op, rhs, std.all, pvalue) %>%
mutate_if(is.numeric, round, 2)
%>%
CLPMcomb2.fit.summary.fit select(-aic, -bic, -chisq ) %>%
mutate_if(is.numeric, round, 2)
lavTestLRT(CLPMcomb.fit, CLPMcomb2.fit, method = "satorra.bentler.2010")
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMcomb # Create between components (rando intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb, # model
RICLPMcomb.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMcomb.fit,
RICLPMcomb.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 80 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 70.823 44.235 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.601 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6336.986 3173.081 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.997
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.990 0.989 Tucker-Lewis Index (TLI) 0.970 0.965
Robust Comparative Fit Index (CFI) 0.991 Robust Tucker-Lewis Index (TLI) 0.972
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -31715.231 -31715.231 Scaling correction factor 2.514 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.327 for the MLR correction
Akaike (AIC) 63500.462 63500.462 Bayesian (BIC) 63700.335 63700.335 Sample-size adjusted Bayesian (BIC) 63589.134 63589.134
Root Mean Square Error of Approximation:
RMSEA 0.055 0.042 90 Percent confidence interval - lower 0.044 0.032 90 Percent confidence interval - upper 0.068 0.052 P-value RMSEA <= 0.05 0.209 0.907
Robust RMSEA 0.053 90 Percent confidence interval - lower 0.038 90 Percent confidence interval - upper 0.069
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 =~
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.677 0.592 sisoe7 1.000 0.677 0.577 sisoe10 1.000 0.677 0.525 sisoe12 1.000 0.677 0.500 wad5 =~
tadhde5 1.000 2.143 0.768 wad7 =~
tadhde7 1.000 1.835 0.716 wad10 =~
tadhde10 1.000 1.732 0.696 wad12 =~
tadhde12 1.000 1.792 0.708 wsi5 =~
sisoe5 1.000 0.923 0.806 wsi7 =~
sisoe7 1.000 0.958 0.816 wsi10 =~
sisoe10 1.000 1.099 0.851 wsi12 =~
sisoe12 1.000 1.172 0.866
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.218 0.039 5.623 0.000 0.255 0.255 wsi5 0.064 0.087 0.739 0.460 0.032 0.032 wsi7 ~
wad5 0.042 0.017 2.440 0.015 0.093 0.093 wsi5 0.216 0.060 3.614 0.000 0.208 0.208 wad10 ~
wad7 0.080 0.065 1.242 0.214 0.085 0.085 wsi7 0.159 0.106 1.495 0.135 0.088 0.088 wsi10 ~
wad7 0.049 0.027 1.831 0.067 0.083 0.083 wsi7 0.279 0.058 4.837 0.000 0.243 0.243 wad12 ~
wad10 0.268 0.069 3.890 0.000 0.259 0.259 wsi10 0.049 0.072 0.682 0.495 0.030 0.030 wsi12 ~
wad10 0.026 0.027 0.958 0.338 0.038 0.038 wsi10 0.430 0.043 9.967 0.000 0.404 0.404
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.565 0.115 4.926 0.000 0.286 0.286 .wad7 ~~
.wsi7 0.411 0.091 4.495 0.000 0.250 0.250 .wad10 ~~
.wsi10 0.544 0.102 5.318 0.000 0.300 0.300 .wad12 ~~
.wsi12 0.469 0.087 5.406 0.000 0.255 0.255 RIad ~~
RIsi 0.638 0.077 8.310 0.000 0.526 0.526
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.806 .tadhde7 1.813 0.055 32.733 0.000 1.813 0.708 .tadhde10 1.564 0.053 29.449 0.000 1.564 0.628 .tadhde12 1.453 0.055 26.665 0.000 1.453 0.574 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.710 .sisoe7 0.831 0.025 33.074 0.000 0.831 0.709 .sisoe10 0.939 0.028 33.712 0.000 0.939 0.728 .sisoe12 0.941 0.029 31.933 0.000 0.941 0.695 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 3.197 0.240 13.334 0.000 1.000 1.000 RIsi 0.459 0.057 7.992 0.000 1.000 1.000 wad5 4.593 0.322 14.258 0.000 1.000 1.000 wsi5 0.853 0.102 8.399 0.000 1.000 1.000 .wad7 3.128 0.243 12.879 0.000 0.929 0.929 .wsi7 0.860 0.073 11.839 0.000 0.937 0.937 .wad10 2.943 0.319 9.216 0.000 0.981 0.981 .wsi10 1.114 0.081 13.836 0.000 0.923 0.923 .wad12 2.977 0.259 11.509 0.000 0.927 0.927 .wsi12 1.134 0.082 13.876 0.000 0.826 0.826 .tadhde5 0.000 0.000 0.000 .tadhde7 0.000 0.000 0.000 .tadhde10 0.000 0.000 0.000 .tadhde12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMcomb.fit.summary)
RICLPMcomb.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMcomb.fit.summary, type = "RICLPM", constraints = "No") RICLPMcomb.fit.summary.reg
<- '
RICLPMcomb2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb2,
RICLPMcomb2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb.fit, RICLPMcomb2.fit, method = "satorra.bentler.2010")
RICLPMcomb2 is significantly worse fit compared to RICLPMcomb according to the Chi square test.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMcomb2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb2a,
RICLPMcomb2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb.fit, RICLPMcomb2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMcomb3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
tadhde5 + tadhde7 + tadhde10 + tadhde12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMcomb3,
RICLPMcomb3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb.fit, RICLPMcomb3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
<- '
CLPMcomb_hyp # Estimate the lagged effects between the observed variables.
hye7 + sisoe7 ~ hye5 + sisoe5
hye10 + sisoe10 ~ hye7 + sisoe7
hye12 + sisoe12 ~ hye10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
hye5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
hye7 ~~ sisoe7
hye10 ~~ sisoe10
hye12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
hye5 ~~ hye5 # Variances
sisoe5 ~~ sisoe5
hye7 ~~ hye7 # Residual variances
sisoe7 ~~ sisoe7
hye10 ~~ hye10
sisoe10 ~~ sisoe10
hye12 ~~ hye12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMcomb_hyp,
CLPMcomb_hyp.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMcomb_hyp.fit,
CLPMcomb_hyp.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 25 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 366.119 219.642 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.667 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5729.300 3019.279 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.898
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.938 0.931 Tucker-Lewis Index (TLI) 0.855 0.838
Robust Comparative Fit Index (CFI) 0.939 Robust Tucker-Lewis Index (TLI) 0.858
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -27277.325 -27277.325 Scaling correction factor 2.422 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.216 for the MLR correction
Akaike (AIC) 54618.651 54618.651 Bayesian (BIC) 54801.392 54801.392 Sample-size adjusted Bayesian (BIC) 54699.723 54699.723
Root Mean Square Error of Approximation:
RMSEA 0.115 0.088 90 Percent confidence interval - lower 0.105 0.080 90 Percent confidence interval - upper 0.125 0.096 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.114 90 Percent confidence interval - lower 0.101 90 Percent confidence interval - upper 0.127
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 hye7 ~
hye5 0.515 0.023 22.245 0.000 0.515 0.548 sisoe5 0.079 0.031 2.517 0.012 0.079 0.059 sisoe7 ~
hye5 0.082 0.017 4.764 0.000 0.082 0.112 sisoe5 0.478 0.043 11.132 0.000 0.478 0.460 hye10 ~
hye7 0.480 0.027 18.087 0.000 0.480 0.523 sisoe7 0.081 0.036 2.265 0.024 0.081 0.069 sisoe10 ~
hye7 0.101 0.022 4.549 0.000 0.101 0.118 sisoe7 0.503 0.036 14.077 0.000 0.503 0.456 hye12 ~
hye10 0.641 0.034 18.895 0.000 0.641 0.620 sisoe10 0.009 0.025 0.358 0.720 0.009 0.008 sisoe12 ~
hye10 0.108 0.023 4.633 0.000 0.108 0.109 sisoe10 0.571 0.031 18.125 0.000 0.571 0.540
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all hye5 ~~
sisoe5 0.527 0.061 8.625 0.000 0.527 0.290 .hye7 ~~
.sisoe7 0.272 0.044 6.155 0.000 0.272 0.216 .hye10 ~~
.sisoe10 0.319 0.045 7.033 0.000 0.319 0.246 .hye12 ~~
.sisoe12 0.269 0.049 5.519 0.000 0.269 0.216
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye7 0.323 0.035 9.198 0.000 0.323 0.214 .sisoe7 0.330 0.034 9.774 0.000 0.330 0.280 .hye10 0.242 0.032 7.588 0.000 0.242 0.175 .sisoe10 0.410 0.031 13.269 0.000 0.410 0.316 .hye12 0.236 0.028 8.457 0.000 0.236 0.165 .sisoe12 0.313 0.029 10.891 0.000 0.313 0.228 hye5 1.371 0.034 40.447 0.000 1.371 0.856 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
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 .hye7 1.540 0.082 18.747 0.000 1.540 0.678 .sisoe7 1.032 0.062 16.548 0.000 1.032 0.745 .hye10 1.338 0.082 16.246 0.000 1.338 0.699 .sisoe10 1.253 0.077 16.254 0.000 1.253 0.744 .hye12 1.253 0.087 14.387 0.000 1.253 0.613 .sisoe12 1.235 0.080 15.383 0.000 1.235 0.656
#Table of model fit
<- table.model.fit(CLPMcomb_hyp.fit.summary)
CLPMcomb_hyp.fit.summary.fit CLPMcomb_hyp.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMcomb_hyp.fit.summary, type = "CLPM", constraints = "No")
CLPMcomb_hyp.fit.summary.reg CLPMcomb_hyp.fit.summary.reg
%>%
CLPMcomb_hyp.fit.summary.fit select(-aic, -bic, -chisq ) %>%
mutate_if(is.numeric, round, 2)
<- '
CLPMcomb_hyp2 # Estimate the lagged effects between the observed variables - constrained
hye7 ~ hye5 + d*sisoe5
sisoe7 ~ c*hye5 + sisoe5
hye10 ~ hye7 + d*sisoe7
sisoe10 ~ c*hye7 + sisoe7
hye12 ~ hye10 + d*sisoe10
sisoe12 ~ c*hye10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
hye5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
hye7 ~~ sisoe7
hye10 ~~ sisoe10
hye12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
hye5 ~~ hye5 # Variances
sisoe5 ~~ sisoe5
hye7 ~~ hye7 # Residual variances
sisoe7 ~~ sisoe7
hye10 ~~ hye10
sisoe10 ~~ sisoe10
hye12 ~~ hye12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMcomb_hyp2,
CLPMcomb_hyp2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMcomb_hyp2.fit,
CLPMcomb_hyp2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 25 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32 Number of equality constraints 4
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 374.821 218.262 Degrees of freedom 16 16 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.717 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5729.300 3019.279 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.898
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.937 0.932 Tucker-Lewis Index (TLI) 0.890 0.882
Robust Comparative Fit Index (CFI) 0.939 Robust Tucker-Lewis Index (TLI) 0.893
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -27281.676 -27281.676 Scaling correction factor 2.189 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.216 for the MLR correction
Akaike (AIC) 54619.353 54619.353 Bayesian (BIC) 54779.251 54779.251 Sample-size adjusted Bayesian (BIC) 54690.291 54690.291
Root Mean Square Error of Approximation:
RMSEA 0.100 0.075 90 Percent confidence interval - lower 0.092 0.069 90 Percent confidence interval - upper 0.109 0.082 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.099 90 Percent confidence interval - lower 0.087 90 Percent confidence interval - upper 0.110
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 hye7 ~
hye5 0.524 0.023 22.893 0.000 0.524 0.556 sisoe5 (d) 0.051 0.016 3.303 0.001 0.051 0.039 sisoe7 ~
hye5 (c) 0.095 0.012 8.120 0.000 0.095 0.129 sisoe5 0.468 0.041 11.376 0.000 0.468 0.451 hye10 ~
hye7 0.486 0.025 19.195 0.000 0.486 0.531 sisoe7 (d) 0.051 0.016 3.303 0.001 0.051 0.044 sisoe10 ~
hye7 (c) 0.095 0.012 8.120 0.000 0.095 0.111 sisoe7 0.499 0.033 15.277 0.000 0.499 0.454 hye12 ~
hye10 0.625 0.033 18.716 0.000 0.625 0.604 sisoe10 (d) 0.051 0.016 3.303 0.001 0.051 0.046 sisoe12 ~
hye10 (c) 0.095 0.012 8.120 0.000 0.095 0.096 sisoe10 0.584 0.031 18.850 0.000 0.584 0.549
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all hye5 ~~
sisoe5 0.527 0.061 8.625 0.000 0.527 0.290 .hye7 ~~
.sisoe7 0.273 0.044 6.163 0.000 0.273 0.216 .hye10 ~~
.sisoe10 0.319 0.045 7.015 0.000 0.319 0.246 .hye12 ~~
.sisoe12 0.270 0.049 5.523 0.000 0.270 0.217
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye7 0.333 0.030 11.037 0.000 0.333 0.221 .sisoe7 0.320 0.031 10.453 0.000 0.320 0.272 .hye10 0.261 0.026 10.052 0.000 0.261 0.189 .sisoe10 0.421 0.027 15.437 0.000 0.421 0.325 .hye12 0.210 0.023 8.996 0.000 0.210 0.147 .sisoe12 0.312 0.026 11.848 0.000 0.312 0.227 hye5 1.371 0.034 40.447 0.000 1.371 0.856 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
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 .hye7 1.541 0.082 18.729 0.000 1.541 0.677 .sisoe7 1.032 0.062 16.595 0.000 1.032 0.746 .hye10 1.339 0.083 16.179 0.000 1.339 0.702 .sisoe10 1.253 0.077 16.251 0.000 1.253 0.750 .hye12 1.256 0.087 14.360 0.000 1.256 0.615 .sisoe12 1.235 0.080 15.358 0.000 1.235 0.654
#Table of model fit
<- table.model.fit(CLPMcomb_hyp2.fit.summary)
CLPMcomb_hyp2.fit.summary.fit CLPMcomb_hyp2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMcomb_hyp2.fit.summary, type = "CLPM", constraints = "Yes")
CLPMcomb_hyp2.fit.summary.reg CLPMcomb_hyp2.fit.summary.reg
%>%
CLPMcomb_hyp2.fit.summary.reg select(lhs, op, rhs, std.all, pvalue) %>%
mutate_if(is.numeric, round, 2)
%>%
CLPMcomb_hyp2.fit.summary.fit select(-aic, -bic, -chisq ) %>%
mutate_if(is.numeric, round, 2)
lavTestLRT(CLPMcomb_hyp.fit, CLPMcomb_hyp2.fit, method = "satorra.bentler.2010")
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMcomb_hyp # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb_hyp, # model
RICLPMcomb_hyp.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMcomb_hyp.fit,
RICLPMcomb_hyp.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 47 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 54.871 35.656 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.539 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5729.300 3019.279 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.898
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.991 Tucker-Lewis Index (TLI) 0.975 0.972
Robust Comparative Fit Index (CFI) 0.993 Robust Tucker-Lewis Index (TLI) 0.978
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -27121.702 -27121.702 Scaling correction factor 2.391 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.216 for the MLR correction
Akaike (AIC) 54313.403 54313.403 Bayesian (BIC) 54513.276 54513.276 Sample-size adjusted Bayesian (BIC) 54402.076 54402.076
Root Mean Square Error of Approximation:
RMSEA 0.048 0.036 90 Percent confidence interval - lower 0.036 0.027 90 Percent confidence interval - upper 0.060 0.047 P-value RMSEA <= 0.05 0.592 0.985
Robust RMSEA 0.045 90 Percent confidence interval - lower 0.030 90 Percent confidence interval - upper 0.061
Standardized Root Mean Square Residual:
SRMR 0.027 0.027
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.977 0.605 hye7 1.000 0.977 0.657 hye10 1.000 0.977 0.703 hye12 1.000 0.977 0.689 RIsi =~
sisoe5 1.000 0.688 0.602 sisoe7 1.000 0.688 0.587 sisoe10 1.000 0.688 0.532 sisoe12 1.000 0.688 0.506 wad5 =~
hye5 1.000 1.286 0.796 wad7 =~
hye7 1.000 1.120 0.754 wad10 =~
hye10 1.000 0.989 0.711 wad12 =~
hye12 1.000 1.028 0.725 wsi5 =~
sisoe5 1.000 0.913 0.799 wsi7 =~
sisoe7 1.000 0.948 0.809 wsi10 =~
sisoe10 1.000 1.096 0.847 wsi12 =~
sisoe12 1.000 1.174 0.863
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.235 0.034 6.968 0.000 0.269 0.269 wsi5 0.046 0.051 0.897 0.370 0.037 0.037 wsi7 ~
wad5 0.055 0.026 2.066 0.039 0.074 0.074 wsi5 0.210 0.060 3.492 0.000 0.202 0.202 wad10 ~
wad7 0.108 0.053 2.033 0.042 0.122 0.122 wsi7 0.082 0.059 1.383 0.167 0.078 0.078 wsi10 ~
wad7 0.079 0.040 1.990 0.047 0.081 0.081 wsi7 0.276 0.058 4.727 0.000 0.239 0.239 wad12 ~
wad10 0.268 0.064 4.155 0.000 0.258 0.258 wsi10 0.019 0.036 0.517 0.605 0.020 0.020 wsi12 ~
wad10 0.070 0.043 1.643 0.100 0.059 0.059 wsi10 0.426 0.042 10.252 0.000 0.398 0.398
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.237 0.054 4.355 0.000 0.202 0.202 .wad7 ~~
.wsi7 0.209 0.052 3.978 0.000 0.210 0.210 .wad10 ~~
.wsi10 0.273 0.053 5.114 0.000 0.265 0.265 .wad12 ~~
.wsi12 0.217 0.047 4.569 0.000 0.205 0.205 RIad ~~
RIsi 0.301 0.040 7.441 0.000 0.448 0.448
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.966 0.000 1.093 0.735 .hye10 0.835 0.030 28.180 0.000 0.835 0.601 .hye12 0.779 0.031 25.506 0.000 0.779 0.549 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.711 .sisoe7 0.831 0.025 33.066 0.000 0.831 0.710 .sisoe10 0.939 0.028 33.704 0.000 0.939 0.726 .sisoe12 0.941 0.029 31.948 0.000 0.941 0.692 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.955 0.068 14.043 0.000 1.000 1.000 RIsi 0.473 0.057 8.365 0.000 1.000 1.000 wad5 1.654 0.099 16.742 0.000 1.000 1.000 wsi5 0.833 0.099 8.420 0.000 1.000 1.000 .wad7 1.157 0.085 13.662 0.000 0.922 0.922 .wsi7 0.851 0.073 11.600 0.000 0.948 0.948 .wad10 0.953 0.096 9.971 0.000 0.974 0.974 .wsi10 1.113 0.081 13.747 0.000 0.928 0.928 .wad12 0.983 0.082 11.927 0.000 0.930 0.930 .wsi12 1.136 0.081 13.962 0.000 0.825 0.825 .hye5 0.000 0.000 0.000 .hye7 0.000 0.000 0.000 .hye10 0.000 0.000 0.000 .hye12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMcomb_hyp.fit.summary)
RICLPMcomb_hyp.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMcomb_hyp.fit.summary, type = "RICLPM", constraints = "No") RICLPMcomb_hyp.fit.summary.reg
Imposing constraints to the model can be achieved through pre-multiplication. It means that we have to prepend the number that we want to fix the parameter to, and an asterisk, to the parameter in the model specification. For example, F =~ 0*x1
fixes the factor loading of ite x1
to factor F
to 0. Using pre-multiplication we can also constrain parameters to be the same by giving the the same label. Below we specify an RI-CLPM with the following constraints:
wx2 ~ a*wx1 + b*wy1; ...
wx2 ~~ cov*wy2; ...
, wx2 ~~ vx*wx2; ...
, and wy2 ~~ vy*wy2; ...
x1 + ... ~ mx*1
and y1 + ... ~ my*1
Here we will use the Chi square significance value to indicate a significantly worse fitting model.
You can also use fit indices for large sample sizes as below, we will use this method when looking at invariance testing in the measireent models: - RMSEA difference = increase smaller than 0.01 is acceptable - CFI difference = decrease smaller than 0.01 is acceptable - TLI difference = decrease smaller than 0.01 is acceptable
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMcomb_hyp2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb_hyp2,
RICLPMcomb_hyp2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb_hyp.fit, RICLPMcomb_hyp2.fit, method = "satorra.bentler.2010")
RICLPMcomb_hyp2 is significantly worse fit compared to RICLPMcomb_hyp.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMcomb_hyp2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb_hyp2a,
RICLPMcomb_hyp2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb_hyp.fit, RICLPMcomb_hyp2a.fit, method = "satorra.bentler.2010")
RICLPMcomb_hyp2a is significantly worse fit compared to RICLPMcomb_hyp. Now we will constrain the other set of stability coefficients: lag in si (b)
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMcomb_hyp3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
hye5 + hye7 + hye10 + hye12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMcomb_hyp3,
RICLPMcomb_hyp3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb_hyp.fit, RICLPMcomb_hyp3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
<- '
CLPMcomb_inat # Estimate the lagged effects between the observed variables.
ine7 + sisoe7 ~ ine5 + sisoe5
ine10 + sisoe10 ~ ine7 + sisoe7
ine12 + sisoe12 ~ ine10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
ine5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
ine7 ~~ sisoe7
ine10 ~~ sisoe10
ine12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
ine5 ~~ ine5 # Variances
sisoe5 ~~ sisoe5
ine7 ~~ ine7 # Residual variances
sisoe7 ~~ sisoe7
ine10 ~~ ine10
sisoe10 ~~ sisoe10
ine12 ~~ ine12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMcomb_inat,
CLPMcomb_inat.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMcomb_inat.fit,
CLPMcomb_inat.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 25 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 427.821 236.761 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.807 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5717.557 2837.460 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.015
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.927 0.920 Tucker-Lewis Index (TLI) 0.829 0.813
Robust Comparative Fit Index (CFI) 0.928 Robust Tucker-Lewis Index (TLI) 0.833
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26620.848 -26620.848 Scaling correction factor 2.604 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.387 for the MLR correction
Akaike (AIC) 53305.696 53305.696 Bayesian (BIC) 53488.437 53488.437 Sample-size adjusted Bayesian (BIC) 53386.768 53386.768
Root Mean Square Error of Approximation:
RMSEA 0.125 0.092 90 Percent confidence interval - lower 0.115 0.084 90 Percent confidence interval - upper 0.135 0.099 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.123 90 Percent confidence interval - lower 0.110 90 Percent confidence interval - upper 0.137
Standardized Root Mean Square Residual:
SRMR 0.070 0.070
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 ine7 ~
ine5 0.485 0.031 15.678 0.000 0.485 0.517 sisoe5 0.063 0.034 1.838 0.066 0.063 0.053 sisoe7 ~
ine5 0.106 0.021 4.925 0.000 0.106 0.128 sisoe5 0.460 0.043 10.722 0.000 0.460 0.443 ine10 ~
ine7 0.468 0.034 13.944 0.000 0.468 0.463 sisoe7 0.090 0.033 2.763 0.006 0.090 0.079 sisoe10 ~
ine7 0.135 0.026 5.118 0.000 0.135 0.139 sisoe7 0.488 0.036 13.523 0.000 0.488 0.443 ine12 ~
ine10 0.576 0.035 16.596 0.000 0.576 0.571 sisoe10 0.057 0.027 2.093 0.036 0.057 0.054 sisoe12 ~
ine10 0.104 0.026 3.978 0.000 0.104 0.102 sisoe10 0.571 0.033 17.487 0.000 0.571 0.540
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all ine5 ~~
sisoe5 0.627 0.074 8.476 0.000 0.627 0.388 .ine7 ~~
.sisoe7 0.286 0.038 7.432 0.000 0.286 0.251 .ine10 ~~
.sisoe10 0.345 0.049 7.080 0.000 0.345 0.264 .ine12 ~~
.sisoe12 0.358 0.047 7.563 0.000 0.358 0.293
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine7 0.242 0.032 7.544 0.000 0.242 0.181 .sisoe7 0.365 0.032 11.238 0.000 0.365 0.310 .ine10 0.315 0.029 10.726 0.000 0.315 0.233 .sisoe10 0.437 0.029 14.996 0.000 0.437 0.337 .ine12 0.203 0.025 7.971 0.000 0.203 0.149 .sisoe12 0.328 0.027 12.044 0.000 0.328 0.239 ine5 0.877 0.030 29.074 0.000 0.877 0.615 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
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 .ine7 1.268 0.072 17.515 0.000 1.268 0.709 .sisoe7 1.028 0.063 16.317 0.000 1.028 0.743 .ine10 1.373 0.088 15.578 0.000 1.373 0.753 .sisoe10 1.246 0.076 16.435 0.000 1.246 0.740 .ine12 1.203 0.086 13.926 0.000 1.203 0.648 .sisoe12 1.238 0.081 15.303 0.000 1.238 0.657
#Table of model fit
<- table.model.fit(CLPMcomb_inat.fit.summary)
CLPMcomb_inat.fit.summary.fit CLPMcomb_inat.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMcomb_inat.fit.summary, type = "CLPM", constraints = "No")
CLPMcomb_inat.fit.summary.reg CLPMcomb_inat.fit.summary.reg
%>%
CLPMcomb_inat.fit.summary.fit select(-aic, -bic, -chisq ) %>%
mutate_if(is.numeric, round, 2)
<- '
CLPMcomb_inat2 # Estimate the lagged effects between the observed variables - constrained
ine7 ~ ine5 + d*sisoe5
sisoe7 ~ c*ine5 + sisoe5
ine10 ~ ine7 + d*sisoe7
sisoe10 ~ c*ine7 + sisoe7
ine12 ~ ine10 + d*sisoe10
sisoe12 ~ c*ine10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
ine5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
ine7 ~~ sisoe7
ine10 ~~ sisoe10
ine12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
ine5 ~~ ine5 # Variances
sisoe5 ~~ sisoe5
ine7 ~~ ine7 # Residual variances
sisoe7 ~~ sisoe7
ine10 ~~ ine10
sisoe10 ~~ sisoe10
ine12 ~~ ine12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMcomb_inat2,
CLPMcomb_inat2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMcomb_inat2.fit,
CLPMcomb_inat2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 23 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32 Number of equality constraints 4
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 431.172 232.207 Degrees of freedom 16 16 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.857 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5717.557 2837.460 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.015
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.927 0.923 Tucker-Lewis Index (TLI) 0.872 0.865
Robust Comparative Fit Index (CFI) 0.929 Robust Tucker-Lewis Index (TLI) 0.876
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26622.523 -26622.523 Scaling correction factor 2.354 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.387 for the MLR correction
Akaike (AIC) 53301.047 53301.047 Bayesian (BIC) 53460.945 53460.945 Sample-size adjusted Bayesian (BIC) 53371.985 53371.985
Root Mean Square Error of Approximation:
RMSEA 0.108 0.078 90 Percent confidence interval - lower 0.099 0.071 90 Percent confidence interval - upper 0.117 0.084 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.106 90 Percent confidence interval - lower 0.094 90 Percent confidence interval - upper 0.118
Standardized Root Mean Square Residual:
SRMR 0.071 0.071
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 ine7 ~
ine5 0.486 0.029 16.480 0.000 0.486 0.517 sisoe5 (d) 0.068 0.016 4.154 0.000 0.068 0.058 sisoe7 ~
ine5 (c) 0.114 0.014 8.228 0.000 0.114 0.137 sisoe5 0.457 0.041 11.190 0.000 0.457 0.440 ine10 ~
ine7 0.469 0.031 15.021 0.000 0.469 0.467 sisoe7 (d) 0.068 0.016 4.154 0.000 0.068 0.060 sisoe10 ~
ine7 (c) 0.114 0.014 8.228 0.000 0.114 0.118 sisoe7 0.492 0.034 14.454 0.000 0.492 0.448 ine12 ~
ine10 0.575 0.033 17.274 0.000 0.575 0.567 sisoe10 (d) 0.068 0.016 4.154 0.000 0.068 0.065 sisoe12 ~
ine10 (c) 0.114 0.014 8.228 0.000 0.114 0.111 sisoe10 0.571 0.030 18.951 0.000 0.571 0.537
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all ine5 ~~
sisoe5 0.627 0.074 8.476 0.000 0.627 0.388 .ine7 ~~
.sisoe7 0.286 0.039 7.429 0.000 0.286 0.250 .ine10 ~~
.sisoe10 0.345 0.049 7.071 0.000 0.345 0.264 .ine12 ~~
.sisoe12 0.358 0.047 7.556 0.000 0.358 0.293
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine7 0.237 0.026 9.142 0.000 0.237 0.177 .sisoe7 0.360 0.030 12.104 0.000 0.360 0.305 .ine10 0.332 0.025 13.209 0.000 0.332 0.247 .sisoe10 0.449 0.027 16.407 0.000 0.449 0.348 .ine12 0.193 0.022 8.816 0.000 0.193 0.142 .sisoe12 0.321 0.026 12.416 0.000 0.321 0.234 ine5 0.877 0.030 29.074 0.000 0.877 0.615 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
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 .ine7 1.268 0.072 17.514 0.000 1.268 0.707 .sisoe7 1.029 0.063 16.326 0.000 1.029 0.741 .ine10 1.374 0.088 15.581 0.000 1.374 0.758 .sisoe10 1.247 0.076 16.405 0.000 1.247 0.746 .ine12 1.204 0.086 13.936 0.000 1.204 0.647 .sisoe12 1.238 0.081 15.312 0.000 1.238 0.656
#Table of model fit
<- table.model.fit(CLPMcomb_inat2.fit.summary)
CLPMcomb_inat2.fit.summary.fit CLPMcomb_inat2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMcomb_inat2.fit.summary, type = "CLPM", constraints = "Yes")
CLPMcomb_inat2.fit.summary.reg CLPMcomb_inat2.fit.summary.reg
%>%
CLPMcomb_inat2.fit.summary.reg select(lhs, op, rhs, std.all, pvalue) %>%
mutate_if(is.numeric, round, 2)
%>%
CLPMcomb_inat2.fit.summary.fit select(-aic, -bic, -chisq ) %>%
mutate_if(is.numeric, round, 2)
lavTestLRT(CLPMcomb_inat.fit, CLPMcomb_inat2.fit, method = "satorra.bentler.2010")
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMcomb_inat # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb_inat, # model
RICLPMcomb_inat.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMcomb_inat.fit,
RICLPMcomb_inat.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 56 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 9
Model Test User Model: Standard Robust Test Statistic 66.126 39.909 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.657 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5717.557 2837.460 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.015
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.990 0.989 Tucker-Lewis Index (TLI) 0.969 0.966
Robust Comparative Fit Index (CFI) 0.991 Robust Tucker-Lewis Index (TLI) 0.972
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26440.001 -26440.001 Scaling correction factor 2.575 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.387 for the MLR correction
Akaike (AIC) 52950.001 52950.001 Bayesian (BIC) 53149.874 53149.874 Sample-size adjusted Bayesian (BIC) 53038.674 53038.674
Root Mean Square Error of Approximation:
RMSEA 0.053 0.039 90 Percent confidence interval - lower 0.042 0.030 90 Percent confidence interval - upper 0.066 0.049 P-value RMSEA <= 0.05 0.302 0.964
Robust RMSEA 0.050 90 Percent confidence interval - lower 0.035 90 Percent confidence interval - upper 0.067
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.906 0.633 ine7 1.000 0.906 0.683 ine10 1.000 0.906 0.671 ine12 1.000 0.906 0.667 RIsi =~
sisoe5 1.000 0.680 0.593 sisoe7 1.000 0.680 0.579 sisoe10 1.000 0.680 0.526 sisoe12 1.000 0.680 0.503 wad5 =~
ine5 1.000 1.107 0.774 wad7 =~
ine7 1.000 0.969 0.730 wad10 =~
ine10 1.000 1.001 0.742 wad12 =~
ine12 1.000 1.013 0.745 wsi5 =~
sisoe5 1.000 0.923 0.805 wsi7 =~
sisoe7 1.000 0.957 0.815 wsi10 =~
sisoe10 1.000 1.097 0.850 wsi12 =~
sisoe12 1.000 1.169 0.865
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.154 0.049 3.165 0.002 0.176 0.176 wsi5 0.029 0.045 0.644 0.520 0.027 0.027 wsi7 ~
wad5 0.071 0.036 1.983 0.047 0.082 0.082 wsi5 0.216 0.060 3.595 0.000 0.209 0.209 wad10 ~
wad7 0.032 0.064 0.506 0.613 0.031 0.031 wsi7 0.079 0.054 1.459 0.145 0.076 0.076 wsi10 ~
wad7 0.075 0.048 1.550 0.121 0.066 0.066 wsi7 0.285 0.058 4.954 0.000 0.249 0.249 wad12 ~
wad10 0.246 0.056 4.395 0.000 0.243 0.243 wsi10 0.037 0.039 0.944 0.345 0.040 0.040 wsi12 ~
wad10 0.014 0.046 0.317 0.752 0.012 0.012 wsi10 0.437 0.044 9.962 0.000 0.410 0.410
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.310 0.068 4.563 0.000 0.303 0.303 .wad7 ~~
.wsi7 0.198 0.047 4.255 0.000 0.224 0.224 .wad10 ~~
.wsi10 0.276 0.058 4.794 0.000 0.262 0.262 .wad12 ~~
.wsi12 0.268 0.047 5.749 0.000 0.257 0.257 RIad ~~
RIsi 0.342 0.041 8.395 0.000 0.555 0.555
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.145 0.000 0.718 0.541 .ine10 0.725 0.029 25.060 0.000 0.725 0.537 .ine12 0.673 0.029 23.126 0.000 0.673 0.495 .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.708 .sisoe10 0.939 0.028 33.708 0.000 0.939 0.728 .sisoe12 0.941 0.029 31.924 0.000 0.941 0.696 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.820 0.068 12.096 0.000 1.000 1.000 RIsi 0.462 0.058 8.030 0.000 1.000 1.000 wad5 1.225 0.098 12.506 0.000 1.000 1.000 wsi5 0.852 0.102 8.352 0.000 1.000 1.000 .wad7 0.906 0.077 11.694 0.000 0.965 0.965 .wsi7 0.861 0.073 11.792 0.000 0.939 0.939 .wad10 0.994 0.101 9.851 0.000 0.992 0.992 .wsi10 1.115 0.081 13.822 0.000 0.926 0.926 .wad12 0.957 0.080 12.029 0.000 0.934 0.934 .wsi12 1.133 0.082 13.841 0.000 0.829 0.829 .ine5 0.000 0.000 0.000 .ine7 0.000 0.000 0.000 .ine10 0.000 0.000 0.000 .ine12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMcomb_inat.fit.summary)
RICLPMcomb_inat.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMcomb_inat.fit.summary, type = "RICLPM", constraints = "No") RICLPMcomb_inat.fit.summary.reg
Imposing constraints to the model can be achieved through pre-multiplication. It means that we have to prepend the number that we want to fix the parameter to, and an asterisk, to the parameter in the model specification. For example, F =~ 0*x1
fixes the factor loading of ite x1
to factor F
to 0. Using pre-multiplication we can also constrain parameters to be the same by giving the the same label. Below we specify an RI-CLPM with the following constraints:
wx2 ~ a*wx1 + b*wy1; ...
wx2 ~~ cov*wy2; ...
, wx2 ~~ vx*wx2; ...
, and wy2 ~~ vy*wy2; ...
x1 + ... ~ mx*1
and y1 + ... ~ my*1
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMcomb_inat2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb_inat2,
RICLPMcomb_inat2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb_inat.fit, RICLPMcomb_inat2.fit, method = "satorra.bentler.2010")
RICLPMcomb_inat2 is significantly worse fit compared to RICLPMcomb_inat.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMcomb_inat2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMcomb_inat2a,
RICLPMcomb_inat2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb_inat.fit, RICLPMcomb_inat2a.fit, method = "satorra.bentler.2010")
RICLPMcomb_inat2a is significantly worse fit compared to RICLPMcomb_inat. Now we will constrain the other set of stability coefficients: lag in si (b)
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMcomb_inat3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
ine5 + ine7 + ine10 + ine12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMcomb_inat3,
RICLPMcomb_inat3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMcomb_inat.fit, RICLPMcomb_inat3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
<- '
CLPMadt # Estimate the lagged effects between the observed variables.
tadhdet7 + sisoe7 ~ tadhdet5 + sisoe5
tadhdet10 + sisoe10 ~ tadhdet7 + sisoe7
tadhdet12 + sisoe12 ~ tadhdet10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
tadhdet5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
tadhdet7 ~~ sisoe7
tadhdet10 ~~ sisoe10
tadhdet12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
tadhdet5 ~~ tadhdet5 # Variances
sisoe5 ~~ sisoe5
tadhdet7 ~~ tadhdet7 # Residual variances
sisoe7 ~~ sisoe7
tadhdet10 ~~ tadhdet10
sisoe10 ~~ sisoe10
tadhdet12 ~~ tadhdet12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMadt,
CLPMadt.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMadt.fit,
CLPMadt.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 33 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 258.391 120.910 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 2.137 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3602.277 1545.659 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.331
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.931 0.928 Tucker-Lewis Index (TLI) 0.839 0.833
Robust Comparative Fit Index (CFI) 0.934 Robust Tucker-Lewis Index (TLI) 0.846
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -30073.753 -30073.753 Scaling correction factor 3.343 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.014 for the MLR correction
Akaike (AIC) 60211.506 60211.506 Bayesian (BIC) 60394.247 60394.247 Sample-size adjusted Bayesian (BIC) 60292.578 60292.578
Root Mean Square Error of Approximation:
RMSEA 0.096 0.064 90 Percent confidence interval - lower 0.086 0.057 90 Percent confidence interval - upper 0.106 0.071 P-value RMSEA <= 0.05 0.000 0.001
Robust RMSEA 0.093 90 Percent confidence interval - lower 0.079 90 Percent confidence interval - upper 0.109
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 tadhdet7 ~
tadhdet5 0.319 0.038 8.291 0.000 0.319 0.327 sisoe5 0.070 0.063 1.118 0.263 0.070 0.032 sisoe7 ~
tadhdet5 0.047 0.013 3.670 0.000 0.047 0.103 sisoe5 0.477 0.042 11.380 0.000 0.477 0.460 tadhdet10 ~
tadhdet7 0.296 0.043 6.881 0.000 0.296 0.336 sisoe7 0.090 0.057 1.588 0.112 0.090 0.048 sisoe10 ~
tadhdet7 0.045 0.016 2.851 0.004 0.045 0.088 sisoe7 0.517 0.036 14.477 0.000 0.517 0.469 tadhdet12 ~
tadhdet10 0.328 0.054 6.063 0.000 0.328 0.353 sisoe10 0.101 0.049 2.053 0.040 0.101 0.064 sisoe12 ~
tadhdet10 0.034 0.019 1.762 0.078 0.034 0.055 sisoe10 0.595 0.032 18.462 0.000 0.595 0.562
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdet5 ~~
sisoe5 0.935 0.141 6.618 0.000 0.935 0.319 .tadhdet7 ~~
.sisoe7 0.539 0.089 6.047 0.000 0.539 0.224 .tadhdet10 ~~
.sisoe10 0.561 0.100 5.627 0.000 0.561 0.241 .tadhdet12 ~~
.sisoe12 0.548 0.092 5.942 0.000 0.548 0.257
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdet7 0.537 0.067 8.065 0.000 0.537 0.213 .sisoe7 0.397 0.032 12.543 0.000 0.397 0.337 .tadhdet10 0.397 0.054 7.352 0.000 0.397 0.179 .sisoe10 0.468 0.028 16.500 0.000 0.468 0.361 .tadhdet12 0.286 0.048 5.981 0.000 0.286 0.139 .sisoe12 0.357 0.027 13.206 0.000 0.357 0.260 tadhdet5 0.987 0.057 17.381 0.000 0.987 0.383 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdet5 6.658 0.561 11.870 0.000 6.658 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 .tadhdet7 5.596 0.470 11.911 0.000 5.596 0.885 .sisoe7 1.035 0.064 16.191 0.000 1.035 0.748 .tadhdet10 4.292 0.429 10.014 0.000 4.292 0.876 .sisoe10 1.262 0.077 16.427 0.000 1.262 0.749 .tadhdet12 3.629 0.399 9.099 0.000 3.629 0.858 .sisoe12 1.249 0.081 15.345 0.000 1.249 0.663
#Table of model fit
<- table.model.fit(CLPMadt.fit.summary)
CLPMadt.fit.summary.fit CLPMadt.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMadt.fit.summary, type = "CLPM", constraints = "No")
CLPMadt.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) CLPMadt.fit.summary.reg
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMadt # Create between components (rando intercepts treated as factors here)
RIad =~ 1*tadhdet5 + 1*tadhdet7 + 1*tadhdet10 + 1*tadhdet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdet5
wad7 =~ 1*tadhdet7
wad10 =~ 1*tadhdet10
wad12 =~ 1*tadhdet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadt, # model
RICLPMadt.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadt.fit,
RICLPMadt.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 88 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 61.305 31.493 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.947 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3602.277 1545.659 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.331
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.985 0.985 Tucker-Lewis Index (TLI) 0.954 0.954
Robust Comparative Fit Index (CFI) 0.988 Robust Tucker-Lewis Index (TLI) 0.961
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -29975.210 -29975.210 Scaling correction factor 3.289 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.014 for the MLR correction
Akaike (AIC) 60020.420 60020.420 Bayesian (BIC) 60220.292 60220.292 Sample-size adjusted Bayesian (BIC) 60109.092 60109.092
Root Mean Square Error of Approximation:
RMSEA 0.051 0.033 90 Percent confidence interval - lower 0.039 0.025 90 Percent confidence interval - upper 0.063 0.043 P-value RMSEA <= 0.05 0.419 0.999
Robust RMSEA 0.047 90 Percent confidence interval - lower 0.030 90 Percent confidence interval - upper 0.065
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 =~
tadhdet5 1.000 1.131 0.442 tadhdet7 1.000 1.131 0.451 tadhdet10 1.000 1.131 0.512 tadhdet12 1.000 1.131 0.548 RIsi =~
sisoe5 1.000 0.677 0.594 sisoe7 1.000 0.677 0.577 sisoe10 1.000 0.677 0.524 sisoe12 1.000 0.677 0.497 wad5 =~
tadhdet5 1.000 2.295 0.897 wad7 =~
tadhdet7 1.000 2.238 0.892 wad10 =~
tadhdet10 1.000 1.896 0.859 wad12 =~
tadhdet12 1.000 1.729 0.837 wsi5 =~
sisoe5 1.000 0.916 0.804 wsi7 =~
sisoe7 1.000 0.957 0.816 wsi10 =~
sisoe10 1.000 1.101 0.852 wsi12 =~
sisoe12 1.000 1.180 0.867
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.165 0.048 3.433 0.001 0.169 0.169 wsi5 -0.089 0.106 -0.836 0.403 -0.036 -0.036 wsi7 ~
wad5 0.035 0.019 1.789 0.074 0.083 0.083 wsi5 0.218 0.063 3.456 0.001 0.209 0.209 wad10 ~
wad7 0.123 0.061 2.029 0.042 0.145 0.145 wsi7 -0.064 0.087 -0.740 0.460 -0.032 -0.032 wsi10 ~
wad7 0.028 0.021 1.343 0.179 0.057 0.057 wsi7 0.295 0.059 4.970 0.000 0.256 0.256 wad12 ~
wad10 0.124 0.073 1.704 0.088 0.136 0.136 wsi10 -0.014 0.080 -0.178 0.859 -0.009 -0.009 wsi12 ~
wad10 0.008 0.029 0.273 0.785 0.013 0.013 wsi10 0.449 0.044 10.164 0.000 0.419 0.419
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.470 0.126 3.727 0.000 0.224 0.224 .wad7 ~~
.wsi7 0.406 0.100 4.046 0.000 0.198 0.198 .wad10 ~~
.wsi10 0.415 0.113 3.685 0.000 0.209 0.209 .wad12 ~~
.wsi12 0.402 0.100 4.025 0.000 0.219 0.219 RIad ~~
RIsi 0.399 0.074 5.368 0.000 0.521 0.521
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdet5 0.987 0.057 17.432 0.000 0.987 0.386 .tadhdet7 0.910 0.056 16.302 0.000 0.910 0.363 .tadhdet10 0.737 0.051 14.327 0.000 0.737 0.334 .tadhdet12 0.617 0.048 12.804 0.000 0.617 0.298 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.714 .sisoe7 0.831 0.025 33.054 0.000 0.831 0.709 .sisoe10 0.939 0.028 33.692 0.000 0.939 0.727 .sisoe12 0.941 0.029 31.931 0.000 0.941 0.692 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.280 0.203 6.306 0.000 1.000 1.000 RIsi 0.458 0.059 7.714 0.000 1.000 1.000 wad5 5.267 0.510 10.322 0.000 1.000 1.000 wsi5 0.839 0.104 8.102 0.000 1.000 1.000 .wad7 4.872 0.469 10.379 0.000 0.973 0.973 .wsi7 0.862 0.075 11.455 0.000 0.942 0.942 .wad10 3.523 0.433 8.132 0.000 0.980 0.980 .wsi10 1.122 0.081 13.784 0.000 0.925 0.925 .wad12 2.934 0.401 7.318 0.000 0.982 0.982 .wsi12 1.144 0.082 13.996 0.000 0.822 0.822 .tadhdet5 0.000 0.000 0.000 .tadhdet7 0.000 0.000 0.000 .tadhdet10 0.000 0.000 0.000 .tadhdet12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadt.fit.summary)
RICLPMadt.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadt.fit.summary, type = "RICLPM", constraints = "No") RICLPMadt.fit.summary.reg
<- '
RICLPMadt2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhdet5 + 1*tadhdet7 + 1*tadhdet10 + 1*tadhdet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdet5
wad7 =~ 1*tadhdet7
wad10 =~ 1*tadhdet10
wad12 =~ 1*tadhdet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadt2,
RICLPMadt2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadt2.fit,
RICLPMadt2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 79 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 99.059 42.710 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.001 Scaling correction factor 2.319 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3602.277 1545.659 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.331
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.977 0.983 Tucker-Lewis Index (TLI) 0.962 0.972
Robust Comparative Fit Index (CFI) 0.983 Robust Tucker-Lewis Index (TLI) 0.972
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -29994.087 -29994.087 Scaling correction factor 2.663 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.014 for the MLR correction
Akaike (AIC) 60042.174 60042.174 Bayesian (BIC) 60196.362 60196.362 Sample-size adjusted Bayesian (BIC) 60110.579 60110.579
Root Mean Square Error of Approximation:
RMSEA 0.047 0.026 90 Percent confidence interval - lower 0.038 0.020 90 Percent confidence interval - upper 0.056 0.032 P-value RMSEA <= 0.05 0.726 1.000
Robust RMSEA 0.040 90 Percent confidence interval - lower 0.025 90 Percent confidence interval - upper 0.055
Standardized Root Mean Square Residual:
SRMR 0.039 0.039
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 =~
tadhdet5 1.000 1.128 0.442 tadhdet7 1.000 1.128 0.451 tadhdet10 1.000 1.128 0.508 tadhdet12 1.000 1.128 0.545 RIsi =~
sisoe5 1.000 0.638 0.555 sisoe7 1.000 0.638 0.527 sisoe10 1.000 0.638 0.492 sisoe12 1.000 0.638 0.486 wad5 =~
tadhdet5 1.000 2.286 0.897 wad7 =~
tadhdet7 1.000 2.231 0.892 wad10 =~
tadhdet10 1.000 1.914 0.862 wad12 =~
tadhdet12 1.000 1.736 0.839 wsi5 =~
sisoe5 1.000 0.955 0.832 wsi7 =~
sisoe7 1.000 1.028 0.850 wsi10 =~
sisoe10 1.000 1.130 0.871 wsi12 =~
sisoe12 1.000 1.147 0.874
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.141 0.039 3.603 0.000 0.144 0.144 wsi5 (d) -0.061 0.062 -0.985 0.325 -0.026 -0.026 wsi7 ~
wad5 (c) 0.018 0.015 1.208 0.227 0.040 0.040 wsi5 (b) 0.365 0.042 8.646 0.000 0.339 0.339 wad10 ~
wad7 (a) 0.141 0.039 3.603 0.000 0.164 0.164 wsi7 (d) -0.061 0.062 -0.985 0.325 -0.033 -0.033 wsi10 ~
wad7 (c) 0.018 0.015 1.208 0.227 0.036 0.036 wsi7 (b) 0.365 0.042 8.646 0.000 0.332 0.332 wad12 ~
wad10 (a) 0.141 0.039 3.603 0.000 0.155 0.155 wsi10 (d) -0.061 0.062 -0.985 0.325 -0.039 -0.039 wsi12 ~
wad10 (c) 0.018 0.015 1.208 0.227 0.030 0.030 wsi10 (b) 0.365 0.042 8.646 0.000 0.360 0.360
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.467 0.116 4.026 0.000 0.214 0.214 .wad7 ~~
.wsi7 0.415 0.093 4.461 0.000 0.195 0.195 .wad10 ~~
.wsi10 0.400 0.113 3.521 0.000 0.199 0.199 .wad12 ~~
.wsi12 0.375 0.098 3.845 0.000 0.205 0.205 RIad ~~
RIsi 0.419 0.077 5.463 0.000 0.582 0.582
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdet5 0.988 0.057 17.424 0.000 0.988 0.388 .tadhdet7 0.910 0.056 16.286 0.000 0.910 0.364 .tadhdet10 0.738 0.051 14.430 0.000 0.738 0.332 .tadhdet12 0.616 0.048 12.709 0.000 0.616 0.298 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.708 .sisoe7 0.831 0.025 33.053 0.000 0.831 0.687 .sisoe10 0.939 0.028 33.720 0.000 0.939 0.724 .sisoe12 0.941 0.029 31.929 0.000 0.941 0.717 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.271 0.205 6.207 0.000 1.000 1.000 RIsi 0.407 0.059 6.941 0.000 1.000 1.000 wad5 5.227 0.506 10.323 0.000 1.000 1.000 wsi5 0.912 0.102 8.905 0.000 1.000 1.000 .wad7 4.878 0.460 10.604 0.000 0.980 0.980 .wsi7 0.927 0.067 13.801 0.000 0.877 0.877 .wad10 3.566 0.409 8.718 0.000 0.974 0.974 .wsi10 1.128 0.084 13.422 0.000 0.884 0.884 .wad12 2.942 0.372 7.916 0.000 0.977 0.977 .wsi12 1.138 0.083 13.640 0.000 0.865 0.865 .tadhdet5 0.000 0.000 0.000 .tadhdet7 0.000 0.000 0.000 .tadhdet10 0.000 0.000 0.000 .tadhdet12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadt2.fit.summary)
RICLPMadt2.fit.summary.fit RICLPMadt2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadt2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMadt2.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMadt2.fit.summary.reg
lavTestLRT(RICLPMadt.fit, RICLPMadt2.fit, method = "satorra.bentler.2010")
RICLPMadt2 is not significantly fit compared to RICLPMadt according to the Chi square test (p = 0.09885)
The best fitting model (mother report and total ADHD symptoms) is currently RICLPMadt2 where both autoregressives and cross-lags are constrained to be equal across time.
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMadt3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhdet5 + 1*tadhdet7 + 1*tadhdet10 + 1*tadhdet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdet5
wad7 =~ 1*tadhdet7
wad10 =~ 1*tadhdet10
wad12 =~ 1*tadhdet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
tadhdet5 + tadhdet7 + tadhdet10 + tadhdet12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMadt3,
RICLPMadt3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadt.fit, RICLPMadt3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrainetd to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMadt_hyp # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyet5 + 1*hyet7 + 1*hyet10 + 1*hyet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyet5
wad7 =~ 1*hyet7
wad10 =~ 1*hyet10
wad12 =~ 1*hyet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadt_hyp, # model
RICLPMadt_hyp.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadt_hyp.fit,
RICLPMadt_hyp.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 45 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 49.188 25.066 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.003 Scaling correction factor 1.962 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3237.022 1403.931 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.306
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.987 0.988 Tucker-Lewis Index (TLI) 0.961 0.964
Robust Comparative Fit Index (CFI) 0.990 Robust Tucker-Lewis Index (TLI) 0.969
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -25320.990 -25320.990 Scaling correction factor 3.421 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.123 for the MLR correction
Akaike (AIC) 50711.980 50711.980 Bayesian (BIC) 50911.853 50911.853 Sample-size adjusted Bayesian (BIC) 50800.652 50800.652
Root Mean Square Error of Approximation:
RMSEA 0.045 0.028 90 Percent confidence interval - lower 0.033 0.019 90 Percent confidence interval - upper 0.057 0.038 P-value RMSEA <= 0.05 0.740 1.000
Robust RMSEA 0.040 90 Percent confidence interval - lower 0.022 90 Percent confidence interval - upper 0.058
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 =~
hyet5 1.000 0.559 0.404 hyet7 1.000 0.559 0.419 hyet10 1.000 0.559 0.488 hyet12 1.000 0.559 0.497 RIsi =~
sisoe5 1.000 0.688 0.604 sisoe7 1.000 0.688 0.588 sisoe10 1.000 0.688 0.531 sisoe12 1.000 0.688 0.505 wad5 =~
hyet5 1.000 1.266 0.915 wad7 =~
hyet7 1.000 1.211 0.908 wad10 =~
hyet10 1.000 0.999 0.873 wad12 =~
hyet12 1.000 0.976 0.868 wsi5 =~
sisoe5 1.000 0.909 0.797 wsi7 =~
sisoe7 1.000 0.947 0.809 wsi10 =~
sisoe10 1.000 1.097 0.847 wsi12 =~
sisoe12 1.000 1.176 0.863
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.148 0.047 3.187 0.001 0.155 0.155 wsi5 -0.005 0.060 -0.086 0.932 -0.004 -0.004 wsi7 ~
wad5 0.051 0.031 1.611 0.107 0.068 0.068 wsi5 0.211 0.062 3.402 0.001 0.203 0.203 wad10 ~
wad7 0.090 0.061 1.490 0.136 0.109 0.109 wsi7 -0.070 0.046 -1.515 0.130 -0.066 -0.066 wsi10 ~
wad7 0.052 0.038 1.364 0.172 0.057 0.057 wsi7 0.286 0.059 4.842 0.000 0.247 0.247 wad12 ~
wad10 0.171 0.088 1.935 0.053 0.175 0.175 wsi10 -0.026 0.037 -0.681 0.496 -0.029 -0.029 wsi12 ~
wad10 0.030 0.047 0.633 0.527 0.025 0.025 wsi10 0.443 0.043 10.270 0.000 0.413 0.413
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.172 0.061 2.804 0.005 0.149 0.149 .wad7 ~~
.wsi7 0.202 0.058 3.507 0.000 0.183 0.183 .wad10 ~~
.wsi10 0.182 0.055 3.285 0.001 0.173 0.173 .wad12 ~~
.wsi12 0.144 0.051 2.830 0.005 0.141 0.141 RIad ~~
RIsi 0.174 0.039 4.516 0.000 0.452 0.452
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.478 0.030 15.702 0.000 0.478 0.345 .hyet7 0.437 0.030 14.600 0.000 0.437 0.328 .hyet10 0.333 0.027 12.510 0.000 0.333 0.291 .hyet12 0.298 0.026 11.352 0.000 0.298 0.265 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.713 .sisoe7 0.831 0.025 33.056 0.000 0.831 0.710 .sisoe10 0.940 0.028 33.689 0.000 0.940 0.726 .sisoe12 0.941 0.029 31.936 0.000 0.941 0.691 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.313 0.058 5.360 0.000 1.000 1.000 RIsi 0.473 0.058 8.185 0.000 1.000 1.000 wad5 1.602 0.149 10.779 0.000 1.000 1.000 wsi5 0.826 0.100 8.257 0.000 1.000 1.000 .wad7 1.432 0.144 9.922 0.000 0.976 0.976 .wsi7 0.852 0.075 11.370 0.000 0.950 0.950 .wad10 0.985 0.134 7.359 0.000 0.986 0.986 .wsi10 1.119 0.081 13.734 0.000 0.930 0.930 .wad12 0.924 0.132 7.021 0.000 0.970 0.970 .wsi12 1.142 0.082 13.973 0.000 0.825 0.825 .hyet5 0.000 0.000 0.000 .hyet7 0.000 0.000 0.000 .hyet10 0.000 0.000 0.000 .hyet12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadt_hyp.fit.summary)
RICLPMadt_hyp.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadt_hyp.fit.summary, type = "RICLPM", constraints = "No") RICLPMadt_hyp.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMadt_hyp2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyet5 + 1*hyet7 + 1*hyet10 + 1*hyet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyet5
wad7 =~ 1*hyet7
wad10 =~ 1*hyet10
wad12 =~ 1*hyet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadt_hyp2,
RICLPMadt_hyp2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadt_hyp2.fit,
RICLPMadt_hyp2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 40 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 96.335 41.067 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.001 Scaling correction factor 2.346 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3237.022 1403.931 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.306
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.975 0.983 Tucker-Lewis Index (TLI) 0.959 0.971
Robust Comparative Fit Index (CFI) 0.982 Robust Tucker-Lewis Index (TLI) 0.971
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -25344.563 -25344.563 Scaling correction factor 2.786 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 3.123 for the MLR correction
Akaike (AIC) 50743.127 50743.127 Bayesian (BIC) 50897.315 50897.315 Sample-size adjusted Bayesian (BIC) 50811.531 50811.531
Root Mean Square Error of Approximation:
RMSEA 0.046 0.025 90 Percent confidence interval - lower 0.037 0.019 90 Percent confidence interval - upper 0.055 0.032 P-value RMSEA <= 0.05 0.772 1.000
Robust RMSEA 0.039 90 Percent confidence interval - lower 0.024 90 Percent confidence interval - upper 0.054
Standardized Root Mean Square Residual:
SRMR 0.037 0.037
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 =~
hyet5 1.000 0.561 0.405 hyet7 1.000 0.561 0.420 hyet10 1.000 0.561 0.485 hyet12 1.000 0.561 0.502 RIsi =~
sisoe5 1.000 0.645 0.562 sisoe7 1.000 0.645 0.533 sisoe10 1.000 0.645 0.497 sisoe12 1.000 0.645 0.492 wad5 =~
hyet5 1.000 1.264 0.914 wad7 =~
hyet7 1.000 1.210 0.907 wad10 =~
hyet10 1.000 1.011 0.875 wad12 =~
hyet12 1.000 0.965 0.865 wsi5 =~
sisoe5 1.000 0.949 0.827 wsi7 =~
sisoe7 1.000 1.025 0.846 wsi10 =~
sisoe10 1.000 1.128 0.868 wsi12 =~
sisoe12 1.000 1.143 0.871
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.133 0.041 3.274 0.001 0.139 0.139 wsi5 (d) -0.037 0.031 -1.203 0.229 -0.029 -0.029 wsi7 ~
wad5 (c) 0.036 0.025 1.458 0.145 0.045 0.045 wsi5 (b) 0.362 0.042 8.656 0.000 0.336 0.336 wad10 ~
wad7 (a) 0.133 0.041 3.274 0.001 0.159 0.159 wsi7 (d) -0.037 0.031 -1.203 0.229 -0.038 -0.038 wsi10 ~
wad7 (c) 0.036 0.025 1.458 0.145 0.039 0.039 wsi7 (b) 0.362 0.042 8.656 0.000 0.329 0.329 wad12 ~
wad10 (a) 0.133 0.041 3.274 0.001 0.139 0.139 wsi10 (d) -0.037 0.031 -1.203 0.229 -0.044 -0.044 wsi12 ~
wad10 (c) 0.036 0.025 1.458 0.145 0.032 0.032 wsi10 (b) 0.362 0.042 8.656 0.000 0.357 0.357
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.173 0.057 3.044 0.002 0.144 0.144 .wad7 ~~
.wsi7 0.201 0.052 3.867 0.000 0.174 0.174 .wad10 ~~
.wsi10 0.182 0.055 3.291 0.001 0.172 0.172 .wad12 ~~
.wsi12 0.128 0.051 2.523 0.012 0.126 0.126 RIad ~~
RIsi 0.183 0.038 4.770 0.000 0.505 0.505
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyet5 0.478 0.030 15.688 0.000 0.478 0.346 .hyet7 0.437 0.030 14.584 0.000 0.437 0.327 .hyet10 0.334 0.027 12.594 0.000 0.334 0.289 .hyet12 0.298 0.026 11.245 0.000 0.298 0.267 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.708 .sisoe7 0.831 0.025 33.063 0.000 0.831 0.687 .sisoe10 0.940 0.028 33.714 0.000 0.940 0.723 .sisoe12 0.941 0.029 31.940 0.000 0.941 0.717 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.314 0.057 5.542 0.000 1.000 1.000 RIsi 0.417 0.058 7.164 0.000 1.000 1.000 wad5 1.597 0.148 10.819 0.000 1.000 1.000 wsi5 0.901 0.100 8.981 0.000 1.000 1.000 .wad7 1.437 0.140 10.252 0.000 0.981 0.981 .wsi7 0.925 0.067 13.859 0.000 0.881 0.881 .wad10 0.998 0.129 7.717 0.000 0.975 0.975 .wsi10 1.128 0.084 13.394 0.000 0.886 0.886 .wad12 0.913 0.125 7.306 0.000 0.981 0.981 .wsi12 1.134 0.084 13.579 0.000 0.868 0.868 .hyet5 0.000 0.000 0.000 .hyet7 0.000 0.000 0.000 .hyet10 0.000 0.000 0.000 .hyet12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadt_hyp2.fit.summary)
RICLPMadt_hyp2.fit.summary.fit RICLPMadt_hyp2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadt_hyp2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMadt_hyp2.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMadt_hyp2.fit.summary.reg
lavTestLRT(RICLPMadt_hyp.fit, RICLPMadt_hyp2.fit, method = "satorra.bentler.2010")
RICLPMadt_hyp2 is significantly worse fit compared to RICLPMadt_hyp. However, p = 0.042 which is very close to being non-significant. As the Chi square p value is often inflated for large samples, we will accept this model as the best fitting.
The best fitting model (mother report and Hyperactivity/impulsivity ADHD symptoms) is currently RICLPMadt2 where cross-lags are constrained to be equal across time.
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMadt_hyp3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyet5 + 1*hyet7 + 1*hyet10 + 1*hyet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyet5
wad7 =~ 1*hyet7
wad10 =~ 1*hyet10
wad12 =~ 1*hyet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
hyet5 + hyet7 + hyet10 + hyet12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMadt_hyp3,
RICLPMadt_hyp3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadt_hyp.fit, RICLPMadt_hyp3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrainetd to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMadt_inat # Create between components (random intercepts treated as factors here)
RIad =~ 1*inet5 + 1*inet7 + 1*inet10 + 1*inet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inet5
wad7 =~ 1*inet7
wad10 =~ 1*inet10
wad12 =~ 1*inet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadt_inat, # model
RICLPMadt_inat.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadt_inat.fit,
RICLPMadt_inat.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 66 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 66.844 32.172 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 2.078 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3514.978 1513.915 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.322
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.983 0.984 Tucker-Lewis Index (TLI) 0.948 0.951
Robust Comparative Fit Index (CFI) 0.986 Robust Tucker-Lewis Index (TLI) 0.957
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -25907.023 -25907.023 Scaling correction factor 3.211 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.979 for the MLR correction
Akaike (AIC) 51884.047 51884.047 Bayesian (BIC) 52083.920 52083.920 Sample-size adjusted Bayesian (BIC) 51972.719 51972.719
Root Mean Square Error of Approximation:
RMSEA 0.054 0.034 90 Percent confidence interval - lower 0.042 0.025 90 Percent confidence interval - upper 0.066 0.043 P-value RMSEA <= 0.05 0.287 0.999
Robust RMSEA 0.049 90 Percent confidence interval - lower 0.031 90 Percent confidence interval - upper 0.068
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 =~
inet5 1.000 0.638 0.439 inet7 1.000 0.638 0.441 inet10 1.000 0.638 0.487 inet12 1.000 0.638 0.529 RIsi =~
sisoe5 1.000 0.681 0.599 sisoe7 1.000 0.681 0.582 sisoe10 1.000 0.681 0.527 sisoe12 1.000 0.681 0.500 wad5 =~
inet5 1.000 1.305 0.898 wad7 =~
inet7 1.000 1.298 0.897 wad10 =~
inet10 1.000 1.143 0.873 wad12 =~
inet12 1.000 1.023 0.848 wsi5 =~
sisoe5 1.000 0.912 0.801 wsi7 =~
sisoe7 1.000 0.952 0.813 wsi10 =~
sisoe10 1.000 1.100 0.850 wsi12 =~
sisoe12 1.000 1.179 0.866
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.173 0.051 3.374 0.001 0.174 0.174 wsi5 -0.087 0.057 -1.530 0.126 -0.061 -0.061 wsi7 ~
wad5 0.054 0.034 1.599 0.110 0.074 0.074 wsi5 0.211 0.064 3.306 0.001 0.202 0.202 wad10 ~
wad7 0.092 0.054 1.686 0.092 0.104 0.104 wsi7 0.013 0.054 0.245 0.806 0.011 0.011 wsi10 ~
wad7 0.043 0.033 1.293 0.196 0.051 0.051 wsi7 0.294 0.059 4.989 0.000 0.255 0.255 wad12 ~
wad10 0.059 0.061 0.972 0.331 0.066 0.066 wsi10 0.033 0.050 0.659 0.510 0.035 0.035 wsi12 ~
wad10 -0.000 0.047 -0.006 0.995 -0.000 -0.000 wsi10 0.451 0.044 10.320 0.000 0.420 0.420
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.289 0.074 3.885 0.000 0.243 0.243 .wad7 ~~
.wsi7 0.200 0.053 3.740 0.000 0.169 0.169 .wad10 ~~
.wsi10 0.242 0.069 3.524 0.000 0.201 0.201 .wad12 ~~
.wsi12 0.283 0.060 4.732 0.000 0.260 0.260 RIad ~~
RIsi 0.228 0.040 5.689 0.000 0.525 0.525
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inet5 0.510 0.032 15.736 0.000 0.510 0.351 .inet7 0.473 0.032 14.834 0.000 0.473 0.327 .inet10 0.403 0.030 13.232 0.000 0.403 0.308 .inet12 0.327 0.028 11.623 0.000 0.327 0.271 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.714 .sisoe7 0.831 0.025 33.053 0.000 0.831 0.710 .sisoe10 0.939 0.028 33.692 0.000 0.939 0.726 .sisoe12 0.941 0.029 31.931 0.000 0.941 0.691 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.407 0.063 6.424 0.000 1.000 1.000 RIsi 0.464 0.058 7.985 0.000 1.000 1.000 wad5 1.703 0.162 10.513 0.000 1.000 1.000 wsi5 0.831 0.103 8.099 0.000 1.000 1.000 .wad7 1.635 0.158 10.342 0.000 0.971 0.971 .wsi7 0.858 0.075 11.377 0.000 0.947 0.947 .wad10 1.292 0.151 8.540 0.000 0.989 0.989 .wsi10 1.122 0.081 13.789 0.000 0.928 0.928 .wad12 1.039 0.136 7.633 0.000 0.993 0.993 .wsi12 1.145 0.082 13.958 0.000 0.823 0.823 .inet5 0.000 0.000 0.000 .inet7 0.000 0.000 0.000 .inet10 0.000 0.000 0.000 .inet12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadt_inat.fit.summary)
RICLPMadt_inat.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadt_inat.fit.summary, type = "RICLPM", constraints = "No") RICLPMadt_inat.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMadt_inat2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*inet5 + 1*inet7 + 1*inet10 + 1*inet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inet5
wad7 =~ 1*inet7
wad10 =~ 1*inet10
wad12 =~ 1*inet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadt_inat2,
RICLPMadt_inat2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadt_inat2.fit,
RICLPMadt_inat2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 53 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 38
Model Test User Model: Standard Robust Test Statistic 114.872 49.160 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.000 Scaling correction factor 2.337 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3514.978 1513.915 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.322
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.972 0.978 Tucker-Lewis Index (TLI) 0.954 0.964
Robust Comparative Fit Index (CFI) 0.978 Robust Tucker-Lewis Index (TLI) 0.964
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -25931.037 -25931.037 Scaling correction factor 2.610 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.979 for the MLR correction
Akaike (AIC) 51916.074 51916.074 Bayesian (BIC) 52070.262 52070.262 Sample-size adjusted Bayesian (BIC) 51984.479 51984.479
Root Mean Square Error of Approximation:
RMSEA 0.051 0.029 90 Percent confidence interval - lower 0.042 0.023 90 Percent confidence interval - upper 0.060 0.035 P-value RMSEA <= 0.05 0.423 1.000
Robust RMSEA 0.045 90 Percent confidence interval - lower 0.030 90 Percent confidence interval - upper 0.059
Standardized Root Mean Square Residual:
SRMR 0.042 0.042
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 =~
inet5 1.000 0.639 0.443 inet7 1.000 0.639 0.445 inet10 1.000 0.639 0.484 inet12 1.000 0.639 0.526 RIsi =~
sisoe5 1.000 0.641 0.557 sisoe7 1.000 0.641 0.530 sisoe10 1.000 0.641 0.494 sisoe12 1.000 0.641 0.488 wad5 =~
inet5 1.000 1.294 0.897 wad7 =~
inet7 1.000 1.287 0.896 wad10 =~
inet10 1.000 1.155 0.875 wad12 =~
inet12 1.000 1.034 0.851 wsi5 =~
sisoe5 1.000 0.954 0.830 wsi7 =~
sisoe7 1.000 1.025 0.848 wsi10 =~
sisoe10 1.000 1.127 0.869 wsi12 =~
sisoe12 1.000 1.145 0.873
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.110 0.036 3.010 0.003 0.110 0.110 wsi5 (d) -0.013 0.037 -0.351 0.726 -0.010 -0.010 wsi7 ~
wad5 (c) 0.021 0.025 0.821 0.412 0.026 0.026 wsi5 (b) 0.365 0.043 8.567 0.000 0.340 0.340 wad10 ~
wad7 (a) 0.110 0.036 3.010 0.003 0.122 0.122 wsi7 (d) -0.013 0.037 -0.351 0.726 -0.012 -0.012 wsi10 ~
wad7 (c) 0.021 0.025 0.821 0.412 0.024 0.024 wsi7 (b) 0.365 0.043 8.567 0.000 0.332 0.332 wad12 ~
wad10 (a) 0.110 0.036 3.010 0.003 0.122 0.122 wsi10 (d) -0.013 0.037 -0.351 0.726 -0.014 -0.014 wsi12 ~
wad10 (c) 0.021 0.025 0.821 0.412 0.021 0.021 wsi10 (b) 0.365 0.043 8.567 0.000 0.359 0.359
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.287 0.071 4.067 0.000 0.232 0.232 .wad7 ~~
.wsi7 0.216 0.051 4.272 0.000 0.176 0.176 .wad10 ~~
.wsi10 0.222 0.069 3.212 0.001 0.183 0.183 .wad12 ~~
.wsi12 0.268 0.059 4.586 0.000 0.245 0.245 RIad ~~
RIsi 0.240 0.043 5.553 0.000 0.586 0.586
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inet5 0.510 0.032 15.731 0.000 0.510 0.354 .inet7 0.474 0.032 14.797 0.000 0.474 0.330 .inet10 0.404 0.030 13.302 0.000 0.404 0.306 .inet12 0.326 0.028 11.569 0.000 0.326 0.269 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.707 .sisoe7 0.831 0.025 33.048 0.000 0.831 0.688 .sisoe10 0.939 0.028 33.721 0.000 0.939 0.725 .sisoe12 0.941 0.029 31.927 0.000 0.941 0.717 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.408 0.065 6.258 0.000 1.000 1.000 RIsi 0.411 0.058 7.098 0.000 1.000 1.000 wad5 1.674 0.162 10.335 0.000 1.000 1.000 wsi5 0.911 0.102 8.930 0.000 1.000 1.000 .wad7 1.637 0.157 10.452 0.000 0.988 0.988 .wsi7 0.924 0.067 13.724 0.000 0.880 0.880 .wad10 1.314 0.144 9.094 0.000 0.985 0.985 .wsi10 1.127 0.084 13.350 0.000 0.887 0.887 .wad12 1.053 0.129 8.153 0.000 0.985 0.985 .wsi12 1.138 0.084 13.618 0.000 0.868 0.868 .inet5 0.000 0.000 0.000 .inet7 0.000 0.000 0.000 .inet10 0.000 0.000 0.000 .inet12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadt_inat2.fit.summary)
RICLPMadt_inat2.fit.summary.fit RICLPMadt_inat2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadt_inat2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMadt_inat2.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMadt_inat2.fit.summary.reg
lavTestLRT(RICLPMadt_inat.fit, RICLPMadt_inat2.fit, method = "satorra.bentler.2010")
RICLPMadt_inat2 is significantly worse (p = 0.02499) fit compared to RICLPMadt_inat. **However, there was no large change (over 0.01) in model fit - therefore we will keep this as the best fitting model.
Difference in fit: RICLPMadt_inat2 RICLPMadt_inat Robust Comparative Fit Index (CFI) 0.978 0.986 (0.008) Robust Tucker-Lewis Index (TLI) 0.964 0.957 (-0.007) - better fit Robust RMSEA 0.045 0.049 (0.004) SRMR 0.042 0.031 (0.011)
The best fitting model (mother report and inattention ADHD symptoms) is currently RICLPMadt2 where autoregressives and cross-lags are constrained to be equal across time.
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMadt_inat3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*inet5 + 1*inet7 + 1*inet10 + 1*inet12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inet5
wad7 =~ 1*inet7
wad10 =~ 1*inet10
wad12 =~ 1*inet12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
inet5 + inet7 + inet10 + inet12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMadt_inat3,
RICLPMadt_inat3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadt_inat.fit, RICLPMadt_inat3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrainetd to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
<- '
CLPMadm # Estimate the lagged effects between the observed variables.
tadhdem7 + sisoe7 ~ tadhdem5 + sisoe5
tadhdem10 + sisoe10 ~ tadhdem7 + sisoe7
tadhdem12 + sisoe12 ~ tadhdem10 + sisoe10
# Estimate the covariance between the observed variables at the first wave.
tadhdem5 ~~ sisoe5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
tadhdem7 ~~ sisoe7
tadhdem10 ~~ sisoe10
tadhdem12 ~~ sisoe12
# Estimate the (residual) variance of the observed variables.
tadhdem5 ~~ tadhdem5 # Variances
sisoe5 ~~ sisoe5
tadhdem7 ~~ tadhdem7 # Residual variances
sisoe7 ~~ sisoe7
tadhdem10 ~~ tadhdem10
sisoe10 ~~ sisoe10
tadhdem12 ~~ tadhdem12
sisoe12 ~~ sisoe12
'
<- lavaan(CLPMadm,
CLPMadm.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMadm.fit,
CLPMadm.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 44 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 409.350 240.204 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.704 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6380.859 3452.175 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.848
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.937 0.933 Tucker-Lewis Index (TLI) 0.854 0.844
Robust Comparative Fit Index (CFI) 0.939 Robust Tucker-Lewis Index (TLI) 0.857
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -34734.629 -34734.629 Scaling correction factor 2.259 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.108 for the MLR correction
Akaike (AIC) 69533.259 69533.259 Bayesian (BIC) 69716.000 69716.000 Sample-size adjusted Bayesian (BIC) 69614.331 69614.331
Root Mean Square Error of Approximation:
RMSEA 0.122 0.092 90 Percent confidence interval - lower 0.112 0.085 90 Percent confidence interval - upper 0.132 0.100 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.120 90 Percent confidence interval - lower 0.107 90 Percent confidence interval - upper 0.134
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 tadhdem7 ~
tadhdem5 0.538 0.023 23.142 0.000 0.538 0.578 sisoe5 0.335 0.078 4.276 0.000 0.335 0.103 sisoe7 ~
tadhdem5 0.036 0.007 4.964 0.000 0.036 0.122 sisoe5 0.476 0.043 11.029 0.000 0.476 0.459 tadhdem10 ~
tadhdem7 0.486 0.027 18.134 0.000 0.486 0.524 sisoe7 0.330 0.078 4.241 0.000 0.330 0.113 sisoe10 ~
tadhdem7 0.049 0.008 6.024 0.000 0.049 0.138 sisoe7 0.497 0.035 14.097 0.000 0.497 0.450 tadhdem12 ~
tadhdem10 0.698 0.026 26.433 0.000 0.698 0.696 sisoe10 0.073 0.058 1.257 0.209 0.073 0.028 sisoe12 ~
tadhdem10 0.053 0.009 5.625 0.000 0.053 0.131 sisoe10 0.563 0.032 17.678 0.000 0.563 0.532
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdem5 ~~
sisoe5 1.274 0.138 9.234 0.000 1.274 0.283 .tadhdem7 ~~
.sisoe7 0.499 0.083 5.988 0.000 0.499 0.169 .tadhdem10 ~~
.sisoe10 0.658 0.097 6.762 0.000 0.658 0.210 .tadhdem12 ~~
.sisoe12 0.547 0.098 5.553 0.000 0.547 0.203
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem7 0.542 0.079 6.859 0.000 0.542 0.147 .sisoe7 0.323 0.033 9.728 0.000 0.323 0.275 .tadhdem10 0.640 0.072 8.904 0.000 0.640 0.187 .sisoe10 0.399 0.030 13.395 0.000 0.399 0.307 .tadhdem12 0.435 0.060 7.200 0.000 0.435 0.127 .sisoe12 0.296 0.028 10.491 0.000 0.296 0.216 tadhdem5 3.368 0.084 40.093 0.000 3.368 0.849 sisoe5 0.813 0.024 33.882 0.000 0.813 0.717
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdem5 15.740 0.603 26.122 0.000 15.740 1.000 sisoe5 1.285 0.102 12.618 0.000 1.285 1.000 .tadhdem7 8.452 0.414 20.438 0.000 8.452 0.621 .sisoe7 1.029 0.062 16.607 0.000 1.029 0.743 .tadhdem10 7.910 0.396 19.994 0.000 7.910 0.675 .sisoe10 1.245 0.076 16.287 0.000 1.245 0.739 .tadhdem12 5.900 0.355 16.603 0.000 5.900 0.501 .sisoe12 1.226 0.080 15.285 0.000 1.226 0.651
#Table of model fit
<- table.model.fit(CLPMadm.fit.summary)
CLPMadm.fit.summary.fit CLPMadm.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMadm.fit.summary, type = "CLPM", constraints = "No")
CLPMadm.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) CLPMadm.fit.summary.reg
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMadm # Create between components (rando intercepts treated as factors here)
RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdem5
wad7 =~ 1*tadhdem7
wad10 =~ 1*tadhdem10
wad12 =~ 1*tadhdem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm, # model
RICLPMadm.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadm.fit,
RICLPMadm.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 97 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 61.152 41.052 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.490 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6380.859 3452.175 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.848
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.991 Tucker-Lewis Index (TLI) 0.974 0.971
Robust Comparative Fit Index (CFI) 0.992 Robust Tucker-Lewis Index (TLI) 0.977
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -34560.530 -34560.530 Scaling correction factor 2.267 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.108 for the MLR correction
Akaike (AIC) 69191.061 69191.061 Bayesian (BIC) 69390.934 69390.934 Sample-size adjusted Bayesian (BIC) 69279.733 69279.733
Root Mean Square Error of Approximation:
RMSEA 0.051 0.040 90 Percent confidence interval - lower 0.039 0.030 90 Percent confidence interval - upper 0.063 0.050 P-value RMSEA <= 0.05 0.423 0.944
Robust RMSEA 0.049 90 Percent confidence interval - lower 0.034 90 Percent confidence interval - upper 0.064
Standardized Root Mean Square Residual:
SRMR 0.028 0.028
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 =~
tadhdem5 1.000 2.565 0.637 tadhdem7 1.000 2.565 0.706 tadhdem10 1.000 2.565 0.751 tadhdem12 1.000 2.565 0.750 RIsi =~
sisoe5 1.000 0.684 0.597 sisoe7 1.000 0.684 0.584 sisoe10 1.000 0.684 0.528 sisoe12 1.000 0.684 0.504 wad5 =~
tadhdem5 1.000 3.106 0.771 wad7 =~
tadhdem7 1.000 2.574 0.708 wad10 =~
tadhdem10 1.000 2.258 0.661 wad12 =~
tadhdem12 1.000 2.260 0.661 wsi5 =~
sisoe5 1.000 0.919 0.802 wsi7 =~
sisoe7 1.000 0.950 0.811 wsi10 =~
sisoe10 1.000 1.099 0.849 wsi12 =~
sisoe12 1.000 1.172 0.864
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.229 0.037 6.256 0.000 0.276 0.276 wsi5 0.257 0.110 2.335 0.020 0.092 0.092 wsi7 ~
wad5 0.021 0.012 1.783 0.075 0.070 0.070 wsi5 0.218 0.061 3.573 0.000 0.210 0.210 wad10 ~
wad7 0.015 0.063 0.244 0.807 0.018 0.018 wsi7 0.318 0.140 2.278 0.023 0.134 0.134 wsi10 ~
wad7 0.040 0.017 2.393 0.017 0.095 0.095 wsi7 0.283 0.058 4.865 0.000 0.244 0.244 wad12 ~
wad10 0.303 0.067 4.536 0.000 0.303 0.303 wsi10 0.130 0.087 1.494 0.135 0.063 0.063 wsi12 ~
wad10 0.028 0.023 1.252 0.211 0.055 0.055 wsi10 0.427 0.042 10.299 0.000 0.401 0.401
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.550 0.124 4.420 0.000 0.193 0.193 .wad7 ~~
.wsi7 0.329 0.105 3.134 0.002 0.145 0.145 .wad10 ~~
.wsi10 0.605 0.121 5.009 0.000 0.256 0.256 .wad12 ~~
.wsi12 0.430 0.091 4.729 0.000 0.189 0.189 RIad ~~
RIsi 0.834 0.105 7.920 0.000 0.475 0.475
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem5 3.368 0.084 40.095 0.000 3.368 0.836 .tadhdem7 2.626 0.079 33.389 0.000 2.626 0.723 .tadhdem10 2.193 0.073 29.922 0.000 2.193 0.642 .tadhdem12 2.032 0.073 27.731 0.000 2.032 0.594 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.710 .sisoe7 0.832 0.025 33.068 0.000 0.832 0.710 .sisoe10 0.940 0.028 33.701 0.000 0.940 0.726 .sisoe12 0.941 0.029 31.939 0.000 0.941 0.693 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 6.579 0.484 13.596 0.000 1.000 1.000 RIsi 0.468 0.057 8.265 0.000 1.000 1.000 wad5 9.646 0.510 18.912 0.000 1.000 1.000 wsi5 0.844 0.098 8.590 0.000 1.000 1.000 .wad7 6.001 0.410 14.621 0.000 0.906 0.906 .wsi7 0.853 0.074 11.545 0.000 0.945 0.945 .wad10 5.002 0.513 9.746 0.000 0.981 0.981 .wsi10 1.115 0.081 13.836 0.000 0.923 0.923 .wad12 4.564 0.306 14.935 0.000 0.893 0.893 .wsi12 1.133 0.082 13.893 0.000 0.824 0.824 .tadhdem5 0.000 0.000 0.000 .tadhdem7 0.000 0.000 0.000 .tadhdem10 0.000 0.000 0.000 .tadhdem12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadm.fit.summary)
RICLPMadm.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadm.fit.summary, type = "RICLPM", constraints = "No") RICLPMadm.fit.summary.reg
<- '
RICLPMadm2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdem5
wad7 =~ 1*tadhdem7
wad10 =~ 1*tadhdem10
wad12 =~ 1*tadhdem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainemd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm2,
RICLPMadm2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm.fit, RICLPMadm2.fit, method = "satorra.bentler.2010")
RICLPMadm2 is significantly worse fit compared to RICLPMadm according to the Chi square test.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMadm2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdem5
wad7 =~ 1*tadhdem7
wad10 =~ 1*tadhdem10
wad12 =~ 1*tadhdem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm2a,
RICLPMadm2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm.fit, RICLPMadm2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMadm3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*tadhdem5
wad7 =~ 1*tadhdem7
wad10 =~ 1*tadhdem10
wad12 =~ 1*tadhdem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainemd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
tadhdem5 + tadhdem7 + tadhdem10 + tadhdem12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMadm3,
RICLPMadm3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm.fit, RICLPMadm3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMadm_hyp # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyem5 + 1*hyem7 + 1*hyem10 + 1*hyem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyem5
wad7 =~ 1*hyem7
wad10 =~ 1*hyem10
wad12 =~ 1*hyem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm_hyp, # model
RICLPMadm_hyp.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadm_hyp.fit,
RICLPMadm_hyp.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 81 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 41.630 29.530 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.001 Scaling correction factor 1.410 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5943.680 3467.312 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.714
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.994 0.994 Tucker-Lewis Index (TLI) 0.983 0.981
Robust Comparative Fit Index (CFI) 0.995 Robust Tucker-Lewis Index (TLI) 0.985
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -30257.922 -30257.922 Scaling correction factor 2.111 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.968 for the MLR correction
Akaike (AIC) 60585.844 60585.844 Bayesian (BIC) 60785.717 60785.717 Sample-size adjusted Bayesian (BIC) 60674.517 60674.517
Root Mean Square Error of Approximation:
RMSEA 0.040 0.032 90 Percent confidence interval - lower 0.028 0.021 90 Percent confidence interval - upper 0.053 0.043 P-value RMSEA <= 0.05 0.890 0.997
Robust RMSEA 0.038 90 Percent confidence interval - lower 0.023 90 Percent confidence interval - upper 0.054
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 =~
hyem5 1.000 1.481 0.608 hyem7 1.000 1.481 0.667 hyem10 1.000 1.481 0.741 hyem12 1.000 1.481 0.751 RIsi =~
sisoe5 1.000 0.692 0.606 sisoe7 1.000 0.692 0.592 sisoe10 1.000 0.692 0.534 sisoe12 1.000 0.692 0.508 wad5 =~
hyem5 1.000 1.933 0.794 wad7 =~
hyem7 1.000 1.652 0.745 wad10 =~
hyem10 1.000 1.342 0.672 wad12 =~
hyem12 1.000 1.301 0.660 wsi5 =~
sisoe5 1.000 0.910 0.796 wsi7 =~
sisoe7 1.000 0.942 0.806 wsi10 =~
sisoe10 1.000 1.096 0.845 wsi12 =~
sisoe12 1.000 1.175 0.862
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.268 0.031 8.617 0.000 0.314 0.314 wsi5 0.126 0.066 1.925 0.054 0.070 0.070 wsi7 ~
wad5 0.031 0.017 1.819 0.069 0.064 0.064 wsi5 0.208 0.062 3.369 0.001 0.201 0.201 wad10 ~
wad7 0.063 0.048 1.300 0.194 0.077 0.077 wsi7 0.193 0.074 2.586 0.010 0.135 0.135 wsi10 ~
wad7 0.053 0.023 2.350 0.019 0.081 0.081 wsi7 0.282 0.059 4.809 0.000 0.243 0.243 wad12 ~
wad10 0.246 0.062 3.938 0.000 0.253 0.253 wsi10 0.071 0.049 1.437 0.151 0.060 0.060 wsi12 ~
wad10 0.067 0.035 1.942 0.052 0.077 0.077 wsi10 0.424 0.040 10.478 0.000 0.396 0.396
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.249 0.064 3.866 0.000 0.141 0.141 .wad7 ~~
.wsi7 0.153 0.058 2.609 0.009 0.106 0.106 .wad10 ~~
.wsi10 0.322 0.066 4.876 0.000 0.230 0.230 .wad12 ~~
.wsi12 0.215 0.053 4.065 0.000 0.161 0.161 RIad ~~
RIsi 0.404 0.056 7.241 0.000 0.394 0.394
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hyem5 2.160 0.051 42.247 0.000 2.160 0.887 .hyem7 1.681 0.048 35.123 0.000 1.681 0.758 .hyem10 1.228 0.043 28.616 0.000 1.228 0.615 .hyem12 1.104 0.042 26.133 0.000 1.104 0.560 .sisoe5 0.813 0.024 33.882 0.000 0.813 0.711 .sisoe7 0.832 0.025 33.061 0.000 0.832 0.711 .sisoe10 0.939 0.028 33.695 0.000 0.939 0.725 .sisoe12 0.941 0.029 31.954 0.000 0.941 0.690 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 2.193 0.145 15.171 0.000 1.000 1.000 RIsi 0.479 0.056 8.482 0.000 1.000 1.000 wad5 3.735 0.169 22.105 0.000 1.000 1.000 wsi5 0.828 0.097 8.527 0.000 1.000 1.000 .wad7 2.431 0.134 18.161 0.000 0.891 0.891 .wsi7 0.845 0.074 11.392 0.000 0.952 0.952 .wad10 1.752 0.155 11.321 0.000 0.973 0.973 .wsi10 1.115 0.081 13.744 0.000 0.929 0.929 .wad12 1.566 0.104 14.986 0.000 0.924 0.924 .wsi12 1.134 0.081 14.007 0.000 0.822 0.822 .hyem5 0.000 0.000 0.000 .hyem7 0.000 0.000 0.000 .hyem10 0.000 0.000 0.000 .hyem12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadm_hyp.fit.summary)
RICLPMadm_hyp.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadm_hyp.fit.summary, type = "RICLPM", constraints = "No") RICLPMadm_hyp.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMadm_hyp2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyem5 + 1*hyem7 + 1*hyem10 + 1*hyem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyem5
wad7 =~ 1*hyem7
wad10 =~ 1*hyem10
wad12 =~ 1*hyem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainemd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm_hyp2,
RICLPMadm_hyp2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm_hyp.fit, RICLPMadm_hyp2.fit, method = "satorra.bentler.2010")
RICLPMadm_hyp2 is significantly worse fit compared to RICLPMadm_hyp.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMadm_hyp2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyem5 + 1*hyem7 + 1*hyem10 + 1*hyem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyem5
wad7 =~ 1*hyem7
wad10 =~ 1*hyem10
wad12 =~ 1*hyem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm_hyp2a,
RICLPMadm_hyp2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm_hyp.fit, RICLPMadm_hyp2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMadm_hyp3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hyem5 + 1*hyem7 + 1*hyem10 + 1*hyem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*hyem5
wad7 =~ 1*hyem7
wad10 =~ 1*hyem10
wad12 =~ 1*hyem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainemd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
hyem5 + hyem7 + hyem10 + hyem12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMadm_hyp3,
RICLPMadm_hyp3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm_hyp.fit, RICLPMadm_hyp3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrainemd to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMadm_inat # Create between components (random intercepts treated as factors here)
RIad =~ 1*inem5 + 1*inem7 + 1*inem10 + 1*inem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inem5
wad7 =~ 1*inem7
wad10 =~ 1*inem10
wad12 =~ 1*inem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm_inat, # model
RICLPMadm_inat.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMadm_inat.fit,
RICLPMadm_inat.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 72 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 63.704 39.499 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.613 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5599.312 2890.544 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.937
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.990 0.989 Tucker-Lewis Index (TLI) 0.969 0.967
Robust Comparative Fit Index (CFI) 0.991 Robust Tucker-Lewis Index (TLI) 0.972
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -29082.509 -29082.509 Scaling correction factor 2.396 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.236 for the MLR correction
Akaike (AIC) 58235.018 58235.018 Bayesian (BIC) 58434.891 58434.891 Sample-size adjusted Bayesian (BIC) 58323.691 58323.691
Root Mean Square Error of Approximation:
RMSEA 0.052 0.039 90 Percent confidence interval - lower 0.041 0.029 90 Percent confidence interval - upper 0.065 0.049 P-value RMSEA <= 0.05 0.359 0.965
Robust RMSEA 0.049 90 Percent confidence interval - lower 0.034 90 Percent confidence interval - upper 0.066
Standardized Root Mean Square Residual:
SRMR 0.028 0.028
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 =~
inem5 1.000 1.232 0.620 inem7 1.000 1.232 0.687 inem10 1.000 1.232 0.689 inem12 1.000 1.232 0.679 RIsi =~
sisoe5 1.000 0.687 0.600 sisoe7 1.000 0.687 0.587 sisoe10 1.000 0.687 0.531 sisoe12 1.000 0.687 0.507 wad5 =~
inem5 1.000 1.558 0.784 wad7 =~
inem7 1.000 1.304 0.727 wad10 =~
inem10 1.000 1.295 0.725 wad12 =~
inem12 1.000 1.330 0.734 wsi5 =~
sisoe5 1.000 0.917 0.800 wsi7 =~
sisoe7 1.000 0.949 0.810 wsi10 =~
sisoe10 1.000 1.098 0.848 wsi12 =~
sisoe12 1.000 1.169 0.862
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.149 0.042 3.521 0.000 0.178 0.178 wsi5 0.131 0.059 2.219 0.026 0.092 0.092 wsi7 ~
wad5 0.030 0.026 1.182 0.237 0.050 0.050 wsi5 0.219 0.060 3.632 0.000 0.212 0.212 wad10 ~
wad7 0.011 0.065 0.170 0.865 0.011 0.011 wsi7 0.109 0.076 1.444 0.149 0.080 0.080 wsi10 ~
wad7 0.070 0.035 1.994 0.046 0.084 0.084 wsi7 0.284 0.058 4.890 0.000 0.245 0.245 wad12 ~
wad10 0.337 0.055 6.085 0.000 0.329 0.329 wsi10 0.071 0.046 1.520 0.129 0.058 0.058 wsi12 ~
wad10 0.026 0.036 0.738 0.460 0.029 0.029 wsi10 0.434 0.043 10.171 0.000 0.407 0.407
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.276 0.074 3.736 0.000 0.193 0.193 .wad7 ~~
.wsi7 0.171 0.056 3.048 0.002 0.146 0.146 .wad10 ~~
.wsi10 0.281 0.065 4.333 0.000 0.206 0.206 .wad12 ~~
.wsi12 0.237 0.049 4.851 0.000 0.179 0.179 RIad ~~
RIsi 0.437 0.055 7.889 0.000 0.516 0.516
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .inem5 1.208 0.041 29.147 0.000 1.208 0.608 .inem7 0.944 0.039 24.262 0.000 0.944 0.527 .inem10 0.965 0.038 25.160 0.000 0.965 0.540 .inem12 0.928 0.039 23.952 0.000 0.928 0.512 .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.706 0.000 0.940 0.726 .sisoe12 0.941 0.029 31.930 0.000 0.941 0.694 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 1.517 0.130 11.663 0.000 1.000 1.000 RIsi 0.472 0.056 8.452 0.000 1.000 1.000 wad5 2.427 0.154 15.762 0.000 1.000 1.000 wsi5 0.841 0.099 8.488 0.000 1.000 1.000 .wad7 1.620 0.129 12.550 0.000 0.953 0.953 .wsi7 0.854 0.074 11.527 0.000 0.949 0.949 .wad10 1.667 0.156 10.681 0.000 0.993 0.993 .wsi10 1.116 0.080 13.858 0.000 0.926 0.926 .wad12 1.557 0.101 15.382 0.000 0.880 0.880 .wsi12 1.132 0.082 13.820 0.000 0.828 0.828 .inem5 0.000 0.000 0.000 .inem7 0.000 0.000 0.000 .inem10 0.000 0.000 0.000 .inem12 0.000 0.000 0.000 .sisoe5 0.000 0.000 0.000 .sisoe7 0.000 0.000 0.000 .sisoe10 0.000 0.000 0.000 .sisoe12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMadm_inat.fit.summary)
RICLPMadm_inat.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMadm_inat.fit.summary, type = "RICLPM", constraints = "No") RICLPMadm_inat.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMadm_inat2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*inem5 + 1*inem7 + 1*inem10 + 1*inem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inem5
wad7 =~ 1*inem7
wad10 =~ 1*inem10
wad12 =~ 1*inem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainemd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm_inat2,
RICLPMadm_inat2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm_inat.fit, RICLPMadm_inat2.fit, method = "satorra.bentler.2010")
RICLPMadm_inat2 is significantly worse fit compared to RICLPMadm_inat.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMadm_inat2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*inem5 + 1*inem7 + 1*inem10 + 1*inem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inem5
wad7 =~ 1*inem7
wad10 =~ 1*inem10
wad12 =~ 1*inem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMadm_inat2a,
RICLPMadm_inat2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm_inat.fit, RICLPMadm_inat2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMadm_inat3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*inem5 + 1*inem7 + 1*inem10 + 1*inem12 #x
RIsi =~ 1*sisoe5 + 1*sisoe7 + 1*sisoe10 + 1*sisoe12 #y
# Create within-person centered variables
wad5 =~ 1*inem5
wad7 =~ 1*inem7
wad10 =~ 1*inem10
wad12 =~ 1*inem12
wsi5 =~ 1*sisoe5
wsi7 =~ 1*sisoe7
wsi10 =~ 1*sisoe10
wsi12 =~ 1*sisoe12
# Constrainemd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
inem5 + inem7 + inem10 + inem12 ~ mad*1
sisoe5 + sisoe7 + sisoe10 + sisoe12 ~ msi*1
'
<- lavaan(RICLPMadm_inat3,
RICLPMadm_inat3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMadm_inat.fit, RICLPMadm_inat3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrainemd to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
<- '
CLPMsit # Estimate the lagged effects between the observed variables.
tadhde7 + sisoet7 ~ tadhde5 + sisoet5
tadhde10 + sisoet10 ~ tadhde7 + sisoet7
tadhde12 + sisoet12 ~ tadhde10 + sisoet10
# Estimate the covariance between the observed variables at the first wave.
tadhde5 ~~ sisoet5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
tadhde7 ~~ sisoet7
tadhde10 ~~ sisoet10
tadhde12 ~~ sisoet12
# Estimate the (residual) variance of the observed variables.
tadhde5 ~~ tadhde5 # Variances
sisoet5 ~~ sisoet5
tadhde7 ~~ tadhde7 # Residual variances
sisoet7 ~~ sisoet7
tadhde10 ~~ tadhde10
sisoet10 ~~ sisoet10
tadhde12 ~~ tadhde12
sisoet12 ~~ sisoet12
'
<- lavaan(CLPMsit,
CLPMsit.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMsit.fit,
CLPMsit.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 36 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 381.502 220.037 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.734 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 4387.281 2253.068 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.947
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.915 0.907 Tucker-Lewis Index (TLI) 0.802 0.782
Robust Comparative Fit Index (CFI) 0.917 Robust Tucker-Lewis Index (TLI) 0.806
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -32173.935 -32173.935 Scaling correction factor 2.585 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.353 for the MLR correction
Akaike (AIC) 64411.869 64411.869 Bayesian (BIC) 64594.610 64594.610 Sample-size adjusted Bayesian (BIC) 64492.941 64492.941
Root Mean Square Error of Approximation:
RMSEA 0.117 0.088 90 Percent confidence interval - lower 0.107 0.081 90 Percent confidence interval - upper 0.128 0.096 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.116 90 Percent confidence interval - lower 0.103 90 Percent confidence interval - upper 0.130
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 tadhde7 ~
tadhde5 0.544 0.027 20.358 0.000 0.544 0.579 sisoet5 0.087 0.050 1.745 0.081 0.087 0.042 sisoet7 ~
tadhde5 0.061 0.012 5.097 0.000 0.061 0.129 sisoet5 0.278 0.046 6.075 0.000 0.278 0.267 tadhde10 ~
tadhde7 0.533 0.029 18.450 0.000 0.533 0.557 sisoet7 0.045 0.049 0.937 0.349 0.045 0.024 sisoet10 ~
tadhde7 0.104 0.018 5.928 0.000 0.104 0.184 sisoet7 0.261 0.040 6.615 0.000 0.261 0.232 tadhde12 ~
tadhde10 0.673 0.034 19.817 0.000 0.673 0.654 sisoet10 -0.056 0.045 -1.252 0.210 -0.056 -0.032 sisoet12 ~
tadhde10 0.088 0.019 4.612 0.000 0.088 0.145 sisoet10 0.319 0.037 8.506 0.000 0.319 0.314
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 ~~
sisoet5 1.002 0.146 6.862 0.000 1.002 0.289 .tadhde7 ~~
.sisoet7 0.487 0.088 5.559 0.000 0.487 0.189 .tadhde10 ~~
.sisoet10 0.709 0.109 6.503 0.000 0.709 0.249 .tadhde12 ~~
.sisoet12 0.627 0.115 5.449 0.000 0.627 0.232
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde7 0.533 0.055 9.690 0.000 0.533 0.205 .sisoet7 0.338 0.036 9.401 0.000 0.338 0.258 .tadhde10 0.569 0.051 11.224 0.000 0.569 0.229 .sisoet10 0.394 0.036 10.985 0.000 0.394 0.267 .tadhde12 0.443 0.045 9.805 0.000 0.443 0.173 .sisoet12 0.409 0.038 10.904 0.000 0.409 0.273 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814 sisoet5 0.629 0.028 22.570 0.000 0.629 0.502
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 sisoet5 1.571 0.134 11.706 0.000 1.571 1.000 .tadhde7 4.369 0.238 18.344 0.000 4.369 0.648 .sisoet7 1.528 0.115 13.314 0.000 1.528 0.892 .tadhde10 4.202 0.269 15.645 0.000 4.202 0.682 .sisoet10 1.933 0.154 12.555 0.000 1.933 0.889 .tadhde12 3.820 0.279 13.712 0.000 3.820 0.585 .sisoet12 1.908 0.142 13.468 0.000 1.908 0.850
#Table of model fit
<- table.model.fit(CLPMsit.fit.summary)
CLPMsit.fit.summary.fit CLPMsit.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMsit.fit.summary, type = "CLPM", constraints = "No")
CLPMsit.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) CLPMsit.fit.summary.reg
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMsit # Create between components (rando intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit, # model
RICLPMsit.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsit.fit,
RICLPMsit.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 96 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 45.288 26.858 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.001 Scaling correction factor 1.686 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 4387.281 2253.068 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.947
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.992 0.992 Tucker-Lewis Index (TLI) 0.974 0.975
Robust Comparative Fit Index (CFI) 0.993 Robust Tucker-Lewis Index (TLI) 0.978
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -32005.828 -32005.828 Scaling correction factor 2.524 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.353 for the MLR correction
Akaike (AIC) 64081.655 64081.655 Bayesian (BIC) 64281.528 64281.528 Sample-size adjusted Bayesian (BIC) 64170.327 64170.327
Root Mean Square Error of Approximation:
RMSEA 0.043 0.030 90 Percent confidence interval - lower 0.031 0.020 90 Percent confidence interval - upper 0.055 0.040 P-value RMSEA <= 0.05 0.826 1.000
Robust RMSEA 0.039 90 Percent confidence interval - lower 0.022 90 Percent confidence interval - upper 0.056
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 =~
tadhde5 1.000 1.814 0.648 tadhde7 1.000 1.814 0.707 tadhde10 1.000 1.814 0.729 tadhde12 1.000 1.814 0.715 RIsi =~
sisoet5 1.000 0.597 0.473 sisoet7 1.000 0.597 0.456 sisoet10 1.000 0.597 0.407 sisoet12 1.000 0.597 0.404 wad5 =~
tadhde5 1.000 2.135 0.762 wad7 =~
tadhde7 1.000 1.813 0.707 wad10 =~
tadhde10 1.000 1.703 0.684 wad12 =~
tadhde12 1.000 1.773 0.699 wsi5 =~
sisoet5 1.000 1.113 0.881 wsi7 =~
sisoet7 1.000 1.166 0.890 wsi10 =~
sisoet10 1.000 1.341 0.914 wsi12 =~
sisoet12 1.000 1.352 0.915
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.203 0.038 5.315 0.000 0.239 0.239 wsi5 0.101 0.068 1.490 0.136 0.062 0.062 wsi7 ~
wad5 0.037 0.020 1.832 0.067 0.067 0.067 wsi5 0.106 0.063 1.694 0.090 0.101 0.101 wad10 ~
wad7 0.074 0.063 1.165 0.244 0.078 0.078 wsi7 0.048 0.065 0.739 0.460 0.033 0.033 wsi10 ~
wad7 0.092 0.037 2.505 0.012 0.125 0.125 wsi7 0.099 0.058 1.709 0.087 0.086 0.086 wad12 ~
wad10 0.263 0.069 3.811 0.000 0.253 0.253 wsi10 -0.020 0.058 -0.350 0.726 -0.015 -0.015 wsi12 ~
wad10 0.028 0.037 0.749 0.454 0.035 0.035 wsi10 0.214 0.046 4.702 0.000 0.212 0.212
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.568 0.115 4.930 0.000 0.239 0.239 .wad7 ~~
.wsi7 0.357 0.100 3.578 0.000 0.177 0.177 .wad10 ~~
.wsi10 0.634 0.125 5.073 0.000 0.283 0.283 .wad12 ~~
.wsi12 0.421 0.108 3.883 0.000 0.186 0.186 RIad ~~
RIsi 0.526 0.074 7.126 0.000 0.486 0.486
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.803 .tadhde7 1.812 0.055 32.726 0.000 1.812 0.706 .tadhde10 1.565 0.053 29.466 0.000 1.565 0.629 .tadhde12 1.453 0.055 26.662 0.000 1.453 0.573 .sisoet5 0.631 0.028 22.609 0.000 0.631 0.499 .sisoet7 0.651 0.029 22.259 0.000 0.651 0.497 .sisoet10 0.753 0.034 21.922 0.000 0.753 0.513 .sisoet12 0.785 0.036 22.023 0.000 0.785 0.531 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 3.291 0.239 13.745 0.000 1.000 1.000 RIsi 0.357 0.052 6.857 0.000 1.000 1.000 wad5 4.559 0.316 14.431 0.000 1.000 1.000 wsi5 1.239 0.127 9.751 0.000 1.000 1.000 .wad7 3.066 0.239 12.830 0.000 0.932 0.932 .wsi7 1.335 0.124 10.745 0.000 0.982 0.982 .wad10 2.876 0.322 8.934 0.000 0.992 0.992 .wsi10 1.750 0.151 11.557 0.000 0.973 0.973 .wad12 2.949 0.258 11.450 0.000 0.938 0.938 .wsi12 1.735 0.143 12.090 0.000 0.949 0.949 .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 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsit.fit.summary)
RICLPMsit.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsit.fit.summary, type = "RICLPM", constraints = "No")
RICLPMsit.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMsit.fit.summary.reg
<- '
RICLPMsit2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit2,
RICLPMsit2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsit2.fit,
RICLPMsit2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 88 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 99.639 50.816 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.961 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 4387.281 2253.068 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.947
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.981 0.985 Tucker-Lewis Index (TLI) 0.969 0.975
Robust Comparative Fit Index (CFI) 0.985 Robust Tucker-Lewis Index (TLI) 0.975
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -32033.003 -32033.003 Scaling correction factor 2.005 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.353 for the MLR correction
Akaike (AIC) 64120.006 64120.006 Bayesian (BIC) 64274.194 64274.194 Sample-size adjusted Bayesian (BIC) 64188.411 64188.411
Root Mean Square Error of Approximation:
RMSEA 0.047 0.030 90 Percent confidence interval - lower 0.038 0.023 90 Percent confidence interval - upper 0.056 0.037 P-value RMSEA <= 0.05 0.716 1.000
Robust RMSEA 0.042 90 Percent confidence interval - lower 0.029 90 Percent confidence interval - upper 0.055
Standardized Root Mean Square Residual:
SRMR 0.035 0.035
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.777 0.638 tadhde7 1.000 1.777 0.688 tadhde10 1.000 1.777 0.699 tadhde12 1.000 1.777 0.713 RIsi =~
sisoet5 1.000 0.590 0.466 sisoet7 1.000 0.590 0.444 sisoet10 1.000 0.590 0.404 sisoet12 1.000 0.590 0.403 wad5 =~
tadhde5 1.000 2.144 0.770 wad7 =~
tadhde7 1.000 1.876 0.726 wad10 =~
tadhde10 1.000 1.820 0.716 wad12 =~
tadhde12 1.000 1.745 0.701 wsi5 =~
sisoet5 1.000 1.119 0.885 wsi7 =~
sisoet7 1.000 1.189 0.896 wsi10 =~
sisoet10 1.000 1.337 0.915 wsi12 =~
sisoet12 1.000 1.339 0.915
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.223 0.033 6.722 0.000 0.255 0.255 wsi5 (d) 0.024 0.036 0.664 0.507 0.014 0.014 wsi7 ~
wad5 (c) 0.052 0.017 3.064 0.002 0.094 0.094 wsi5 (b) 0.145 0.036 4.049 0.000 0.137 0.137 wad10 ~
wad7 (a) 0.223 0.033 6.722 0.000 0.230 0.230 wsi7 (d) 0.024 0.036 0.664 0.507 0.016 0.016 wsi10 ~
wad7 (c) 0.052 0.017 3.064 0.002 0.073 0.073 wsi7 (b) 0.145 0.036 4.049 0.000 0.129 0.129 wad12 ~
wad10 (a) 0.223 0.033 6.722 0.000 0.232 0.232 wsi10 (d) 0.024 0.036 0.664 0.507 0.019 0.019 wsi12 ~
wad10 (c) 0.052 0.017 3.064 0.002 0.071 0.071 wsi10 (b) 0.145 0.036 4.049 0.000 0.145 0.145
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.549 0.107 5.115 0.000 0.229 0.229 .wad7 ~~
.wsi7 0.362 0.093 3.900 0.000 0.171 0.171 .wad10 ~~
.wsi10 0.598 0.114 5.235 0.000 0.256 0.256 .wad12 ~~
.wsi12 0.424 0.106 3.979 0.000 0.190 0.190 RIad ~~
RIsi 0.531 0.069 7.685 0.000 0.507 0.507
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.717 0.000 1.813 0.702 .tadhde10 1.563 0.053 29.422 0.000 1.563 0.615 .tadhde12 1.454 0.055 26.608 0.000 1.454 0.584 .sisoet5 0.631 0.028 22.532 0.000 0.631 0.499 .sisoet7 0.652 0.029 22.239 0.000 0.652 0.491 .sisoet10 0.751 0.034 21.990 0.000 0.751 0.514 .sisoet12 0.785 0.036 21.969 0.000 0.785 0.537 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 3.156 0.227 13.875 0.000 1.000 1.000 RIsi 0.348 0.052 6.681 0.000 1.000 1.000 wad5 4.597 0.313 14.677 0.000 1.000 1.000 wsi5 1.252 0.121 10.313 0.000 1.000 1.000 .wad7 3.284 0.224 14.667 0.000 0.933 0.933 .wsi7 1.366 0.115 11.894 0.000 0.967 0.967 .wad10 3.132 0.276 11.361 0.000 0.946 0.946 .wsi10 1.741 0.153 11.390 0.000 0.974 0.974 .wad12 2.873 0.239 12.036 0.000 0.943 0.943 .wsi12 1.736 0.144 12.014 0.000 0.968 0.968 .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 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsit2.fit.summary)
RICLPMsit2.fit.summary.fit RICLPMsit2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsit2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMsit2.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMsit2.fit.summary.reg
lavTestLRT(RICLPMsit.fit, RICLPMsit2.fit, method = "satorra.bentler.2010")
RICLPMsit2 is significantly worse fit compared to RICLPMsit according to the Chi square test (p = 0.005094)
Comparison of fit statistics: Model2 Model Robust Comparative Fit Index (CFI) 0.985 0.993 (0.008) Robust Tucker-Lewis Index (TLI) 0.975 0.978 (0.003) Robust RMSEA 0.042 0.039 (0.003) SRMR 0.035 0.029 (0.006) All change in fit statistics is less than 0.01 - we can accept these constraints. Also the other significance levels are almost non-significant (chi square is likely inflated with large sample size) 2a p = 0.016 2b p = 0.1738 2c p = 0.4859 2d p = 0.065
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMsit2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit2a,
RICLPMsit2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsit.fit, RICLPMsit2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMsit3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
tadhde5 + tadhde7 + tadhde10 + tadhde12 ~ mad*1
sisoet5 + sisoet7 + sisoet10 + sisoet12 ~ msi*1
'
<- lavaan(RICLPMsit3,
RICLPMsit3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsit.fit, RICLPMsit3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMsit_hyp # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit_hyp, # model
RICLPMsit_hyp.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsit_hyp.fit,
RICLPMsit_hyp.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 54 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 37.624 23.919 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.004 Scaling correction factor 1.573 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3879.974 2114.195 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.835
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.993 0.993 Tucker-Lewis Index (TLI) 0.977 0.978
Robust Comparative Fit Index (CFI) 0.994 Robust Tucker-Lewis Index (TLI) 0.981
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -27366.252 -27366.252 Scaling correction factor 2.404 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.234 for the MLR correction
Akaike (AIC) 54802.505 54802.505 Bayesian (BIC) 55002.378 55002.378 Sample-size adjusted Bayesian (BIC) 54891.177 54891.177
Root Mean Square Error of Approximation:
RMSEA 0.038 0.027 90 Percent confidence interval - lower 0.026 0.017 90 Percent confidence interval - upper 0.051 0.038 P-value RMSEA <= 0.05 0.941 1.000
Robust RMSEA 0.034 90 Percent confidence interval - lower 0.018 90 Percent confidence interval - upper 0.051
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 =~
hye5 1.000 0.989 0.610 hye7 1.000 0.989 0.664 hye10 1.000 0.989 0.712 hye12 1.000 0.989 0.697 RIsi =~
sisoet5 1.000 0.608 0.483 sisoet7 1.000 0.608 0.465 sisoet10 1.000 0.608 0.415 sisoet12 1.000 0.608 0.410 wad5 =~
hye5 1.000 1.285 0.792 wad7 =~
hye7 1.000 1.114 0.748 wad10 =~
hye10 1.000 0.976 0.702 wad12 =~
hye12 1.000 1.018 0.717 wsi5 =~
sisoet5 1.000 1.101 0.875 wsi7 =~
sisoet7 1.000 1.157 0.885 wsi10 =~
sisoet10 1.000 1.334 0.910 wsi12 =~
sisoet12 1.000 1.353 0.912
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.227 0.033 6.815 0.000 0.262 0.262 wsi5 0.057 0.038 1.509 0.131 0.057 0.057 wsi7 ~
wad5 0.070 0.031 2.298 0.022 0.078 0.078 wsi5 0.093 0.064 1.450 0.147 0.089 0.089 wad10 ~
wad7 0.104 0.052 2.010 0.044 0.118 0.118 wsi7 0.036 0.036 1.007 0.314 0.043 0.043 wsi10 ~
wad7 0.169 0.053 3.167 0.002 0.141 0.141 wsi7 0.095 0.058 1.626 0.104 0.082 0.082 wad12 ~
wad10 0.253 0.064 3.946 0.000 0.242 0.242 wsi10 0.011 0.030 0.385 0.700 0.015 0.015 wsi12 ~
wad10 0.064 0.058 1.104 0.270 0.046 0.046 wsi10 0.215 0.045 4.737 0.000 0.212 0.212
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.270 0.061 4.428 0.000 0.191 0.191 .wad7 ~~
.wsi7 0.166 0.057 2.913 0.004 0.135 0.135 .wad10 ~~
.wsi10 0.287 0.063 4.544 0.000 0.226 0.226 .wad12 ~~
.wsi12 0.182 0.061 2.980 0.003 0.140 0.140 RIad ~~
RIsi 0.219 0.037 5.855 0.000 0.363 0.363
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.846 .hye7 1.092 0.032 33.964 0.000 1.092 0.733 .hye10 0.835 0.030 28.187 0.000 0.835 0.601 .hye12 0.779 0.031 25.506 0.000 0.779 0.549 .sisoet5 0.631 0.028 22.586 0.000 0.631 0.501 .sisoet7 0.651 0.029 22.219 0.000 0.651 0.498 .sisoet10 0.747 0.034 21.939 0.000 0.747 0.509 .sisoet12 0.781 0.036 21.936 0.000 0.781 0.527 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.979 0.068 14.378 0.000 1.000 1.000 RIsi 0.370 0.052 7.086 0.000 1.000 1.000 wad5 1.651 0.097 16.953 0.000 1.000 1.000 wsi5 1.213 0.126 9.626 0.000 1.000 1.000 .wad7 1.144 0.084 13.639 0.000 0.923 0.923 .wsi7 1.317 0.125 10.536 0.000 0.983 0.983 .wad10 0.936 0.097 9.647 0.000 0.983 0.983 .wsi10 1.727 0.150 11.511 0.000 0.970 0.970 .wad12 0.973 0.082 11.834 0.000 0.939 0.939 .wsi12 1.737 0.144 12.023 0.000 0.948 0.948 .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 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsit_hyp.fit.summary)
RICLPMsit_hyp.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsit_hyp.fit.summary, type = "RICLPM", constraints = "No") RICLPMsit_hyp.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMsit_hyp2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit_hyp2,
RICLPMsit_hyp2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsit_hyp2.fit,
RICLPMsit_hyp2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 43 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 85.390 47.184 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.810 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3879.974 2114.195 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.835
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.982 0.986 Tucker-Lewis Index (TLI) 0.971 0.976
Robust Comparative Fit Index (CFI) 0.986 Robust Tucker-Lewis Index (TLI) 0.977
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -27390.135 -27390.135 Scaling correction factor 1.929 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.234 for the MLR correction
Akaike (AIC) 54834.270 54834.270 Bayesian (BIC) 54988.458 54988.458 Sample-size adjusted Bayesian (BIC) 54902.675 54902.675
Root Mean Square Error of Approximation:
RMSEA 0.042 0.028 90 Percent confidence interval - lower 0.034 0.021 90 Percent confidence interval - upper 0.052 0.035 P-value RMSEA <= 0.05 0.910 1.000
Robust RMSEA 0.038 90 Percent confidence interval - lower 0.025 90 Percent confidence interval - upper 0.051
Standardized Root Mean Square Residual:
SRMR 0.033 0.033
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.972 0.604 hye7 1.000 0.972 0.651 hye10 1.000 0.972 0.684 hye12 1.000 0.972 0.695 RIsi =~
sisoet5 1.000 0.596 0.473 sisoet7 1.000 0.596 0.450 sisoet10 1.000 0.596 0.409 sisoet12 1.000 0.596 0.407 wad5 =~
hye5 1.000 1.284 0.797 wad7 =~
hye7 1.000 1.134 0.759 wad10 =~
hye10 1.000 1.038 0.730 wad12 =~
hye12 1.000 1.005 0.719 wsi5 =~
sisoet5 1.000 1.112 0.881 wsi7 =~
sisoet7 1.000 1.185 0.893 wsi10 =~
sisoet10 1.000 1.330 0.913 wsi12 =~
sisoet12 1.000 1.337 0.913
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.224 0.030 7.549 0.000 0.254 0.254 wsi5 (d) 0.023 0.020 1.154 0.248 0.023 0.023 wsi7 ~
wad5 (c) 0.094 0.026 3.561 0.000 0.102 0.102 wsi5 (b) 0.145 0.037 3.933 0.000 0.136 0.136 wad10 ~
wad7 (a) 0.224 0.030 7.549 0.000 0.245 0.245 wsi7 (d) 0.023 0.020 1.154 0.248 0.027 0.027 wsi10 ~
wad7 (c) 0.094 0.026 3.561 0.000 0.080 0.080 wsi7 (b) 0.145 0.037 3.933 0.000 0.129 0.129 wad12 ~
wad10 (a) 0.224 0.030 7.549 0.000 0.231 0.231 wsi10 (d) 0.023 0.020 1.154 0.248 0.031 0.031 wsi12 ~
wad10 (c) 0.094 0.026 3.561 0.000 0.073 0.073 wsi10 (b) 0.145 0.037 3.933 0.000 0.144 0.144
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.263 0.058 4.514 0.000 0.184 0.184 .wad7 ~~
.wsi7 0.161 0.054 2.956 0.003 0.126 0.126 .wad10 ~~
.wsi10 0.256 0.061 4.193 0.000 0.194 0.194 .wad12 ~~
.wsi12 0.182 0.059 3.071 0.002 0.142 0.142 RIad ~~
RIsi 0.226 0.036 6.353 0.000 0.390 0.390
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.851 .hye7 1.093 0.032 33.962 0.000 1.093 0.732 .hye10 0.835 0.030 28.152 0.000 0.835 0.587 .hye12 0.779 0.031 25.449 0.000 0.779 0.557 .sisoet5 0.631 0.028 22.501 0.000 0.631 0.500 .sisoet7 0.652 0.029 22.207 0.000 0.652 0.492 .sisoet10 0.745 0.034 21.996 0.000 0.745 0.511 .sisoet12 0.782 0.036 21.870 0.000 0.782 0.534 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.945 0.066 14.348 0.000 1.000 1.000 RIsi 0.356 0.052 6.791 0.000 1.000 1.000 wad5 1.649 0.098 16.864 0.000 1.000 1.000 wsi5 1.237 0.121 10.199 0.000 1.000 1.000 .wad7 1.199 0.080 15.024 0.000 0.933 0.933 .wsi7 1.356 0.115 11.782 0.000 0.966 0.966 .wad10 1.010 0.086 11.726 0.000 0.937 0.937 .wsi10 1.723 0.153 11.265 0.000 0.974 0.974 .wad12 0.953 0.075 12.617 0.000 0.942 0.942 .wsi12 1.734 0.145 11.920 0.000 0.969 0.969 .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 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsit_hyp2.fit.summary)
RICLPMsit_hyp2.fit.summary.fit RICLPMsit_hyp2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsit_hyp2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMsit_hyp2.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMsit_hyp2.fit.summary.reg
lavTestLRT(RICLPMsit_hyp.fit, RICLPMsit_hyp2.fit, method = "satorra.bentler.2010")
Comparison of fit statistics: Model2 Model Robust Comparative Fit Index (CFI) 0.985 0.993 (0.008) Robust Tucker-Lewis Index (TLI) 0.976 0.980 (0.004) Robust RMSEA 0.037 0.034 (0.003) SRMR 0.033 0.025 (0.008) All change in fit statistics is less than 0.01 - we can accept these constraints. Also the other significance levels are almost non-significant (chi square is likely inflated with large sample size) 2a p = 0.011 2b p = 0.140 2c p = 0.296 2d p = 0.205
We can accept the constrained RICLPMsit_hyp2
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMsit_hyp2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit_hyp2a,
RICLPMsit_hyp2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsit_hyp.fit, RICLPMsit_hyp2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMsit_hyp3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrainetd lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
hye5 + hye7 + hye10 + hye12 ~ mad*1
sisoet5 + sisoet7 + sisoet10 + sisoet12 ~ msi*1
'
<- lavaan(RICLPMsit_hyp3,
RICLPMsit_hyp3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsit_hyp.fit, RICLPMsit_hyp3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrainetd to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMsit_inat # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit_inat, # model
RICLPMsit_inat.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsit_inat.fit,
RICLPMsit_inat.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 142 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 36.035 19.854 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.019 Scaling correction factor 1.815 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3819.728 1859.380 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.054
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.993 0.994 Tucker-Lewis Index (TLI) 0.978 0.982
Robust Comparative Fit Index (CFI) 0.995 Robust Tucker-Lewis Index (TLI) 0.984
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26702.381 -26702.381 Scaling correction factor 2.637 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.469 for the MLR correction
Akaike (AIC) 53474.761 53474.761 Bayesian (BIC) 53674.634 53674.634 Sample-size adjusted Bayesian (BIC) 53563.433 53563.433
Root Mean Square Error of Approximation:
RMSEA 0.037 0.023 90 Percent confidence interval - lower 0.025 0.013 90 Percent confidence interval - upper 0.050 0.034 P-value RMSEA <= 0.05 0.955 1.000
Robust RMSEA 0.031 90 Percent confidence interval - lower 0.012 90 Percent confidence interval - upper 0.050
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.916 0.639 ine7 1.000 0.916 0.690 ine10 1.000 0.916 0.679 ine12 1.000 0.916 0.673 RIsi =~
sisoet5 1.000 0.603 0.477 sisoet7 1.000 0.603 0.460 sisoet10 1.000 0.603 0.412 sisoet12 1.000 0.603 0.409 wad5 =~
ine5 1.000 1.103 0.769 wad7 =~
ine7 1.000 0.960 0.723 wad10 =~
ine10 1.000 0.989 0.734 wad12 =~
ine12 1.000 1.006 0.740 wsi5 =~
sisoet5 1.000 1.111 0.879 wsi7 =~
sisoet7 1.000 1.164 0.888 wsi10 =~
sisoet10 1.000 1.335 0.911 wsi12 =~
sisoet12 1.000 1.347 0.913
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.140 0.047 2.954 0.003 0.161 0.161 wsi5 0.049 0.037 1.320 0.187 0.056 0.056 wsi7 ~
wad5 0.029 0.041 0.701 0.483 0.027 0.027 wsi5 0.116 0.062 1.865 0.062 0.111 0.111 wad10 ~
wad7 0.029 0.064 0.452 0.651 0.028 0.028 wsi7 0.013 0.038 0.355 0.723 0.016 0.016 wsi10 ~
wad7 0.104 0.068 1.531 0.126 0.075 0.075 wsi7 0.104 0.059 1.777 0.076 0.091 0.091 wad12 ~
wad10 0.252 0.057 4.417 0.000 0.248 0.248 wsi10 -0.020 0.034 -0.609 0.543 -0.027 -0.027 wsi12 ~
wad10 0.037 0.066 0.568 0.570 0.027 0.027 wsi10 0.212 0.046 4.635 0.000 0.211 0.211
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.277 0.065 4.280 0.000 0.226 0.226 .wad7 ~~
.wsi7 0.183 0.054 3.401 0.001 0.168 0.168 .wad10 ~~
.wsi10 0.345 0.076 4.541 0.000 0.264 0.264 .wad12 ~~
.wsi12 0.262 0.060 4.384 0.000 0.204 0.204 RIad ~~
RIsi 0.310 0.041 7.645 0.000 0.561 0.561
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.133 0.000 0.718 0.541 .ine10 0.725 0.029 25.062 0.000 0.725 0.538 .ine12 0.673 0.029 23.121 0.000 0.673 0.494 .sisoet5 0.626 0.028 22.699 0.000 0.626 0.495 .sisoet7 0.649 0.029 22.268 0.000 0.649 0.495 .sisoet10 0.751 0.034 21.927 0.000 0.751 0.513 .sisoet12 0.780 0.035 22.123 0.000 0.780 0.529 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.839 0.067 12.498 0.000 1.000 1.000 RIsi 0.364 0.052 6.957 0.000 1.000 1.000 wad5 1.216 0.096 12.702 0.000 1.000 1.000 wsi5 1.235 0.126 9.825 0.000 1.000 1.000 .wad7 0.890 0.076 11.692 0.000 0.967 0.967 .wsi7 1.335 0.125 10.711 0.000 0.986 0.986 .wad10 0.978 0.101 9.702 0.000 0.999 0.999 .wsi10 1.754 0.153 11.489 0.000 0.984 0.984 .wad12 0.954 0.080 11.963 0.000 0.941 0.941 .wsi12 1.727 0.141 12.215 0.000 0.952 0.952 .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 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsit_inat.fit.summary)
RICLPMsit_inat.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsit_inat.fit.summary, type = "RICLPM", constraints = "No") RICLPMsit_inat.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMsit_inat2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit_inat2,
RICLPMsit_inat2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsit_inat2.fit,
RICLPMsit_inat2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 51 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 39
Model Test User Model: Standard Robust Test Statistic 88.733 42.831 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.001 Scaling correction factor 2.072 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 3819.728 1859.380 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 2.054
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.981 0.986 Tucker-Lewis Index (TLI) 0.969 0.977
Robust Comparative Fit Index (CFI) 0.986 Robust Tucker-Lewis Index (TLI) 0.977
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -26728.730 -26728.730 Scaling correction factor 2.098 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.469 for the MLR correction
Akaike (AIC) 53511.459 53511.459 Bayesian (BIC) 53665.647 53665.647 Sample-size adjusted Bayesian (BIC) 53579.863 53579.863
Root Mean Square Error of Approximation:
RMSEA 0.043 0.026 90 Percent confidence interval - lower 0.035 0.019 90 Percent confidence interval - upper 0.053 0.033 P-value RMSEA <= 0.05 0.876 1.000
Robust RMSEA 0.038 90 Percent confidence interval - lower 0.024 90 Percent confidence interval - upper 0.052
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 =~
ine5 1.000 0.897 0.626 ine7 1.000 0.897 0.666 ine10 1.000 0.897 0.655 ine12 1.000 0.897 0.675 RIsi =~
sisoet5 1.000 0.592 0.468 sisoet7 1.000 0.592 0.446 sisoet10 1.000 0.592 0.404 sisoet12 1.000 0.592 0.405 wad5 =~
ine5 1.000 1.115 0.779 wad7 =~
ine7 1.000 1.003 0.746 wad10 =~
ine10 1.000 1.035 0.756 wad12 =~
ine12 1.000 0.980 0.738 wsi5 =~
sisoet5 1.000 1.118 0.884 wsi7 =~
sisoet7 1.000 1.187 0.895 wsi10 =~
sisoet10 1.000 1.339 0.915 wsi12 =~
sisoet12 1.000 1.336 0.914
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.182 0.035 5.161 0.000 0.203 0.203 wsi5 (d) 0.012 0.021 0.557 0.577 0.013 0.013 wsi7 ~
wad5 (c) 0.063 0.033 1.924 0.054 0.060 0.060 wsi5 (b) 0.153 0.036 4.233 0.000 0.144 0.144 wad10 ~
wad7 (a) 0.182 0.035 5.161 0.000 0.177 0.177 wsi7 (d) 0.012 0.021 0.557 0.577 0.014 0.014 wsi10 ~
wad7 (c) 0.063 0.033 1.924 0.054 0.048 0.048 wsi7 (b) 0.153 0.036 4.233 0.000 0.136 0.136 wad12 ~
wad10 (a) 0.182 0.035 5.161 0.000 0.192 0.192 wsi10 (d) 0.012 0.021 0.557 0.577 0.016 0.016 wsi12 ~
wad10 (c) 0.063 0.033 1.924 0.054 0.049 0.049 wsi10 (b) 0.153 0.036 4.233 0.000 0.153 0.153
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.274 0.060 4.598 0.000 0.220 0.220 .wad7 ~~
.wsi7 0.200 0.048 4.148 0.000 0.174 0.174 .wad10 ~~
.wsi10 0.346 0.072 4.819 0.000 0.256 0.256 .wad12 ~~
.wsi12 0.258 0.059 4.370 0.000 0.204 0.204 RIad ~~
RIsi 0.304 0.039 7.794 0.000 0.572 0.572
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.117 0.000 0.718 0.534 .ine10 0.725 0.029 25.039 0.000 0.725 0.529 .ine12 0.673 0.029 23.091 0.000 0.673 0.507 .sisoet5 0.626 0.028 22.655 0.000 0.626 0.495 .sisoet7 0.650 0.029 22.252 0.000 0.650 0.490 .sisoet10 0.750 0.034 21.977 0.000 0.750 0.512 .sisoet12 0.781 0.035 22.090 0.000 0.781 0.535 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.804 0.065 12.406 0.000 1.000 1.000 RIsi 0.350 0.053 6.655 0.000 1.000 1.000 wad5 1.244 0.094 13.241 0.000 1.000 1.000 wsi5 1.250 0.120 10.387 0.000 1.000 1.000 .wad7 0.963 0.069 14.000 0.000 0.958 0.958 .wsi7 1.369 0.115 11.921 0.000 0.972 0.972 .wad10 1.036 0.092 11.322 0.000 0.968 0.968 .wsi10 1.752 0.153 11.426 0.000 0.977 0.977 .wad12 0.924 0.076 12.151 0.000 0.961 0.961 .wsi12 1.730 0.143 12.080 0.000 0.970 0.970 .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 .sisoet5 0.000 0.000 0.000 .sisoet7 0.000 0.000 0.000 .sisoet10 0.000 0.000 0.000 .sisoet12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsit_inat2.fit.summary)
RICLPMsit_inat2.fit.summary.fit RICLPMsit_inat2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsit_inat2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMsit_inat2.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) RICLPMsit_inat2.fit.summary.reg
lavTestLRT(RICLPMsit_inat.fit, RICLPMsit_inat2.fit, method = "satorra.bentler.2010")
RICLPMsit_inat2 is significantly worse fit compared to RICLPMsit_inat. However, we should compare the model fit as all other RICLPMsit have been slightly different on the 2a lag.
Comparison of fit statistics: Model2 Model Robust Comparative Fit Index (CFI) 0.985 0.994 (0.009) Robust Tucker-Lewis Index (TLI) 0.976 0.983 (0.007) Robust RMSEA 0.037 0.025 (0.012) SRMR 0.032 0.031 (0.001) All change in fit statistics is less than 0.01 (apart form RMSEA) - we can accept these constraints. Also the other significance levels are almost non-significant (chi square is likely inflated with large sample size) 2a p = 0.007 2b p = 0.225 2c p = 0.731 2d p = 0.107
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMsit_inat2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsit_inat2a,
RICLPMsit_inat2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsit_inat.fit, RICLPMsit_inat2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMsit_inat3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoet5 + 1*sisoet7 + 1*sisoet10 + 1*sisoet12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoet5
wsi7 =~ 1*sisoet7
wsi10 =~ 1*sisoet10
wsi12 =~ 1*sisoet12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
ine5 + ine7 + ine10 + ine12 ~ mad*1
sisoet5 + sisoet7 + sisoet10 + sisoet12 ~ msi*1
'
<- lavaan(RICLPMsit_inat3,
RICLPMsit_inat3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsit_inat.fit, RICLPMsit_inat3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
<- '
CLPMsim # Estimate the lagged effects between the observed variables.
tadhde7 + sisoem7 ~ tadhde5 + sisoem5
tadhde10 + sisoem10 ~ tadhde7 + sisoem7
tadhde12 + sisoem12 ~ tadhde10 + sisoem10
# Estimate the covariance between the observed variables at the first wave.
tadhde5 ~~ sisoem5 # Covariance
# Estimate the covariances between the residuals of the observed variables.
tadhde7 ~~ sisoem7
tadhde10 ~~ sisoem10
tadhde12 ~~ sisoem12
# Estimate the (residual) variance of the observed variables.
tadhde5 ~~ tadhde5 # Variances
sisoem5 ~~ sisoem5
tadhde7 ~~ tadhde7 # Residual variances
sisoem7 ~~ sisoem7
tadhde10 ~~ tadhde10
sisoem10 ~~ sisoem10
tadhde12 ~~ tadhde12
sisoem12 ~~ sisoem12
'
<- lavaan(CLPMsim,
CLPMsim.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(CLPMsim.fit,
CLPMsim.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 35 iterations
Estimator ML Optimization method NLMINB Number of model parameters 32
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 445.757 245.908 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.813 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6310.850 3248.832 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.942
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.931 0.927 Tucker-Lewis Index (TLI) 0.839 0.831
Robust Comparative Fit Index (CFI) 0.932 Robust Tucker-Lewis Index (TLI) 0.842
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -33903.029 -33903.029 Scaling correction factor 2.304 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.170 for the MLR correction
Akaike (AIC) 67870.058 67870.058 Bayesian (BIC) 68052.799 68052.799 Sample-size adjusted Bayesian (BIC) 67951.130 67951.130
Root Mean Square Error of Approximation:
RMSEA 0.127 0.093 90 Percent confidence interval - lower 0.117 0.086 90 Percent confidence interval - upper 0.138 0.101 P-value RMSEA <= 0.05 0.000 0.000
Robust RMSEA 0.126 90 Percent confidence interval - lower 0.112 90 Percent confidence interval - upper 0.140
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 tadhde7 ~
tadhde5 0.543 0.027 20.435 0.000 0.543 0.578 sisoem5 0.081 0.042 1.932 0.053 0.081 0.045 sisoem7 ~
tadhde5 0.068 0.013 5.160 0.000 0.068 0.122 sisoem5 0.520 0.036 14.461 0.000 0.520 0.488 tadhde10 ~
tadhde7 0.518 0.030 17.282 0.000 0.518 0.542 sisoem7 0.111 0.046 2.423 0.015 0.111 0.069 sisoem10 ~
tadhde7 0.075 0.016 4.536 0.000 0.075 0.119 sisoem7 0.503 0.036 13.978 0.000 0.503 0.474 tadhde12 ~
tadhde10 0.648 0.033 19.477 0.000 0.648 0.630 sisoem10 0.067 0.039 1.736 0.083 0.067 0.043 sisoem12 ~
tadhde10 0.091 0.015 6.001 0.000 0.091 0.136 sisoem10 0.581 0.027 21.792 0.000 0.581 0.569
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhde5 ~~
sisoem5 1.198 0.134 8.959 0.000 1.198 0.301 .tadhde7 ~~
.sisoem7 0.532 0.083 6.414 0.000 0.532 0.197 .tadhde10 ~~
.sisoem10 0.550 0.091 6.039 0.000 0.550 0.194 .tadhde12 ~~
.sisoem12 0.534 0.092 5.811 0.000 0.534 0.211
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde7 0.513 0.059 8.648 0.000 0.513 0.197 .sisoem7 0.329 0.036 9.121 0.000 0.329 0.214 .tadhde10 0.514 0.052 9.937 0.000 0.514 0.207 .sisoem10 0.464 0.037 12.633 0.000 0.464 0.286 .tadhde12 0.367 0.050 7.383 0.000 0.367 0.144 .sisoem12 0.267 0.033 8.116 0.000 0.267 0.161 tadhde5 2.250 0.059 38.460 0.000 2.250 0.814 sisoem5 0.974 0.030 31.975 0.000 0.974 0.677
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 sisoem5 2.069 0.126 16.360 0.000 2.069 1.000 .tadhde7 4.367 0.238 18.357 0.000 4.367 0.648 .sisoem7 1.670 0.093 17.951 0.000 1.670 0.711 .tadhde10 4.180 0.264 15.834 0.000 4.180 0.678 .sisoem10 1.922 0.105 18.246 0.000 1.922 0.726 .tadhde12 3.816 0.277 13.798 0.000 3.816 0.584 .sisoem12 1.675 0.102 16.375 0.000 1.675 0.608
#Table of model fit
<- table.model.fit(CLPMsim.fit.summary)
CLPMsim.fit.summary.fit CLPMsim.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = CLPMsim.fit.summary, type = "CLPM", constraints = "No")
CLPMsim.fit.summary.reg %>% select(lhs, op, rhs, pvalue, std.all) %>% mutate_if(is.numeric, round, 3) CLPMsim.fit.summary.reg
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMsim # Create between components (rando intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim, # model
RICLPMsim.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsim.fit,
RICLPMsim.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 88 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 93.796 56.106 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.672 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 6310.850 3248.832 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.942
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.987 0.985 Tucker-Lewis Index (TLI) 0.958 0.954
Robust Comparative Fit Index (CFI) 0.987 Robust Tucker-Lewis Index (TLI) 0.961
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -33727.048 -33727.048 Scaling correction factor 2.298 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.170 for the MLR correction
Akaike (AIC) 67524.097 67524.097 Bayesian (BIC) 67723.970 67723.970 Sample-size adjusted Bayesian (BIC) 67612.769 67612.769
Root Mean Square Error of Approximation:
RMSEA 0.065 0.048 90 Percent confidence interval - lower 0.053 0.039 90 Percent confidence interval - upper 0.077 0.058 P-value RMSEA <= 0.05 0.017 0.589
Robust RMSEA 0.063 90 Percent confidence interval - lower 0.048 90 Percent confidence interval - upper 0.079
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 =~
tadhde5 1.000 1.790 0.644 tadhde7 1.000 1.790 0.700 tadhde10 1.000 1.790 0.717 tadhde12 1.000 1.790 0.705 RIsi =~
sisoem5 1.000 0.911 0.621 sisoem7 1.000 0.911 0.602 sisoem10 1.000 0.911 0.561 sisoem12 1.000 0.911 0.555 wad5 =~
tadhde5 1.000 2.127 0.765 wad7 =~
tadhde7 1.000 1.828 0.714 wad10 =~
tadhde10 1.000 1.740 0.697 wad12 =~
tadhde12 1.000 1.802 0.709 wsi5 =~
sisoem5 1.000 1.149 0.784 wsi7 =~
sisoem7 1.000 1.207 0.798 wsi10 =~
sisoem10 1.000 1.342 0.828 wsi12 =~
sisoem12 1.000 1.363 0.832
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.221 0.041 5.372 0.000 0.257 0.257 wsi5 -0.020 0.067 -0.304 0.761 -0.013 -0.013 wsi7 ~
wad5 0.041 0.021 1.905 0.057 0.072 0.072 wsi5 0.240 0.059 4.096 0.000 0.229 0.229 wad10 ~
wad7 0.096 0.063 1.519 0.129 0.100 0.100 wsi7 0.081 0.078 1.046 0.296 0.056 0.056 wsi10 ~
wad7 0.033 0.034 0.964 0.335 0.044 0.044 wsi7 0.268 0.061 4.397 0.000 0.241 0.241 wad12 ~
wad10 0.281 0.065 4.291 0.000 0.271 0.271 wsi10 0.032 0.063 0.516 0.606 0.024 0.024 wsi12 ~
wad10 0.052 0.031 1.651 0.099 0.066 0.066 wsi10 0.421 0.043 9.711 0.000 0.414 0.414
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.451 0.124 3.642 0.000 0.184 0.184 .wad7 ~~
.wsi7 0.340 0.102 3.320 0.001 0.165 0.165 .wad10 ~~
.wsi10 0.412 0.118 3.496 0.000 0.184 0.184 .wad12 ~~
.wsi12 0.411 0.090 4.559 0.000 0.193 0.193 RIad ~~
RIsi 0.808 0.101 7.996 0.000 0.496 0.496
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhde5 2.250 0.059 38.460 0.000 2.250 0.810 .tadhde7 1.813 0.055 32.730 0.000 1.813 0.709 .tadhde10 1.564 0.053 29.451 0.000 1.564 0.626 .tadhde12 1.453 0.055 26.667 0.000 1.453 0.572 .sisoem5 0.974 0.030 31.972 0.000 0.974 0.664 .sisoem7 0.987 0.033 30.134 0.000 0.987 0.653 .sisoem10 1.097 0.035 31.456 0.000 1.097 0.676 .sisoem12 1.048 0.036 29.457 0.000 1.048 0.639 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 3.203 0.236 13.598 0.000 1.000 1.000 RIsi 0.829 0.102 8.110 0.000 1.000 1.000 wad5 4.523 0.320 14.119 0.000 1.000 1.000 wsi5 1.321 0.128 10.309 0.000 1.000 1.000 .wad7 3.124 0.249 12.560 0.000 0.935 0.935 .wsi7 1.365 0.100 13.623 0.000 0.936 0.936 .wad10 2.983 0.319 9.358 0.000 0.985 0.985 .wsi10 1.686 0.113 14.907 0.000 0.936 0.936 .wad12 2.997 0.257 11.641 0.000 0.923 0.923 .wsi12 1.512 0.096 15.736 0.000 0.813 0.813 .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 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsim.fit.summary)
RICLPMsim.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsim.fit.summary, type = "RICLPM", constraints = "No") RICLPMsim.fit.summary.reg
<- '
RICLPMsim2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim2,
RICLPMsim2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim.fit, RICLPMsim2.fit, method = "satorra.bentler.2010")
RICLPMsim2 is significantly worse fit compared to RICLPMsim according to the Chi square test.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMsim2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim2a,
RICLPMsim2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim.fit, RICLPMsim2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMsim3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*tadhde5 + 1*tadhde7 + 1*tadhde10 + 1*tadhde12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*tadhde5
wad7 =~ 1*tadhde7
wad10 =~ 1*tadhde10
wad12 =~ 1*tadhde12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
tadhde5 + tadhde7 + tadhde10 + tadhde12 ~ mad*1
sisoem5 + sisoem7 + sisoem10 + sisoem12 ~ msi*1
'
<- lavaan(RICLPMsim3,
RICLPMsim3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim.fit, RICLPMsim3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMsim_hyp # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim_hyp, # model
RICLPMsim_hyp.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsim_hyp.fit,
RICLPMsim_hyp.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 70 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 80.917 50.672 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.597 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5863.459 3170.550 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.849
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.988 0.987 Tucker-Lewis Index (TLI) 0.962 0.959
Robust Comparative Fit Index (CFI) 0.989 Robust Tucker-Lewis Index (TLI) 0.964
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -29054.907 -29054.907 Scaling correction factor 2.183 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.063 for the MLR correction
Akaike (AIC) 58179.814 58179.814 Bayesian (BIC) 58379.687 58379.687 Sample-size adjusted Bayesian (BIC) 58268.487 58268.487
Root Mean Square Error of Approximation:
RMSEA 0.060 0.046 90 Percent confidence interval - lower 0.048 0.036 90 Percent confidence interval - upper 0.072 0.055 P-value RMSEA <= 0.05 0.080 0.760
Robust RMSEA 0.058 90 Percent confidence interval - lower 0.043 90 Percent confidence interval - upper 0.073
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.979 0.609 hye7 1.000 0.979 0.660 hye10 1.000 0.979 0.703 hye12 1.000 0.979 0.688 RIsi =~
sisoem5 1.000 0.920 0.627 sisoem7 1.000 0.920 0.609 sisoem10 1.000 0.920 0.566 sisoem12 1.000 0.920 0.559 wad5 =~
hye5 1.000 1.277 0.793 wad7 =~
hye7 1.000 1.115 0.751 wad10 =~
hye10 1.000 0.991 0.711 wad12 =~
hye12 1.000 1.032 0.725 wsi5 =~
sisoem5 1.000 1.142 0.779 wsi7 =~
sisoem7 1.000 1.197 0.793 wsi10 =~
sisoem10 1.000 1.338 0.824 wsi12 =~
sisoem12 1.000 1.363 0.829
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.234 0.035 6.678 0.000 0.268 0.268 wsi5 0.001 0.039 0.015 0.988 0.001 0.001 wsi7 ~
wad5 0.039 0.034 1.156 0.248 0.041 0.041 wsi5 0.237 0.059 4.022 0.000 0.226 0.226 wad10 ~
wad7 0.118 0.052 2.266 0.023 0.133 0.133 wsi7 0.032 0.045 0.721 0.471 0.039 0.039 wsi10 ~
wad7 0.030 0.051 0.592 0.554 0.025 0.025 wsi7 0.265 0.063 4.241 0.000 0.237 0.237 wad12 ~
wad10 0.281 0.063 4.490 0.000 0.270 0.270 wsi10 -0.005 0.033 -0.161 0.872 -0.007 -0.007 wsi12 ~
wad10 0.095 0.053 1.799 0.072 0.069 0.069 wsi10 0.419 0.043 9.801 0.000 0.412 0.412
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.156 0.062 2.509 0.012 0.107 0.107 .wad7 ~~
.wsi7 0.168 0.058 2.921 0.003 0.135 0.135 .wad10 ~~
.wsi10 0.237 0.065 3.640 0.000 0.186 0.186 .wad12 ~~
.wsi12 0.189 0.050 3.773 0.000 0.154 0.154 RIad ~~
RIsi 0.414 0.056 7.423 0.000 0.460 0.460
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .hye5 1.371 0.034 40.447 0.000 1.371 0.852 .hye7 1.093 0.032 33.966 0.000 1.093 0.736 .hye10 0.835 0.030 28.196 0.000 0.835 0.599 .hye12 0.779 0.031 25.503 0.000 0.779 0.547 .sisoem5 0.974 0.030 31.970 0.000 0.974 0.664 .sisoem7 0.987 0.033 30.130 0.000 0.987 0.654 .sisoem10 1.097 0.035 31.457 0.000 1.097 0.675 .sisoem12 1.048 0.036 29.466 0.000 1.048 0.637 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.959 0.068 14.213 0.000 1.000 1.000 RIsi 0.846 0.101 8.354 0.000 1.000 1.000 wad5 1.631 0.098 16.670 0.000 1.000 1.000 wsi5 1.303 0.125 10.418 0.000 1.000 1.000 .wad7 1.155 0.086 13.470 0.000 0.928 0.928 .wsi7 1.354 0.102 13.335 0.000 0.945 0.945 .wad10 0.962 0.096 10.064 0.000 0.979 0.979 .wsi10 1.686 0.114 14.735 0.000 0.941 0.941 .wad12 0.989 0.082 12.027 0.000 0.928 0.928 .wsi12 1.513 0.096 15.822 0.000 0.815 0.815 .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 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsim_hyp.fit.summary)
RICLPMsim_hyp.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsim_hyp.fit.summary, type = "RICLPM", constraints = "No") RICLPMsim_hyp.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMsim_hyp2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim_hyp2,
RICLPMsim_hyp2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim_hyp.fit, RICLPMsim_hyp2.fit, method = "satorra.bentler.2010")
RICLPMsim_hyp2 is significantly worse fit compared to RICLPMsim_hyp.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMsim_hyp2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim_hyp2a,
RICLPMsim_hyp2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim_hyp.fit, RICLPMsim_hyp2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMsim_hyp3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*hye5 + 1*hye7 + 1*hye10 + 1*hye12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*hye5
wad7 =~ 1*hye7
wad10 =~ 1*hye10
wad12 =~ 1*hye12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
hye5 + hye7 + hye10 + hye12 ~ mad*1
sisoem5 + sisoem7 + sisoem10 + sisoem12 ~ msi*1
'
<- lavaan(RICLPMsim_hyp3,
RICLPMsim_hyp3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim_hyp.fit, RICLPMsim_hyp3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
The code for specifying the basic RI-CLPM is given below.
<- '
RICLPMsim_inat # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Estimate the lagged effects between the within-person centered variables
wad7 + wsi7 ~ wad5 + wsi5
wad10 + wsi10 ~ wad7 + wsi7
wad12 + wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim_inat, # model
RICLPMsim_inat.fit data = dat, # data
missing = 'ML', # how to handle missing data
meanstructure = TRUE, # adds intercepts/means to the model for both observed and latent variables
se = "robust", # robust standard errors
int.ov.free = TRUE, # if FALSE, the intercepts of the observed variables are fixed to zero
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsim_inat.fit,
RICLPMsim_inat.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 68 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 92.080 54.319 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.695 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5661.390 2947.753 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.921
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.985 0.984 Tucker-Lewis Index (TLI) 0.954 0.952
Robust Comparative Fit Index (CFI) 0.986 Robust Tucker-Lewis Index (TLI) 0.957
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -28468.323 -28468.323 Scaling correction factor 2.336 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.205 for the MLR correction
Akaike (AIC) 57006.646 57006.646 Bayesian (BIC) 57206.519 57206.519 Sample-size adjusted Bayesian (BIC) 57095.318 57095.318
Root Mean Square Error of Approximation:
RMSEA 0.064 0.047 90 Percent confidence interval - lower 0.053 0.038 90 Percent confidence interval - upper 0.077 0.057 P-value RMSEA <= 0.05 0.021 0.652
Robust RMSEA 0.062 90 Percent confidence interval - lower 0.047 90 Percent confidence interval - upper 0.078
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 =~
ine5 1.000 0.905 0.634 ine7 1.000 0.905 0.683 ine10 1.000 0.905 0.669 ine12 1.000 0.905 0.666 RIsi =~
sisoem5 1.000 0.908 0.620 sisoem7 1.000 0.908 0.601 sisoem10 1.000 0.908 0.560 sisoem12 1.000 0.908 0.554 wad5 =~
ine5 1.000 1.104 0.773 wad7 =~
ine7 1.000 0.968 0.730 wad10 =~
ine10 1.000 1.005 0.743 wad12 =~
ine12 1.000 1.015 0.746 wsi5 =~
sisoem5 1.000 1.148 0.784 wsi7 =~
sisoem7 1.000 1.208 0.799 wsi10 =~
sisoem10 1.000 1.344 0.829 wsi12 =~
sisoem12 1.000 1.366 0.833
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 0.162 0.050 3.223 0.001 0.185 0.185 wsi5 -0.015 0.035 -0.429 0.668 -0.018 -0.018 wsi7 ~
wad5 0.091 0.043 2.122 0.034 0.083 0.083 wsi5 0.236 0.059 3.967 0.000 0.224 0.224 wad10 ~
wad7 0.045 0.063 0.716 0.474 0.044 0.044 wsi7 0.051 0.039 1.304 0.192 0.062 0.062 wsi10 ~
wad7 0.082 0.060 1.357 0.175 0.059 0.059 wsi7 0.268 0.061 4.404 0.000 0.241 0.241 wad12 ~
wad10 0.253 0.054 4.688 0.000 0.251 0.251 wsi10 0.039 0.031 1.271 0.204 0.052 0.052 wsi12 ~
wad10 0.068 0.051 1.338 0.181 0.050 0.050 wsi10 0.429 0.044 9.768 0.000 0.422 0.422
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.280 0.070 3.976 0.000 0.221 0.221 .wad7 ~~
.wsi7 0.167 0.054 3.094 0.002 0.150 0.150 .wad10 ~~
.wsi10 0.180 0.062 2.908 0.004 0.138 0.138 .wad12 ~~
.wsi12 0.232 0.048 4.800 0.000 0.192 0.192 RIad ~~
RIsi 0.397 0.050 7.986 0.000 0.483 0.483
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.877 0.030 29.074 0.000 0.877 0.614 .ine7 0.718 0.029 25.141 0.000 0.718 0.542 .ine10 0.725 0.029 25.048 0.000 0.725 0.536 .ine12 0.673 0.029 23.126 0.000 0.673 0.495 .sisoem5 0.974 0.030 31.973 0.000 0.974 0.665 .sisoem7 0.987 0.033 30.134 0.000 0.987 0.653 .sisoem10 1.097 0.035 31.456 0.000 1.097 0.676 .sisoem12 1.048 0.036 29.448 0.000 1.048 0.639 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.819 0.066 12.331 0.000 1.000 1.000 RIsi 0.825 0.102 8.088 0.000 1.000 1.000 wad5 1.218 0.098 12.448 0.000 1.000 1.000 wsi5 1.319 0.129 10.258 0.000 1.000 1.000 .wad7 0.906 0.079 11.497 0.000 0.967 0.967 .wsi7 1.365 0.100 13.633 0.000 0.935 0.935 .wad10 1.002 0.101 9.955 0.000 0.993 0.993 .wsi10 1.687 0.113 14.990 0.000 0.934 0.934 .wad12 0.958 0.079 12.119 0.000 0.930 0.930 .wsi12 1.518 0.097 15.582 0.000 0.813 0.813 .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 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsim_inat.fit.summary)
RICLPMsim_inat.fit.summary.fit #Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsim_inat.fit.summary, type = "RICLPM", constraints = "No") RICLPMsim_inat.fit.summary.reg
a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad
<- '
RICLPMsim_inat2 # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + d*wsi5
wsi7 ~ c*wad5 + b*wsi5
wad10 ~ a*wad7 + d*wsi7
wsi10 ~ c*wad7 + b*wsi7
wad12 ~ a*wad10 + d*wsi10
wsi12 ~ c*wad10 + b*wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim_inat2,
RICLPMsim_inat2.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
<- summary(RICLPMsim_inat2.fit,
RICLPMsim_inat2.fit.summary fit.measures = TRUE,
standardized = TRUE)
lavaan 0.6-10 ended normally after 43 iterations
Estimator ML Optimization method NLMINB Number of model parameters 35 Number of equality constraints 8
Number of observations 2232 Number of missing patterns 12
Model Test User Model: Standard Robust Test Statistic 155.511 83.816 Degrees of freedom 17 17 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.855 Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 5661.390 2947.753 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.921
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.975 0.977 Tucker-Lewis Index (TLI) 0.960 0.962
Robust Comparative Fit Index (CFI) 0.978 Robust Tucker-Lewis Index (TLI) 0.964
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -28500.039 -28500.039 Scaling correction factor 1.870 for the MLR correction
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 2.205 for the MLR correction
Akaike (AIC) 57054.077 57054.077 Bayesian (BIC) 57208.265 57208.265 Sample-size adjusted Bayesian (BIC) 57122.481 57122.481
Root Mean Square Error of Approximation:
RMSEA 0.060 0.042 90 Percent confidence interval - lower 0.052 0.036 90 Percent confidence interval - upper 0.069 0.049 P-value RMSEA <= 0.05 0.022 0.976
Robust RMSEA 0.057 90 Percent confidence interval - lower 0.045 90 Percent confidence interval - upper 0.070
Standardized Root Mean Square Residual:
SRMR 0.041 0.041
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.892 0.624 ine7 1.000 0.892 0.661 ine10 1.000 0.892 0.651 ine12 1.000 0.892 0.672 RIsi =~
sisoem5 1.000 0.857 0.582 sisoem7 1.000 0.857 0.552 sisoem10 1.000 0.857 0.523 sisoem12 1.000 0.857 0.540 wad5 =~
ine5 1.000 1.116 0.781 wad7 =~
ine7 1.000 1.012 0.750 wad10 =~
ine10 1.000 1.041 0.759 wad12 =~
ine12 1.000 0.982 0.740 wsi5 =~
sisoem5 1.000 1.198 0.813 wsi7 =~
sisoem7 1.000 1.294 0.834 wsi10 =~
sisoem10 1.000 1.398 0.852 wsi12 =~
sisoem12 1.000 1.335 0.841
Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~
wad5 (a) 0.189 0.036 5.220 0.000 0.208 0.208 wsi5 (d) 0.024 0.024 1.000 0.317 0.028 0.028 wsi7 ~
wad5 (c) 0.069 0.032 2.172 0.030 0.059 0.059 wsi5 (b) 0.364 0.046 7.983 0.000 0.337 0.337 wad10 ~
wad7 (a) 0.189 0.036 5.220 0.000 0.183 0.183 wsi7 (d) 0.024 0.024 1.000 0.317 0.030 0.030 wsi10 ~
wad7 (c) 0.069 0.032 2.172 0.030 0.050 0.050 wsi7 (b) 0.364 0.046 7.983 0.000 0.337 0.337 wad12 ~
wad10 (a) 0.189 0.036 5.220 0.000 0.200 0.200 wsi10 (d) 0.024 0.024 1.000 0.317 0.034 0.034 wsi12 ~
wad10 (c) 0.069 0.032 2.172 0.030 0.054 0.054 wsi10 (b) 0.364 0.046 7.983 0.000 0.381 0.381
Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~
wsi5 0.304 0.069 4.406 0.000 0.227 0.227 .wad7 ~~
.wsi7 0.187 0.050 3.722 0.000 0.156 0.156 .wad10 ~~
.wsi10 0.166 0.059 2.804 0.005 0.124 0.124 .wad12 ~~
.wsi12 0.217 0.048 4.523 0.000 0.184 0.184 RIad ~~
RIsi 0.394 0.051 7.680 0.000 0.515 0.515
Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .ine5 0.877 0.030 29.074 0.000 0.877 0.614 .ine7 0.719 0.029 25.126 0.000 0.719 0.533 .ine10 0.725 0.029 25.026 0.000 0.725 0.529 .ine12 0.673 0.029 23.090 0.000 0.673 0.507 .sisoem5 0.974 0.030 31.978 0.000 0.974 0.661 .sisoem7 0.987 0.033 30.131 0.000 0.987 0.636 .sisoem10 1.097 0.035 31.427 0.000 1.097 0.669 .sisoem12 1.048 0.036 29.433 0.000 1.048 0.661 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000
Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 0.795 0.065 12.271 0.000 1.000 1.000 RIsi 0.735 0.103 7.133 0.000 1.000 1.000 wad5 1.246 0.095 13.137 0.000 1.000 1.000 wsi5 1.436 0.127 11.305 0.000 1.000 1.000 .wad7 0.976 0.071 13.752 0.000 0.953 0.953 .wsi7 1.464 0.098 14.979 0.000 0.874 0.874 .wad10 1.044 0.092 11.339 0.000 0.964 0.964 .wsi10 1.715 0.116 14.726 0.000 0.878 0.878 .wad12 0.924 0.076 12.187 0.000 0.957 0.957 .wsi12 1.508 0.099 15.185 0.000 0.846 0.846 .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 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000
#Table of model fit
<- table.model.fit(RICLPMsim_inat2.fit.summary)
RICLPMsim_inat2.fit.summary.fit RICLPMsim_inat2.fit.summary.fit
#Table of regression coefficients and covariances (concurrent associations)
<- table.model.coef(model = RICLPMsim_inat2.fit.summary, type = "RICLPM", constraints = "Yes")
RICLPMsim_inat2.fit.summary.reg RICLPMsim_inat2.fit.summary.reg
lavTestLRT(RICLPMsim_inat.fit, RICLPMsim_inat2.fit, method = "satorra.bentler.2010")
RICLPMsim_inat2 is significantly worse fit compared to RICLPMsim_inat.
Now we will test the constraints based on the following steps recommended by Curran and Bauer: 1. Estimate the baseline model where all parameters are freely estimated (The basic RI-CLPM) 2. Impose equlaity constraints on one set of stabilities (within variable lags). Use LRT tests to see if he fit becomes significantly worse. 3. Impose equality constraints on the next set of stabilities. Compare this to wither model 1 (baseline/basic) if step 2 was significant. Compare to model 2 if step 2 was non-significant. Non-sig LRT = not significantly worse fit 4. Repeat for first set of cross-lags 5. Repeat for second set of cross-lags
<- '
RICLPMsim_inat2a # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ a*wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ a*wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ a*wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables.
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
'
<- lavaan(RICLPMsim_inat2a,
RICLPMsim_inat2a.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim_inat.fit, RICLPMsim_inat2a.fit, method = "satorra.bentler.2010")
The grand means are the means over all units per occasion. These grand means may be time-varying, or may be fixed to be invariant over time.
<- '
RICLPMsim_inat3 # Create between components (random intercepts treated as factors here)
RIad =~ 1*ine5 + 1*ine7 + 1*ine10 + 1*ine12 #x
RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y
# Create within-person centered variables
wad5 =~ 1*ine5
wad7 =~ 1*ine7
wad10 =~ 1*ine10
wad12 =~ 1*ine12
wsi5 =~ 1*sisoem5
wsi7 =~ 1*sisoem7
wsi10 =~ 1*sisoem10
wsi12 =~ 1*sisoem12
# Constrained lagged effects between the within-person centered variables.
wad7 ~ wad5 + wsi5
wsi7 ~ wad5 + wsi5
wad10 ~ wad7 + wsi7
wsi10 ~ wad7 + wsi7
wad12 ~ wad10 + wsi10
wsi12 ~ wad10 + wsi10
# Estimate the covariance between the within-person centered variables at the first wave
wad5 ~~ wsi5 # Covariance
# Estimate the covariances between the residuals of the within-person centered variables (the innovations)
wad7 ~~ wsi7
wad10 ~~ wsi10
wad12 ~~ wsi12
# Estimate the variance and covariance of the random intercepts
RIad ~~ RIad
RIsi ~~ RIsi
RIad ~~ RIsi
# Estimate the (residual) variance of the within-person centered variables
wad5 ~~ wad5 # Variances
wsi5 ~~ wsi5
wad7 ~~ wad7 # Residual variances
wsi7 ~~ wsi7
wad10 ~~ wad10
wsi10 ~~ wsi10
wad12 ~~ wad12
wsi12 ~~ wsi12
# Constrain the grand means over time
ine5 + ine7 + ine10 + ine12 ~ mad*1
sisoem5 + sisoem7 + sisoem10 + sisoem12 ~ msi*1
'
<- lavaan(RICLPMsim_inat3,
RICLPMsim_inat3.fit data = dat,
missing = 'ML',
meanstructure = TRUE,
int.ov.free = TRUE,
se = "robust",
estimator = "MLR" #maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic
)
lavTestLRT(RICLPMsim_inat.fit, RICLPMsim_inat3.fit, method = "satorra.bentler.2010")
If the grand means cannot be constrained to be invariant over time, this implies that on average there is some change in this variable over time, which may reflect some occasion-specific effect, or a developmental trend. By allowing the means to freely vary over time, we account for such average changes over time.
This makes sense as we have shown variation in social isolation over time and other literature has shown variation in ADHD over time.
Work by Katherine N Thompson
katherine.n.thompson@kcl.ac.uk
Social isolation and ADHD at age 5