The present document includes the analytical steps to analyze the psychometric properties of the diary data collected with the Qualtrics platform (Qualtrics, Seattle, WA, USA) and pre-processed as shown in Supplementary Material S3, and to compute the corresponding aggregate scores.
Here, we remove all objects from the R global environment.
# removing all objets from the workspace
rm(list=ls())
The following R packages are used in this document (see References section):
# required packages
packages <- c("ggplot2","reshape2","psych","MVN","Rmisc","lavaan","lme4","MuMIn")
# generate packages references
knitr::write_bib(c(.packages(), packages),"packagesPsych.bib")
# # run to install missing packages
# xfun::pkg_attach2(packages, message = FALSE); rm(list=ls())
First, we read the daily diary diary
datasets pre-processed as shown in Supplementary
Material S3.
# loading data
load("DATI/diary_processed.RData")
# sample size
cat("diary:",nrow(diary),"responses from",nlevels(diary$ID),"participants")
## diary: 1084 responses from 135 participants
The considered scales among those included in the daily diaries are:
The 6 Workaholism WHLSM
items
adapted from the Italian version of the Dutch Work Addiction
Questionnaire (Balducci et al., 2017; Schaufeli et al., 2009).
The 4 Emotional Exhaustion EE
items
adapted from the Italian version of the Copenhagen Burnout Inventory ((Avanzi et al., 2013; Kristensen et al.,
2005)
the 3 Psychological Detachment PD
items adapted from the Italian version of the Recovery Experiences
Questionnaire ((Sonnentag & Fritz, 2007; Zito et al., 2013).
the 4 Sleep Disturbances SD
items
adapted from the Mini Sleep Questionnaire (Natale et al.,
2014)
As pre-registered here, the
construct validity of the considered scales is evaluated by conducting a
separate Multilevel Confirmatory Factor Analyses
(MCFAs) for each scale, following Kim et al 2016, and
using the lavaan
R package (Rosseel,
2012).
The following packages and functions are used to optimize the analyses:
library(lavaan); library(lme4); library(Rmisc)
item.desc()
item.desc <- function(data,vars,output="text",digits=2,multilevel=FALSE){ require(lme4); library(MVN)
res <- data.frame(item=NA,icc=NA)
for(i in 1:length(vars)){
# LMER with random effects only
m <- lmer(formula=gsub("d1",vars[i],"d1~(1|ID)"),data=data) # VAR_between / (VAR_between + VAR_within)
out <- round(as.data.frame(VarCorr(m))[1,4]/(as.data.frame(VarCorr(m))[1,4]+as.data.frame(VarCorr(m))[2,4]),digits)
# textual output or data.frame
if(output=="text"){cat(vars[i],"ICC =",out,"\n")
}else{ res <- rbind(res,cbind(item=vars[i],icc=out)) }}
if(output!="text"){ return(res) }
# plotting item scores distributions
mvn(data = data[,vars], univariatePlot = "histogram")[4]
# plotting cluster mean (.cm) and mean-centered (.mc) distributions
if(multilevel==TRUE){ wide <- data.frame(ID=data[!duplicated(data$ID),"ID"]) # creating wide form dataset
# computing and plotting cluster means (.cm)
for(Var in vars){ wide <- plyr::join(wide,summarySE(data,Var,"ID",na.rm=TRUE)[,c(1,3)],by="ID",type="left")} # mean scores
cat("\nPlotting distributions of cluster means, N =",nrow(na.omit(wide)))
colnames(wide)[2:ncol(wide)] <- paste(colnames(wide)[2:ncol(wide)],"cm",sep=".")
data <- plyr::join(data,wide,by="ID",type="left") # joining cluster means to the long-form dataset
mvn(data = wide[,paste(vars,"cm",sep=".")], univariatePlot = "histogram")[4]
# computing and plotting mean-centered (.mc) scores
for(Var in vars){ data[,paste(Var,"mc",sep=".")] <- data[,Var] - data[,paste(Var,"cm",sep=".")] }
cat("\nPlotting distributions of mean-centered scores, N =",nrow(na.omit(data[,paste(vars,"mc",sep=".")])))
mvn(data = data[,paste(vars,"mc",sep=".")], univariatePlot = "histogram")[4]}
}
computes items ICCs from a random-intercept model, and plots items scores distributions (histograms and qqplots)
corr.matrices()
corr.matrices <- function(data=data,text=TRUE,vars,cluster="ID"){ require(ggplot2); require(Rmisc); require(reshape2)
# computing cluster means (.cm)
wide <- data.frame(ID=data[!duplicated(data$ID),"ID"]) # creating wide form dataset
for(Var in vars){ wide <- plyr::join(wide,summarySE(data,Var,"ID",na.rm=TRUE)[,c(1,3)],by="ID",type="left") } # mean scores
colnames(wide)[2:ncol(wide)] <- paste(colnames(wide)[2:ncol(wide)],"cm",sep=".")
data <- plyr::join(data,wide,by="ID",type="left") # joining cluster means to the long-form dataset
# computing mean-centered (.mc) values
for(Var in vars){ data[,paste(Var,"mc",sep=".")] <- data[,Var] - data[,paste(Var,"cm",sep=".")] }
# selecting variables
vars.b <- paste(vars,"cm",sep=".") # between (.cm)
vars.w <- paste(vars,"mc",sep=".") # within (.mc)
# plotting matrix 1 (all scores as independent)
p1 <- ggplot(melt(cor(data[,vars],data[,vars],use="complete.obs",method="pearson")),aes(x=Var1, y=Var2, fill=value)) +
geom_tile() +
ggtitle(paste("Corr Matrix 1: all independent, N =",nrow(na.omit(data[,vars]))))+labs(x="",y="")+
scale_fill_gradient2(low="darkblue",high="#f03b20",mid="white",midpoint=0,limit = c(-1,1), space = "Lab",
name="Pearson\nCorrelation",guide="legend",breaks=round(seq(1,-1,length.out = 11),2),
minor_breaks=round(seq(1,-1,length.out = 11),2))
if(text==TRUE){ p1 <- p1 + geom_text(aes(x = Var1, y = Var2, label = round(value,2)),color="black",size=3.5)}
# Matrix 2 (cluster means)
p2 <- ggplot(melt(cor(wide[,vars.b],wide[,vars.b],use="complete.obs",method="pearson")),aes(x=Var1, y=Var2, fill=value)) +
geom_tile() +
ggtitle(paste("Corr Matrix 2: cluster means, N =",nrow(wide)))+labs(x="",y="")+
scale_fill_gradient2(low="darkblue",high="#f03b20",mid="white",midpoint=0,limit = c(-1,1), space = "Lab",
name="Pearson\nCorrelation",guide="legend",breaks=round(seq(1,-1,length.out = 11),2),
minor_breaks=round(seq(1,-1,length.out = 11),2))
if(text==TRUE){ p2 <- p2 + geom_text(aes(x = Var1, y = Var2, label = round(value,2)),color="black",size=3.5)}
# Matrix 3 (deviations from individual means)
p3 <- ggplot(data = melt(cor(data[,vars.w],data[,vars.w],use="complete.obs",method="pearson")),aes(x=Var1, y=Var2, fill=value)) +
geom_tile() +
ggtitle(paste("Corr Matrix 3: mean-centered, N =",nrow(na.omit(data[,vars.w]))))+labs(x="",y="")+
scale_fill_gradient2(low="darkblue",high="#f03b20",mid="white",midpoint=0,limit = c(-1,1), space = "Lab",
name="Pearson\nCorrelation",guide="legend",breaks=round(seq(1,-1,length.out = 11),2),
minor_breaks=round(seq(1,-1,length.out = 11),2))
if(text==TRUE){ p3 <- p3 + geom_text(aes(x = Var1, y = Var2, label = round(value,2)),color="black",size=3.5)}
return(list(p1,p2,p3))}
visualizes the correlation matrices computed from the whole data points (all treated as independent), from the average scores (between-individuals) and from the mean-centered scores (within-individual).
loadings()
#' @title Summarizing standardized loadings from a multilevel CFA model
#' @param model = multilevel CFA model.
#' @param st = Character indicating the standardization level of loadings: "st.all" or "st.lv".
loadings <- function(model=NA,st="st.all"){ require(lavaan)
if(st=="st.all"){ LOADs <- standardizedsolution(model)
} else if(st=="st.lv"){ LOADs <- standardizedsolution(model,type="st.lv")
} else{ LOADs <- parameterestimates(model) }
return(LOADs[LOADs$op=="=~",])}
Print the standardized factor loadings of an ordinary or a multilevel CFA model.
fit.ind()
fit.ind <- function(model=NA,from_summary=FALSE,type="multilevel",models.names=NA,
fits=c("npar","chisq","df","rmsea","cfi","srmr_within","srmr_between"),robust=FALSE,
infocrit=TRUE,digits=3){
require(lavaan); require(MuMIn)
# removing level-specific fit indices when model is "monolevel"
if(type=="monolevel"){
fits <- gsub("srmr_within","srmr",fits)
fits <- fits[fits!="srmr_between"] }
# robust fit indices
if(robust==TRUE){ fits <- gsub("rmsea","rmsea.robust",
gsub("cfi","cfi.robust",
gsub("chisq","chisq.scaled",
gsub("df","df.scaled",fits)))) }
# returning dataframe of models fit indices when more than one model is considered
if(from_summary==FALSE){
if(length(model)>1){
fit.indices <- fitmeasures(model[[1]])[fits]
for(i in 2:length(model)){
fit.indices <- rbind(fit.indices,fitmeasures(model[[i]])[fits]) }
if(infocrit==TRUE){
fit.indices <- cbind(fit.indices,
AICw=Weights(sapply(model,AIC)),BICw=Weights(sapply(model,BIC))) }
if(!is.na(models.names[1])){ row.names(fit.indices) <- models.names }
fit.indices <- round(as.data.frame(fit.indices),digits)
return(as.data.frame(fit.indices))
} else { return(fitmeasures(model)[fits]) }
} else { # in some cases the fit indices are available only from the model's summary
quiet <- function(fit) { # this was written by Alicia FRANCO MARTÍNEZ on the lavaan Google group
sink(tempfile())
on.exit(sink())
invisible(summary(fit, standardized = TRUE, fit.measures=TRUE)) }
sum <- quiet(model)
fit.indices <- sum$FIT[fits]
return(fit.indices)}}
Prints fit indices of one or more CFA models. According to the criteria proposed by Hu and Bentler (1999), we consider RMSEA ≤ .06, CFI ≥ .95, and SRMR ≤ .08 as indicative of adequate fit.
MCFArel()
MCFArel <- function(fit,level,items,item.labels){ require(lavaan)
if(level==1){
sl <- standardizedsolution(fit)[1:(nrow(standardizedSolution(fit))/2),] # pars within
} else if(level==2){
sl <- standardizedsolution(fit)[(nrow(standardizedSolution(fit))/2):nrow(standardizedsolution(fit)),] # pars between
} else { stop("Error: level can be either 1 or 2") }
sl <- sl$est.std[sl$op == "=~"][items] # standardized loadings of the selected items
names(sl) <- item.labels # item names
re <- 1 - sl^2 # residual variances of items
# composite reliability index
omega <- sum(sl)^2 / (sum(sl)^2 + sum(re))
return(round(omega,2))}
Computes level-specific indices of composite reliability from a MCFA model, i.e., McDonald omega using level-1 and level-2 standardized factor loadings, respectively (see Geldhof et al., 2014).
Both mono- and multi-factor structures are specified and compared for
the six state workaholism WHLSM
items by
assuming either a single WHLSM
dimension or a two-factor
model with the Working Excessively WE
and the Working
Compulsively WC
dimensions, respectively.
# selecting WHLSM items
(WHLSM <- paste("WHLSM",1:6,sep=""))
## [1] "WHLSM1" "WHLSM2" "WHLSM3" "WHLSM4" "WHLSM5" "WHLSM6"
# Working Compulsively
WC <- WHLSM[c(1,3,5)]
# Working Excessively
WE <- WHLSM[c(2,4,6)]
Here, we inspect the distribution and intraclass correlations (ICC)
of WHLSM
items. ICCs range from .44 to .57, indexing an
overall balance between inter- and intra-individual variability.
Overall, item scores show a rather skewed (items 3, 5,
5), partially skewed (items 2 and 4) or uniform distribution. A similar
scenario is shown by the cluster mean distributions (i.e., mean item
score for each participant), whereas mean-centered item scores are quite
normally distributed.
item.desc(diary,vars=c(WC,WE),multilevel=TRUE)
## WHLSM1 ICC = 0.48
## WHLSM3 ICC = 0.57
## WHLSM5 ICC = 0.57
## WHLSM2 ICC = 0.44
## WHLSM4 ICC = 0.51
## WHLSM6 ICC = 0.53
##
## Plotting distributions of cluster means, N = 135
##
## Plotting distributions of mean-centered scores, N = 914
## $<NA>
## NULL
# frequency of discrete responses for each item
for(Var in c(WC,WE)){
print(round(100*summary(as.factor(na.omit(diary[,Var])))/nrow(as.data.frame(na.omit(diary[,Var]))),2))}
## 1 2 3 4 5 6 7
## 16.30 14.99 14.99 13.79 13.89 14.00 12.04
## 1 2 3 4 5 6 7
## 24.95 16.30 12.25 10.72 11.93 11.27 12.58
## 1 2 3 4 5 6 7
## 38.07 15.21 8.32 10.18 7.55 10.07 10.61
## 1 2 3 4 5 6 7
## 16.74 16.85 13.02 18.05 14.22 13.24 7.88
## 1 2 3 4 5 6 7
## 18.82 15.97 13.24 18.82 14.22 10.07 8.86
## 1 2 3 4 5 6 7
## 29.21 18.05 13.24 12.91 10.72 10.18 5.69
Here, we inspect the correlations among the six WHLSM
items. We can note that all items are moderately to strongly
positively intercorrelated, with no clear distinction between
the two underlying dimensions at any level. As expected, correlations
among individual mean scores (Matrix 2) are stronger than correlations
between mean-centered scores (Matrix 3).
corr.matrices(data=diary,text=TRUE,vars=c(WC,WE),cluster="ID")
## [[1]]
##
## [[2]]
##
## [[3]]
Here, we conduct a multilevel confirmatory factor
analysis (MCFA) in compliance with Kim et al
(2016) to evaluate the validity of the hypothesized measurement
model for WHLSM
(i.e., assuming either one or two
correlated factors at both levels) and the cross-level
isomorphism of our WHLSM
measure.
Here, we specify a single-factor (global workaholism) and a
two-factor (working excessively and working compulsively) multilevel
model for WHLSM
items. Following Jack &
Jorgensen (2017), we specify three models assuming
config
ural, metric
, and scalar
invariance across clusters, for both models. Moreover, we fit all models
both considering the full sample (N = 135) and focusing on participants
that provided at least three responses (N = 127). In sum, we specify 2
(i.e., one- vs. two-factor) x 3 (i.e., configural, metric, and scalar
invariance) x 2 (i.e., full or restricted sample) models. Due to the
skewness of workaholism items, all models are fitted with the
MLR robust estimator, and robust fit indices are
inspected.
dat <- as.data.frame(na.omit(diary[,c("ID",WHLSM)])) # list-wise deletion
cat("WHLSM: fitting MCFA models on",nrow(dat),"observations from",nlevels(as.factor(as.character(dat$ID))),"participants")
## WHLSM: fitting MCFA models on 914 observations from 135 participants
All models converged normally without warnings. A number of
participants (7-to-18%) show no variability in one or more items.
Roughly acceptable fit indices are shown by the
config1
and the metric1
, but not by the
scalar1
invariance model. Standardized loadings between .51
and .93 are estimated by the former two models.
# Configural invariance across clusters (unconstrained model)
config1 <- cfa('level: 1
sWHLSM =~ WHLSM1 + WHLSM2 + WHLSM3 + WHLSM4 + WHLSM5 + WHLSM6
level: 2
tWHLSM =~ WHLSM1 + WHLSM2 + WHLSM3 + WHLSM4 + WHLSM5 + WHLSM6', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(config1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 33 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 30
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 91.210 63.674
## Degrees of freedom 18 18
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.432
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.958 0.957
## Tucker-Lewis Index (TLI) 0.930 0.928
##
## Robust Comparative Fit Index (CFI) 0.962
## Robust Tucker-Lewis Index (TLI) 0.937
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9641.797 -9641.797
## Scaling correction factor 1.643
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 19343.595 19343.595
## Bayesian (BIC) 19488.130 19488.130
## Sample-size adjusted Bayesian (SABIC) 19392.854 19392.854
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.067 0.053
## 90 Percent confidence interval - lower 0.053 0.041
## 90 Percent confidence interval - upper 0.081 0.065
## P-value H_0: RMSEA <= 0.050 0.020 0.333
## P-value H_0: RMSEA >= 0.080 0.058 0.000
##
## Robust RMSEA 0.063
## 90 Percent confidence interval - lower 0.047
## 90 Percent confidence interval - upper 0.080
## P-value H_0: Robust RMSEA <= 0.050 0.092
## P-value H_0: Robust RMSEA >= 0.080 0.052
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.029 0.029
## SRMR (between covariance matrix) 0.053 0.053
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM =~
## WHLSM1 1.118 0.063 17.651 0.000 1.118 0.762
## WHLSM2 0.964 0.073 13.235 0.000 0.964 0.672
## WHLSM3 0.932 0.073 12.696 0.000 0.932 0.658
## WHLSM4 0.747 0.078 9.589 0.000 0.747 0.549
## WHLSM5 0.732 0.091 8.062 0.000 0.732 0.512
## WHLSM6 0.825 0.072 11.416 0.000 0.825 0.615
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.905 0.094 9.671 0.000 0.905 0.420
## .WHLSM2 1.131 0.113 9.999 0.000 1.131 0.549
## .WHLSM3 1.136 0.099 11.508 0.000 1.136 0.567
## .WHLSM4 1.295 0.133 9.755 0.000 1.295 0.699
## .WHLSM5 1.505 0.161 9.372 0.000 1.505 0.738
## .WHLSM6 1.116 0.114 9.792 0.000 1.116 0.621
## sWHLSM 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM =~
## WHLSM1 1.135 0.113 10.024 0.000 1.135 0.810
## WHLSM2 1.195 0.093 12.792 0.000 1.195 0.930
## WHLSM3 1.140 0.155 7.366 0.000 1.140 0.716
## WHLSM4 1.009 0.120 8.410 0.000 1.009 0.730
## WHLSM5 1.260 0.130 9.706 0.000 1.260 0.769
## WHLSM6 1.343 0.102 13.120 0.000 1.343 0.938
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.866 0.131 29.459 0.000 3.866 2.759
## .WHLSM2 3.672 0.122 30.209 0.000 3.672 2.859
## .WHLSM3 3.567 0.147 24.287 0.000 3.567 2.239
## .WHLSM4 3.595 0.129 27.945 0.000 3.595 2.601
## .WHLSM5 3.099 0.150 20.605 0.000 3.099 1.890
## .WHLSM6 3.130 0.132 23.678 0.000 3.130 2.188
## tWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.676 0.173 3.909 0.000 0.676 0.344
## .WHLSM2 0.222 0.088 2.515 0.012 0.222 0.134
## .WHLSM3 1.237 0.307 4.026 0.000 1.237 0.488
## .WHLSM4 0.892 0.168 5.320 0.000 0.892 0.467
## .WHLSM5 1.101 0.232 4.741 0.000 1.101 0.409
## .WHLSM6 0.245 0.120 2.045 0.041 0.245 0.119
## tWHLSM 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1 <- cfa('level: 1
sWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
sWHLSM ~~ NA*sWHLSM + wWHLSM*sWHLSM
level: 2
tWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
tWHLSM ~~ NA*tWHLSM + bWHLSM*tWHLSM
## constrain between-level variances to == ICCs
bWHLSM == 1 - wWHLSM ', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(metric1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 30 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 32
## Number of equality constraints 7
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 113.739 80.642
## Degrees of freedom 23 23
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.410
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.948 0.946
## Tucker-Lewis Index (TLI) 0.932 0.929
##
## Robust Comparative Fit Index (CFI) 0.953
## Robust Tucker-Lewis Index (TLI) 0.938
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9653.062 -9653.062
## Scaling correction factor 1.332
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 19356.124 19356.124
## Bayesian (BIC) 19476.570 19476.570
## Sample-size adjusted Bayesian (SABIC) 19397.174 19397.174
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.066 0.052
## 90 Percent confidence interval - lower 0.054 0.042
## 90 Percent confidence interval - upper 0.078 0.063
## P-value H_0: RMSEA <= 0.050 0.015 0.337
## P-value H_0: RMSEA >= 0.080 0.027 0.000
##
## Robust RMSEA 0.062
## 90 Percent confidence interval - lower 0.048
## 90 Percent confidence interval - upper 0.077
## P-value H_0: Robust RMSEA <= 0.050 0.080
## P-value H_0: Robust RMSEA >= 0.080 0.025
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.031 0.031
## SRMR (between covariance matrix) 0.064 0.064
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM =~
## WHLSM1 (L1) 1.708 0.071 23.886 0.000 1.035 0.723
## WHLSM2 (L2) 1.546 0.073 21.249 0.000 0.938 0.659
## WHLSM3 (L3) 1.519 0.092 16.553 0.000 0.921 0.653
## WHLSM4 (L4) 1.249 0.093 13.363 0.000 0.757 0.555
## WHLSM5 (L5) 1.315 0.116 11.306 0.000 0.798 0.549
## WHLSM6 (L6) 1.495 0.087 17.156 0.000 0.906 0.658
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM (wWHL) 0.368 0.048 7.688 0.000 1.000 1.000
## .WHLSM1 0.978 0.096 10.199 0.000 0.978 0.477
## .WHLSM2 1.147 0.116 9.920 0.000 1.147 0.566
## .WHLSM3 1.140 0.101 11.332 0.000 1.140 0.573
## .WHLSM4 1.288 0.135 9.544 0.000 1.288 0.692
## .WHLSM5 1.475 0.160 9.240 0.000 1.475 0.699
## .WHLSM6 1.073 0.113 9.511 0.000 1.073 0.566
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM =~
## WHLSM1 (L1) 1.708 0.071 23.886 0.000 1.358 0.857
## WHLSM2 (L2) 1.546 0.073 21.249 0.000 1.230 0.934
## WHLSM3 (L3) 1.519 0.092 16.553 0.000 1.208 0.740
## WHLSM4 (L4) 1.249 0.093 13.363 0.000 0.993 0.726
## WHLSM5 (L5) 1.315 0.116 11.306 0.000 1.046 0.694
## WHLSM6 (L6) 1.495 0.087 17.156 0.000 1.189 0.898
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.866 0.132 29.233 0.000 3.866 2.440
## .WHLSM2 3.670 0.122 30.094 0.000 3.670 2.787
## .WHLSM3 3.565 0.147 24.175 0.000 3.565 2.186
## .WHLSM4 3.593 0.129 27.871 0.000 3.593 2.627
## .WHLSM5 3.097 0.150 20.600 0.000 3.097 2.053
## .WHLSM6 3.128 0.132 23.718 0.000 3.128 2.364
## tWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM (bWHL) 0.632 0.048 13.226 0.000 1.000 1.000
## .WHLSM1 0.666 0.173 3.860 0.000 0.666 0.265
## .WHLSM2 0.221 0.092 2.410 0.016 0.221 0.128
## .WHLSM3 1.202 0.288 4.168 0.000 1.202 0.452
## .WHLSM4 0.883 0.161 5.492 0.000 0.883 0.472
## .WHLSM5 1.181 0.210 5.619 0.000 1.181 0.519
## .WHLSM6 0.338 0.110 3.080 0.002 0.338 0.193
##
## Constraints:
## |Slack|
## bWHLSM - (1-wWHLSM) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1 <- cfa('level: 1
sWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
sWHLSM ~~ NA*sWHLSM + wWHLSM*sWHLSM
level: 2
tWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
tWHLSM ~~ NA*tWHLSM + bWHLSM*tWHLSM
## constrain between-level variances to == ICCs
bWHLSM == 1 - wWHLSM
## fixing level-2 residual variances to zero
WHLSM1 ~~ 0*WHLSM1
WHLSM2 ~~ 0*WHLSM2
WHLSM3 ~~ 0*WHLSM3
WHLSM4 ~~ 0*WHLSM4
WHLSM5 ~~ 0*WHLSM5
WHLSM6 ~~ 0*WHLSM6', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(scalar1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 26 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 26
## Number of equality constraints 7
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 1185.601 1645.199
## Degrees of freedom 29 29
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.721
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.335 0.000
## Tucker-Lewis Index (TLI) 0.312 -0.578
##
## Robust Comparative Fit Index (CFI) 0.323
## Robust Tucker-Lewis Index (TLI) 0.300
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -10188.993 -10188.993
## Scaling correction factor 2.084
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 20415.987 20415.987
## Bayesian (BIC) 20507.525 20507.525
## Sample-size adjusted Bayesian (SABIC) 20447.184 20447.184
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.209 0.247
## 90 Percent confidence interval - lower 0.199 0.235
## 90 Percent confidence interval - upper 0.219 0.259
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.210
## 90 Percent confidence interval - lower 0.201
## 90 Percent confidence interval - upper 0.218
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.115 0.115
## SRMR (between covariance matrix) 0.287 0.287
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM =~
## WHLSM1 (L1) 1.539 0.087 17.703 0.000 0.859 0.548
## WHLSM2 (L2) 1.470 0.083 17.649 0.000 0.821 0.553
## WHLSM3 (L3) 1.575 0.104 15.152 0.000 0.880 0.515
## WHLSM4 (L4) 1.241 0.111 11.187 0.000 0.693 0.425
## WHLSM5 (L5) 1.544 0.108 14.357 0.000 0.862 0.485
## WHLSM6 (L6) 1.565 0.086 18.248 0.000 0.874 0.595
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM (wWHL) 0.312 0.047 6.633 0.000 1.000 1.000
## .WHLSM1 1.725 0.186 9.277 0.000 1.725 0.700
## .WHLSM2 1.531 0.164 9.322 0.000 1.531 0.694
## .WHLSM3 2.139 0.263 8.131 0.000 2.139 0.734
## .WHLSM4 2.178 0.230 9.491 0.000 2.178 0.819
## .WHLSM5 2.413 0.236 10.214 0.000 2.413 0.764
## .WHLSM6 1.394 0.164 8.505 0.000 1.394 0.646
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM =~
## WHLSM1 (L1) 1.539 0.087 17.703 0.000 1.276 1.000
## WHLSM2 (L2) 1.470 0.083 17.649 0.000 1.220 1.000
## WHLSM3 (L3) 1.575 0.104 15.152 0.000 1.307 1.000
## WHLSM4 (L4) 1.241 0.111 11.187 0.000 1.030 1.000
## WHLSM5 (L5) 1.544 0.108 14.357 0.000 1.281 1.000
## WHLSM6 (L6) 1.565 0.086 18.248 0.000 1.298 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.858 0.132 29.184 0.000 3.858 3.023
## .WHLSM2 3.690 0.122 30.206 0.000 3.690 3.026
## .WHLSM3 3.543 0.149 23.743 0.000 3.543 2.711
## .WHLSM4 3.607 0.130 27.825 0.000 3.607 3.503
## .WHLSM5 3.083 0.155 19.842 0.000 3.083 2.407
## .WHLSM6 3.129 0.133 23.575 0.000 3.129 2.410
## tWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM (bWHL) 0.688 0.047 14.633 0.000 1.000 1.000
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bWHLSM - (1-wWHLSM) 0.000
All models converged normally without warnings. A number of
participants (7-to-18%) show no variability in one or more items.
Roughly acceptable fit indices are shown by the
config2
and the metric2
, but not by the
scalar2
invariance model (which also showed a
convergence problem). Standardized loadings between .51
and .93 are estimated by the former two models. Since the fit of the
metric2
is acceptable but unoptimal, we conduct an
inspection of the highest modification indices, based on which we
re-specify the model by relaxing the equality constraint for item
WHLSM1
(i.e., partial metric invariance
metric2
).
# configural
config2 <- cfa('level: 1
sWE =~ WHLSM1 + WHLSM3 + WHLSM5
sWC =~ WHLSM2 + WHLSM4 + WHLSM6
level: 2
tWE =~ WHLSM1 + WHLSM3 + WHLSM5
tWC =~ WHLSM2 + WHLSM4 + WHLSM6', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(config2, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 38 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 32
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 66.691 45.114
## Degrees of freedom 16 16
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.478
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.971 0.973
## Tucker-Lewis Index (TLI) 0.945 0.948
##
## Robust Comparative Fit Index (CFI) 0.975
## Robust Tucker-Lewis Index (TLI) 0.953
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9629.538 -9629.538
## Scaling correction factor 1.607
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 19323.076 19323.076
## Bayesian (BIC) 19477.247 19477.247
## Sample-size adjusted Bayesian (SABIC) 19375.619 19375.619
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.059 0.045
## 90 Percent confidence interval - lower 0.045 0.032
## 90 Percent confidence interval - upper 0.074 0.057
## P-value H_0: RMSEA <= 0.050 0.145 0.741
## P-value H_0: RMSEA >= 0.080 0.009 0.000
##
## Robust RMSEA 0.054
## 90 Percent confidence interval - lower 0.036
## 90 Percent confidence interval - upper 0.073
## P-value H_0: Robust RMSEA <= 0.050 0.326
## P-value H_0: Robust RMSEA >= 0.080 0.012
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.027 0.027
## SRMR (between covariance matrix) 0.042 0.042
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 1.140 0.064 17.702 0.000 1.140 0.776
## WHLSM3 0.946 0.073 12.920 0.000 0.946 0.669
## WHLSM5 0.728 0.093 7.859 0.000 0.728 0.510
## sWC =~
## WHLSM2 0.995 0.073 13.653 0.000 0.995 0.692
## WHLSM4 0.765 0.079 9.708 0.000 0.765 0.562
## WHLSM6 0.840 0.071 11.780 0.000 0.840 0.627
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.940 0.034 27.960 0.000 0.940 0.940
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.858 0.103 8.292 0.000 0.858 0.398
## .WHLSM3 1.106 0.103 10.728 0.000 1.106 0.553
## .WHLSM5 1.508 0.161 9.359 0.000 1.508 0.740
## .WHLSM2 1.077 0.116 9.250 0.000 1.077 0.521
## .WHLSM4 1.270 0.135 9.380 0.000 1.270 0.685
## .WHLSM6 1.090 0.116 9.395 0.000 1.090 0.607
## sWE 1.000 1.000 1.000
## sWC 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 1.218 0.100 12.200 0.000 1.218 0.871
## WHLSM3 1.266 0.131 9.665 0.000 1.266 0.790
## WHLSM5 1.324 0.118 11.206 0.000 1.324 0.805
## tWC =~
## WHLSM2 1.225 0.094 13.088 0.000 1.225 0.958
## WHLSM4 0.999 0.126 7.943 0.000 0.999 0.724
## WHLSM6 1.353 0.101 13.347 0.000 1.353 0.945
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.880 0.055 15.881 0.000 0.880 0.880
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.869 0.131 29.536 0.000 3.869 2.768
## .WHLSM3 3.569 0.147 24.294 0.000 3.569 2.229
## .WHLSM5 3.101 0.150 20.624 0.000 3.101 1.885
## .WHLSM2 3.673 0.121 30.277 0.000 3.673 2.873
## .WHLSM4 3.594 0.128 27.972 0.000 3.594 2.604
## .WHLSM6 3.128 0.132 23.637 0.000 3.128 2.185
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.471 0.113 4.149 0.000 0.471 0.241
## .WHLSM3 0.962 0.267 3.605 0.000 0.962 0.375
## .WHLSM5 0.954 0.195 4.883 0.000 0.954 0.352
## .WHLSM2 0.134 0.072 1.873 0.061 0.134 0.082
## .WHLSM4 0.907 0.177 5.114 0.000 0.907 0.476
## .WHLSM6 0.221 0.114 1.938 0.053 0.221 0.108
## tWE 1.000 1.000 1.000
## tWC 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric2 <- cfa('level: 1
sWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
sWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
sWE ~~ NA*sWE + wWE*sWE
sWC ~~ NA*sWC + wWC*sWC
level: 2
tWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
tWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
tWE ~~ NA*tWE + bWE*tWE
tWC ~~ NA*tWC + bWC*tWC
## constrain between-level variances to == ICCs
bWE == 1 - wWE
bWC == 1 - wWC', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(metric2, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 39 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 36
## Number of equality constraints 8
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 84.991 59.147
## Degrees of freedom 20 20
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.437
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.963 0.963
## Tucker-Lewis Index (TLI) 0.944 0.945
##
## Robust Comparative Fit Index (CFI) 0.967
## Robust Tucker-Lewis Index (TLI) 0.951
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9638.688 -9638.688
## Scaling correction factor 1.287
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 19333.376 19333.376
## Bayesian (BIC) 19468.275 19468.275
## Sample-size adjusted Bayesian (SABIC) 19379.351 19379.351
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.060 0.046
## 90 Percent confidence interval - lower 0.047 0.035
## 90 Percent confidence interval - upper 0.073 0.058
## P-value H_0: RMSEA <= 0.050 0.104 0.687
## P-value H_0: RMSEA >= 0.080 0.005 0.000
##
## Robust RMSEA 0.055
## 90 Percent confidence interval - lower 0.039
## 90 Percent confidence interval - upper 0.072
## P-value H_0: Robust RMSEA <= 0.050 0.269
## P-value H_0: Robust RMSEA >= 0.080 0.007
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.029 0.029
## SRMR (between covariance matrix) 0.074 0.074
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 (L1) 1.730 0.069 25.197 0.000 1.079 0.746
## WHLSM3 (L2) 1.546 0.094 16.424 0.000 0.964 0.678
## WHLSM5 (L3) 1.293 0.125 10.365 0.000 0.806 0.553
## sWC =~
## WHLSM2 (L4) 1.597 0.070 22.694 0.000 0.936 0.662
## WHLSM4 (L5) 1.286 0.095 13.530 0.000 0.754 0.555
## WHLSM6 (L6) 1.534 0.084 18.260 0.000 0.899 0.659
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.346 0.046 7.591 0.000 0.947 0.947
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE (wWE) 0.388 0.051 7.614 0.000 1.000 1.000
## sWC (wWC) 0.343 0.050 6.922 0.000 1.000 1.000
## .WHLSM1 0.925 0.099 9.318 0.000 0.925 0.443
## .WHLSM3 1.089 0.104 10.469 0.000 1.089 0.540
## .WHLSM5 1.471 0.160 9.187 0.000 1.471 0.694
## .WHLSM2 1.124 0.119 9.429 0.000 1.124 0.562
## .WHLSM4 1.275 0.136 9.357 0.000 1.275 0.692
## .WHLSM6 1.053 0.116 9.091 0.000 1.053 0.566
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 (L1) 1.730 0.069 25.197 0.000 1.353 0.912
## WHLSM3 (L2) 1.546 0.094 16.424 0.000 1.209 0.772
## WHLSM5 (L3) 1.293 0.125 10.365 0.000 1.011 0.680
## tWC =~
## WHLSM2 (L4) 1.597 0.070 22.694 0.000 1.294 0.980
## WHLSM4 (L5) 1.286 0.095 13.530 0.000 1.042 0.743
## WHLSM6 (L6) 1.534 0.084 18.260 0.000 1.243 0.911
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.544 0.061 8.935 0.000 0.858 0.858
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.866 0.132 29.386 0.000 3.866 2.606
## .WHLSM3 3.565 0.147 24.223 0.000 3.565 2.275
## .WHLSM5 3.097 0.150 20.633 0.000 3.097 2.082
## .WHLSM2 3.670 0.122 30.127 0.000 3.670 2.780
## .WHLSM4 3.591 0.129 27.848 0.000 3.591 2.559
## .WHLSM6 3.124 0.132 23.645 0.000 3.124 2.290
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE (bWE) 0.612 0.051 11.984 0.000 1.000 1.000
## tWC (bWC) 0.657 0.050 13.233 0.000 1.000 1.000
## .WHLSM1 0.369 0.104 3.556 0.000 0.369 0.168
## .WHLSM3 0.993 0.244 4.078 0.000 0.993 0.405
## .WHLSM5 1.191 0.213 5.590 0.000 1.191 0.538
## .WHLSM2 0.068 0.074 0.924 0.355 0.068 0.039
## .WHLSM4 0.882 0.172 5.141 0.000 0.882 0.448
## .WHLSM6 0.316 0.104 3.033 0.002 0.316 0.170
##
## Constraints:
## |Slack|
## bWE - (1-wWE) 0.000
## bWC - (1-wWC) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar2 <- cfa('level: 1
sWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
sWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
sWE ~~ NA*sWE + wWE*sWE
sWC ~~ NA*sWC + wWC*sWC
level: 2
tWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
tWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
tWE ~~NA*tWE + bWE*tWE
tWC ~~NA*tWC + bWC*tWC
## constrain between-level variances to == ICCs
bWE == 1 - wWE
bWC == 1 - wWC
WHLSM1 ~~ 0*WHLSM1
WHLSM2 ~~ 0*WHLSM2
WHLSM3 ~~ 0*WHLSM3
WHLSM4 ~~ 0*WHLSM4
WHLSM5 ~~ 0*WHLSM5
WHLSM6 ~~ 0*WHLSM6', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use lavInspect(fit, "cov.lv") to investigate.
summary(scalar2, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 27 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 30
## Number of equality constraints 8
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 845.668 988.189
## Degrees of freedom 26 26
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.856
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.529 0.092
## Tucker-Lewis Index (TLI) 0.456 -0.048
##
## Robust Comparative Fit Index (CFI) 0.521
## Robust Tucker-Lewis Index (TLI) 0.448
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -10019.027 -10019.027
## Scaling correction factor 1.761
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 20082.053 20082.053
## Bayesian (BIC) 20188.045 20188.045
## Sample-size adjusted Bayesian (SABIC) 20118.176 20118.176
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.186 0.201
## 90 Percent confidence interval - lower 0.175 0.190
## 90 Percent confidence interval - upper 0.197 0.213
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.186
## 90 Percent confidence interval - lower 0.176
## 90 Percent confidence interval - upper 0.196
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.093 0.093
## SRMR (between covariance matrix) 0.197 0.197
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 (L1) 1.566 0.085 18.326 0.000 0.804 0.535
## WHLSM3 (L2) 1.646 0.098 16.768 0.000 0.844 0.524
## WHLSM5 (L3) 1.542 0.116 13.309 0.000 0.791 0.456
## sWC =~
## WHLSM2 (L4) 1.544 0.072 21.381 0.000 0.836 0.587
## WHLSM4 (L5) 1.283 0.114 11.284 0.000 0.694 0.433
## WHLSM6 (L6) 1.591 0.082 19.364 0.000 0.861 0.598
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.336 0.045 7.408 0.000 1.210 1.210
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE (wWE) 0.263 0.047 5.640 0.000 1.000 1.000
## sWC (wWC) 0.293 0.050 5.911 0.000 1.000 1.000
## .WHLSM1 1.607 0.148 10.849 0.000 1.607 0.713
## .WHLSM3 1.884 0.215 8.745 0.000 1.884 0.726
## .WHLSM5 2.384 0.274 8.710 0.000 2.384 0.792
## .WHLSM2 1.332 0.135 9.900 0.000 1.332 0.656
## .WHLSM4 2.085 0.232 8.990 0.000 2.085 0.812
## .WHLSM6 1.329 0.146 9.091 0.000 1.329 0.642
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 (L1) 1.566 0.085 18.326 0.000 1.345 1.000
## WHLSM3 (L2) 1.646 0.098 16.768 0.000 1.413 1.000
## WHLSM5 (L3) 1.542 0.116 13.309 0.000 1.324 1.000
## tWC =~
## WHLSM2 (L4) 1.544 0.072 21.381 0.000 1.298 1.000
## WHLSM4 (L5) 1.283 0.114 11.284 0.000 1.079 1.000
## WHLSM6 (L6) 1.591 0.082 19.364 0.000 1.338 1.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.577 0.055 10.502 0.000 0.800 0.800
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.873 0.130 29.774 0.000 3.873 2.880
## .WHLSM3 3.558 0.149 23.934 0.000 3.558 2.519
## .WHLSM5 3.097 0.154 20.090 0.000 3.097 2.339
## .WHLSM2 3.677 0.122 30.161 0.000 3.677 2.833
## .WHLSM4 3.596 0.129 27.824 0.000 3.596 3.333
## .WHLSM6 3.115 0.133 23.355 0.000 3.115 2.329
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE (bWE) 0.737 0.047 15.795 0.000 1.000 1.000
## tWC (bWC) 0.707 0.050 14.268 0.000 1.000 1.000
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bWE - (1-wWE) 0.000
## bWC - (1-wWC) 0.000
# inspecting modification indices for testing partial invariance
modificationindices(metric2)[order(modificationindices(metric2)$mi,decreasing=TRUE),][1:4,]
# freeing WHLSM1 loadings in metric-invariance models based on modification indices
metric2.part <- cfa('level: 1
sWE =~ WHLSM1 + L2*WHLSM3 + L3*WHLSM5
sWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
sWE ~~ NA*sWE + wWE*sWE
sWC ~~ NA*sWC + wWC*sWC
level: 2
tWE =~ WHLSM1 + L2*WHLSM3 + L3*WHLSM5
tWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
tWE ~~ NA*tWE + bWE*tWE
tWC ~~ NA*tWC + bWC*tWC
## constrain between-level variances to == ICCs
bWE == 1 - wWE
bWC == 1 - wWC', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(metric2.part, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 43 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 36
## Number of equality constraints 7
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 76.790 52.607
## Degrees of freedom 19 19
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.460
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.967 0.968
## Tucker-Lewis Index (TLI) 0.948 0.950
##
## Robust Comparative Fit Index (CFI) 0.971
## Robust Tucker-Lewis Index (TLI) 0.955
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9634.587 -9634.587
## Scaling correction factor 1.315
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 19327.175 19327.175
## Bayesian (BIC) 19466.892 19466.892
## Sample-size adjusted Bayesian (SABIC) 19374.792 19374.792
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.058 0.044
## 90 Percent confidence interval - lower 0.045 0.032
## 90 Percent confidence interval - upper 0.071 0.056
## P-value H_0: RMSEA <= 0.050 0.160 0.787
## P-value H_0: RMSEA >= 0.080 0.003 0.000
##
## Robust RMSEA 0.053
## 90 Percent confidence interval - lower 0.036
## 90 Percent confidence interval - upper 0.071
## P-value H_0: Robust RMSEA <= 0.050 0.354
## P-value H_0: Robust RMSEA >= 0.080 0.005
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.028 0.028
## SRMR (between covariance matrix) 0.055 0.055
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 2.033 0.158 12.876 0.000 1.129 0.769
## WHLSM3 (L2) 1.655 0.092 18.005 0.000 0.919 0.656
## WHLSM5 (L3) 1.398 0.121 11.514 0.000 0.776 0.537
## sWC =~
## WHLSM2 (L4) 1.595 0.070 22.918 0.000 0.939 0.664
## WHLSM4 (L5) 1.284 0.095 13.550 0.000 0.755 0.556
## WHLSM6 (L6) 1.527 0.084 18.113 0.000 0.899 0.658
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.309 0.045 6.886 0.000 0.947 0.947
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE (wWE) 0.309 0.052 5.982 0.000 1.000 1.000
## sWC (wWC) 0.346 0.050 6.936 0.000 1.000 1.000
## .WHLSM1 0.881 0.102 8.667 0.000 0.881 0.408
## .WHLSM3 1.116 0.104 10.717 0.000 1.116 0.569
## .WHLSM5 1.487 0.159 9.339 0.000 1.487 0.712
## .WHLSM2 1.116 0.119 9.405 0.000 1.116 0.559
## .WHLSM4 1.274 0.136 9.400 0.000 1.274 0.691
## .WHLSM6 1.060 0.117 9.081 0.000 1.060 0.568
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 1.478 0.107 13.844 0.000 1.229 0.879
## WHLSM3 (L2) 1.655 0.092 18.005 0.000 1.376 0.823
## WHLSM5 (L3) 1.398 0.121 11.514 0.000 1.162 0.747
## tWC =~
## WHLSM2 (L4) 1.595 0.070 22.918 0.000 1.290 0.978
## WHLSM4 (L5) 1.284 0.095 13.550 0.000 1.038 0.742
## WHLSM6 (L6) 1.527 0.084 18.113 0.000 1.235 0.911
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.579 0.061 9.522 0.000 0.862 0.862
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.866 0.131 29.499 0.000 3.866 2.765
## .WHLSM3 3.567 0.147 24.203 0.000 3.567 2.133
## .WHLSM5 3.098 0.150 20.640 0.000 3.098 1.992
## .WHLSM2 3.671 0.122 30.198 0.000 3.671 2.783
## .WHLSM4 3.592 0.129 27.932 0.000 3.592 2.567
## .WHLSM6 3.125 0.132 23.702 0.000 3.125 2.306
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE (bWE) 0.691 0.052 13.403 0.000 1.000 1.000
## tWC (bWC) 0.654 0.050 13.101 0.000 1.000 1.000
## .WHLSM1 0.444 0.104 4.250 0.000 0.444 0.227
## .WHLSM3 0.904 0.257 3.522 0.000 0.904 0.323
## .WHLSM5 1.069 0.206 5.178 0.000 1.069 0.442
## .WHLSM2 0.076 0.072 1.057 0.291 0.076 0.044
## .WHLSM4 0.880 0.171 5.139 0.000 0.880 0.449
## .WHLSM6 0.312 0.105 2.977 0.003 0.312 0.170
##
## Constraints:
## |Slack|
## bWE - (1-wWE) 0.000
## bWC - (1-wWC) 0.000
# selecting participants with 3+ responses
whlsm <- character()
dat$ID <- as.factor(as.character(dat$ID))
for(ID in levels(dat$ID)){ if(nrow(dat[dat$ID==ID,])>=3){ whlsm <- c(whlsm,ID) }}
dat2 <- dat[dat$ID%in%whlsm,]
cat("WHLSM: fitting MCFA models on",nrow(dat2),"observations from",nlevels(as.factor(as.character(dat2$ID))),"participants")
## WHLSM: fitting MCFA models on 900 observations from 127 participants
Results are consistent with those obtained with the full sample.
# Configural invariance across clusters (unconstrained model)
config12 <- cfa('level: 1
sWHLSM =~ WHLSM1 + WHLSM2 + WHLSM3 + WHLSM4 + WHLSM5 + WHLSM6
level: 2
tWHLSM =~ WHLSM1 + WHLSM2 + WHLSM3 + WHLSM4 + WHLSM5 + WHLSM6', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S099 S123 S131
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S039 S049 S086 S131
## S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S007 S045 S049 S055
## S086 S088 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S037 S049 S088
## S090 S100 S101 S114
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S011 S017 S027 S028
## S039 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101 S105 S117
## S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S039 S049 S052
## S077 S081 S086 S088 S090 S092 S100 S101 S114 S125 S127 S131 S142
summary(config12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 33 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 30
##
## Number of observations 900
## Number of clusters [ID] 127
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 92.713 63.991
## Degrees of freedom 18 18
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.449
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1715.330 1063.687
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.613
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.956 0.956
## Tucker-Lewis Index (TLI) 0.926 0.926
##
## Robust Comparative Fit Index (CFI) 0.960
## Robust Tucker-Lewis Index (TLI) 0.933
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9480.543 -9480.543
## Scaling correction factor 1.624
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9434.187 -9434.187
## Scaling correction factor 1.558
## for the MLR correction
##
## Akaike (AIC) 19021.086 19021.086
## Bayesian (BIC) 19165.158 19165.158
## Sample-size adjusted Bayesian (SABIC) 19069.883 19069.883
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.068 0.053
## 90 Percent confidence interval - lower 0.055 0.042
## 90 Percent confidence interval - upper 0.082 0.065
## P-value H_0: RMSEA <= 0.050 0.014 0.304
## P-value H_0: RMSEA >= 0.080 0.079 0.000
##
## Robust RMSEA 0.064
## 90 Percent confidence interval - lower 0.048
## 90 Percent confidence interval - upper 0.082
## P-value H_0: Robust RMSEA <= 0.050 0.078
## P-value H_0: Robust RMSEA >= 0.080 0.067
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.029 0.029
## SRMR (between covariance matrix) 0.054 0.054
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM =~
## WHLSM1 1.108 0.064 17.436 0.000 1.108 0.758
## WHLSM2 0.964 0.073 13.129 0.000 0.964 0.672
## WHLSM3 0.919 0.074 12.502 0.000 0.919 0.653
## WHLSM4 0.746 0.079 9.464 0.000 0.746 0.547
## WHLSM5 0.720 0.091 7.903 0.000 0.720 0.505
## WHLSM6 0.821 0.073 11.306 0.000 0.821 0.613
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.910 0.094 9.653 0.000 0.910 0.426
## .WHLSM2 1.128 0.114 9.923 0.000 1.128 0.548
## .WHLSM3 1.134 0.099 11.463 0.000 1.134 0.573
## .WHLSM4 1.305 0.134 9.728 0.000 1.305 0.701
## .WHLSM5 1.512 0.162 9.326 0.000 1.512 0.745
## .WHLSM6 1.119 0.115 9.707 0.000 1.119 0.624
## sWHLSM 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM =~
## WHLSM1 1.114 0.115 9.690 0.000 1.114 0.806
## WHLSM2 1.178 0.091 12.899 0.000 1.178 0.932
## WHLSM3 1.190 0.142 8.400 0.000 1.190 0.747
## WHLSM4 0.976 0.120 8.111 0.000 0.976 0.717
## WHLSM5 1.229 0.135 9.092 0.000 1.229 0.755
## WHLSM6 1.332 0.102 13.107 0.000 1.332 0.938
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.846 0.133 29.007 0.000 3.846 2.784
## .WHLSM2 3.665 0.123 29.863 0.000 3.665 2.899
## .WHLSM3 3.577 0.150 23.787 0.000 3.577 2.245
## .WHLSM4 3.596 0.130 27.612 0.000 3.596 2.641
## .WHLSM5 3.064 0.153 20.026 0.000 3.064 1.882
## .WHLSM6 3.105 0.135 23.079 0.000 3.105 2.186
## tWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.669 0.175 3.825 0.000 0.669 0.350
## .WHLSM2 0.211 0.085 2.488 0.013 0.211 0.132
## .WHLSM3 1.122 0.274 4.103 0.000 1.122 0.442
## .WHLSM4 0.901 0.170 5.306 0.000 0.901 0.486
## .WHLSM5 1.140 0.241 4.728 0.000 1.140 0.430
## .WHLSM6 0.244 0.120 2.030 0.042 0.244 0.121
## tWHLSM 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric12 <- cfa('level: 1
sWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
sWHLSM ~~ NA*sWHLSM + wWHLSM*sWHLSM
level: 2
tWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
tWHLSM ~~ NA*tWHLSM + bWHLSM*tWHLSM
## constrain between-level variances to == ICCs
bWHLSM == 1 - wWHLSM ', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S099 S123 S131
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S039 S049 S086 S131
## S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S007 S045 S049 S055
## S086 S088 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S037 S049 S088
## S090 S100 S101 S114
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S011 S017 S027 S028
## S039 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101 S105 S117
## S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S039 S049 S052
## S077 S081 S086 S088 S090 S092 S100 S101 S114 S125 S127 S131 S142
summary(metric12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 31 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 32
## Number of equality constraints 7
##
## Number of observations 900
## Number of clusters [ID] 127
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 114.429 80.972
## Degrees of freedom 23 23
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.413
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1715.330 1063.687
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.613
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.946 0.944
## Tucker-Lewis Index (TLI) 0.929 0.927
##
## Robust Comparative Fit Index (CFI) 0.951
## Robust Tucker-Lewis Index (TLI) 0.936
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9491.401 -9491.401
## Scaling correction factor 1.322
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9434.187 -9434.187
## Scaling correction factor 1.558
## for the MLR correction
##
## Akaike (AIC) 19032.803 19032.803
## Bayesian (BIC) 19152.863 19152.863
## Sample-size adjusted Bayesian (SABIC) 19073.467 19073.467
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.066 0.053
## 90 Percent confidence interval - lower 0.055 0.043
## 90 Percent confidence interval - upper 0.079 0.064
## P-value H_0: RMSEA <= 0.050 0.012 0.307
## P-value H_0: RMSEA >= 0.080 0.036 0.000
##
## Robust RMSEA 0.063
## 90 Percent confidence interval - lower 0.048
## 90 Percent confidence interval - upper 0.078
## P-value H_0: Robust RMSEA <= 0.050 0.071
## P-value H_0: Robust RMSEA >= 0.080 0.031
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.032 0.032
## SRMR (between covariance matrix) 0.067 0.067
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM =~
## WHLSM1 (L1) 1.686 0.073 23.094 0.000 1.025 0.719
## WHLSM2 (L2) 1.534 0.072 21.294 0.000 0.933 0.657
## WHLSM3 (L3) 1.514 0.094 16.146 0.000 0.921 0.654
## WHLSM4 (L4) 1.234 0.095 13.036 0.000 0.750 0.550
## WHLSM5 (L5) 1.285 0.118 10.845 0.000 0.782 0.540
## WHLSM6 (L6) 1.485 0.088 16.812 0.000 0.903 0.657
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM (wWHL) 0.370 0.049 7.622 0.000 1.000 1.000
## .WHLSM1 0.983 0.097 10.152 0.000 0.983 0.483
## .WHLSM2 1.148 0.116 9.860 0.000 1.148 0.569
## .WHLSM3 1.131 0.100 11.283 0.000 1.131 0.572
## .WHLSM4 1.300 0.136 9.531 0.000 1.300 0.698
## .WHLSM5 1.482 0.161 9.209 0.000 1.482 0.708
## .WHLSM6 1.076 0.114 9.444 0.000 1.076 0.569
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM =~
## WHLSM1 (L1) 1.686 0.073 23.094 0.000 1.338 0.854
## WHLSM2 (L2) 1.534 0.072 21.294 0.000 1.218 0.937
## WHLSM3 (L3) 1.514 0.094 16.146 0.000 1.202 0.753
## WHLSM4 (L4) 1.234 0.095 13.036 0.000 0.980 0.721
## WHLSM5 (L5) 1.285 0.118 10.845 0.000 1.020 0.678
## WHLSM6 (L6) 1.485 0.088 16.812 0.000 1.179 0.898
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.845 0.133 28.841 0.000 3.845 2.454
## .WHLSM2 3.664 0.123 29.770 0.000 3.664 2.819
## .WHLSM3 3.576 0.151 23.749 0.000 3.576 2.242
## .WHLSM4 3.595 0.131 27.534 0.000 3.595 2.645
## .WHLSM5 3.063 0.153 20.025 0.000 3.063 2.036
## .WHLSM6 3.104 0.134 23.109 0.000 3.104 2.365
## tWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM (bWHL) 0.630 0.049 12.989 0.000 1.000 1.000
## .WHLSM1 0.663 0.175 3.786 0.000 0.663 0.270
## .WHLSM2 0.207 0.088 2.366 0.018 0.207 0.123
## .WHLSM3 1.101 0.252 4.364 0.000 1.101 0.433
## .WHLSM4 0.887 0.164 5.425 0.000 0.887 0.480
## .WHLSM5 1.222 0.216 5.655 0.000 1.222 0.540
## .WHLSM6 0.334 0.110 3.047 0.002 0.334 0.194
##
## Constraints:
## |Slack|
## bWHLSM - (1-wWHLSM) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar12 <- cfa('level: 1
sWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
sWHLSM ~~ NA*sWHLSM + wWHLSM*sWHLSM
level: 2
tWHLSM =~ L1*WHLSM1 + L2*WHLSM2 + L3*WHLSM3 + L4*WHLSM4 + L5*WHLSM5 + L6*WHLSM6
## free and label variances to define factor ICC
tWHLSM ~~ NA*tWHLSM + bWHLSM*tWHLSM
## constrain between-level variances to == ICCs
bWHLSM == 1 - wWHLSM
## fixing level-2 residual variances to zero
WHLSM1 ~~ 0*WHLSM1
WHLSM2 ~~ 0*WHLSM2
WHLSM3 ~~ 0*WHLSM3
WHLSM4 ~~ 0*WHLSM4
WHLSM5 ~~ 0*WHLSM5
WHLSM6 ~~ 0*WHLSM6', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S099 S123 S131
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S039 S049 S086 S131
## S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S007 S045 S049 S055
## S086 S088 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S037 S049 S088
## S090 S100 S101 S114
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S011 S017 S027 S028
## S039 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101 S105 S117
## S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S039 S049 S052
## S077 S081 S086 S088 S090 S092 S100 S101 S114 S125 S127 S131 S142
summary(scalar12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 23 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 26
## Number of equality constraints 7
##
## Number of observations 900
## Number of clusters [ID] 127
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 1171.138 1638.562
## Degrees of freedom 29 29
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.715
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1715.330 1063.687
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.613
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.322 0.000
## Tucker-Lewis Index (TLI) 0.299 -0.611
##
## Robust Comparative Fit Index (CFI) 0.310
## Robust Tucker-Lewis Index (TLI) 0.286
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -10019.756 -10019.756
## Scaling correction factor 2.080
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9434.187 -9434.187
## Scaling correction factor 1.558
## for the MLR correction
##
## Akaike (AIC) 20077.511 20077.511
## Bayesian (BIC) 20168.757 20168.757
## Sample-size adjusted Bayesian (SABIC) 20108.416 20108.416
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.209 0.248
## 90 Percent confidence interval - lower 0.199 0.236
## 90 Percent confidence interval - upper 0.220 0.261
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.210
## 90 Percent confidence interval - lower 0.201
## 90 Percent confidence interval - upper 0.219
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.114 0.114
## SRMR (between covariance matrix) 0.286 0.286
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM =~
## WHLSM1 (L1) 1.519 0.088 17.253 0.000 0.850 0.543
## WHLSM2 (L2) 1.454 0.084 17.399 0.000 0.813 0.549
## WHLSM3 (L3) 1.585 0.104 15.316 0.000 0.887 0.525
## WHLSM4 (L4) 1.222 0.112 10.910 0.000 0.683 0.419
## WHLSM5 (L5) 1.523 0.110 13.890 0.000 0.852 0.479
## WHLSM6 (L6) 1.552 0.087 17.846 0.000 0.868 0.592
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWHLSM (wWHL) 0.313 0.047 6.587 0.000 1.000 1.000
## .WHLSM1 1.723 0.185 9.314 0.000 1.723 0.705
## .WHLSM2 1.533 0.165 9.269 0.000 1.533 0.699
## .WHLSM3 2.065 0.254 8.114 0.000 2.065 0.724
## .WHLSM4 2.197 0.231 9.493 0.000 2.197 0.825
## .WHLSM5 2.436 0.239 10.208 0.000 2.436 0.771
## .WHLSM6 1.399 0.166 8.432 0.000 1.399 0.650
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM =~
## WHLSM1 (L1) 1.519 0.088 17.253 0.000 1.259 1.000
## WHLSM2 (L2) 1.454 0.084 17.399 0.000 1.206 1.000
## WHLSM3 (L3) 1.585 0.104 15.316 0.000 1.314 1.000
## WHLSM4 (L4) 1.222 0.112 10.910 0.000 1.013 1.000
## WHLSM5 (L5) 1.523 0.110 13.890 0.000 1.263 1.000
## WHLSM6 (L6) 1.552 0.087 17.846 0.000 1.287 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.843 0.134 28.723 0.000 3.843 3.051
## .WHLSM2 3.682 0.124 29.773 0.000 3.682 3.054
## .WHLSM3 3.540 0.152 23.239 0.000 3.540 2.693
## .WHLSM4 3.601 0.131 27.448 0.000 3.601 3.555
## .WHLSM5 3.062 0.157 19.464 0.000 3.062 2.425
## .WHLSM6 3.110 0.135 23.073 0.000 3.110 2.417
## tWHLSM 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWHLSM (bWHL) 0.687 0.047 14.478 0.000 1.000 1.000
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bWHLSM - (1-wWHLSM) 0.000
Results are consistent with those obtained with the full sample, with even better fit indices.
# configural
config22 <- cfa('level: 1
sWE =~ WHLSM1 + WHLSM3 + WHLSM5
sWC =~ WHLSM2 + WHLSM4 + WHLSM6
level: 2
tWE =~ WHLSM1 + WHLSM3 + WHLSM5
tWC =~ WHLSM2 + WHLSM4 + WHLSM6', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S099 S123 S131
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S007 S045 S049 S055
## S086 S088 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S011 S017 S027 S028
## S039 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101 S105 S117
## S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S039 S049 S086 S131
## S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S037 S049 S088
## S090 S100 S101 S114
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S039 S049 S052
## S077 S081 S086 S088 S090 S092 S100 S101 S114 S125 S127 S131 S142
summary(config22, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 36 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 32
##
## Number of observations 900
## Number of clusters [ID] 127
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 66.727 44.581
## Degrees of freedom 16 16
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.497
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1715.330 1063.687
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.613
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.970 0.972
## Tucker-Lewis Index (TLI) 0.944 0.948
##
## Robust Comparative Fit Index (CFI) 0.974
## Robust Tucker-Lewis Index (TLI) 0.952
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9467.550 -9467.550
## Scaling correction factor 1.589
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9434.187 -9434.187
## Scaling correction factor 1.558
## for the MLR correction
##
## Akaike (AIC) 18999.100 18999.100
## Bayesian (BIC) 19152.777 19152.777
## Sample-size adjusted Bayesian (SABIC) 19051.150 19051.150
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.059 0.045
## 90 Percent confidence interval - lower 0.045 0.032
## 90 Percent confidence interval - upper 0.074 0.057
## P-value H_0: RMSEA <= 0.050 0.135 0.743
## P-value H_0: RMSEA >= 0.080 0.011 0.000
##
## Robust RMSEA 0.055
## 90 Percent confidence interval - lower 0.036
## 90 Percent confidence interval - upper 0.074
## P-value H_0: Robust RMSEA <= 0.050 0.320
## P-value H_0: Robust RMSEA >= 0.080 0.014
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.028 0.028
## SRMR (between covariance matrix) 0.043 0.043
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 1.131 0.065 17.485 0.000 1.131 0.773
## WHLSM3 0.934 0.073 12.724 0.000 0.934 0.664
## WHLSM5 0.716 0.093 7.710 0.000 0.716 0.503
## sWC =~
## WHLSM2 0.995 0.073 13.580 0.000 0.995 0.693
## WHLSM4 0.763 0.080 9.575 0.000 0.763 0.559
## WHLSM6 0.836 0.072 11.672 0.000 0.836 0.625
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.940 0.034 27.421 0.000 0.940 0.940
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.863 0.104 8.270 0.000 0.863 0.403
## .WHLSM3 1.104 0.103 10.667 0.000 1.104 0.558
## .WHLSM5 1.514 0.163 9.307 0.000 1.514 0.747
## .WHLSM2 1.073 0.117 9.179 0.000 1.073 0.520
## .WHLSM4 1.280 0.137 9.368 0.000 1.280 0.687
## .WHLSM6 1.092 0.117 9.325 0.000 1.092 0.610
## sWE 1.000 1.000 1.000
## sWC 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 1.195 0.100 11.931 0.000 1.195 0.867
## WHLSM3 1.316 0.117 11.243 0.000 1.316 0.822
## WHLSM5 1.297 0.121 10.715 0.000 1.297 0.794
## tWC =~
## WHLSM2 1.210 0.092 13.185 0.000 1.210 0.961
## WHLSM4 0.966 0.127 7.631 0.000 0.966 0.710
## WHLSM6 1.342 0.102 13.200 0.000 1.342 0.944
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.874 0.058 15.177 0.000 0.874 0.874
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.849 0.132 29.087 0.000 3.849 2.795
## .WHLSM3 3.578 0.150 23.788 0.000 3.578 2.236
## .WHLSM5 3.065 0.153 20.029 0.000 3.065 1.875
## .WHLSM2 3.666 0.123 29.902 0.000 3.666 2.912
## .WHLSM4 3.596 0.130 27.639 0.000 3.596 2.644
## .WHLSM6 3.104 0.135 23.053 0.000 3.104 2.182
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.469 0.106 4.432 0.000 0.469 0.248
## .WHLSM3 0.831 0.221 3.761 0.000 0.831 0.324
## .WHLSM5 0.989 0.200 4.940 0.000 0.989 0.370
## .WHLSM2 0.120 0.068 1.773 0.076 0.120 0.076
## .WHLSM4 0.916 0.180 5.077 0.000 0.916 0.495
## .WHLSM6 0.220 0.115 1.918 0.055 0.220 0.109
## tWE 1.000 1.000 1.000
## tWC 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric22 <- cfa('level: 1
sWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
sWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
sWE ~~ NA*sWE + wWE*sWE
sWC ~~ NA*sWC + wWC*sWC
level: 2
tWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
tWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
tWE ~~ NA*tWE + bWE*tWE
tWC ~~ NA*tWC + bWC*tWC
## constrain between-level variances to == ICCs
bWE == 1 - wWE
bWC == 1 - wWC', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S099 S123 S131
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S007 S045 S049 S055
## S086 S088 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S011 S017 S027 S028
## S039 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101 S105 S117
## S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S039 S049 S086 S131
## S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S037 S049 S088
## S090 S100 S101 S114
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S039 S049 S052
## S077 S081 S086 S088 S090 S092 S100 S101 S114 S125 S127 S131 S142
summary(metric22, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 39 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 36
## Number of equality constraints 8
##
## Number of observations 900
## Number of clusters [ID] 127
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 85.857 59.656
## Degrees of freedom 20 20
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.439
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1715.330 1063.687
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.613
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.961 0.962
## Tucker-Lewis Index (TLI) 0.941 0.942
##
## Robust Comparative Fit Index (CFI) 0.966
## Robust Tucker-Lewis Index (TLI) 0.949
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9477.115 -9477.115
## Scaling correction factor 1.278
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9434.187 -9434.187
## Scaling correction factor 1.558
## for the MLR correction
##
## Akaike (AIC) 19010.231 19010.231
## Bayesian (BIC) 19144.698 19144.698
## Sample-size adjusted Bayesian (SABIC) 19055.774 19055.774
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.060 0.047
## 90 Percent confidence interval - lower 0.048 0.036
## 90 Percent confidence interval - upper 0.074 0.059
## P-value H_0: RMSEA <= 0.050 0.087 0.651
## P-value H_0: RMSEA >= 0.080 0.008 0.000
##
## Robust RMSEA 0.056
## 90 Percent confidence interval - lower 0.040
## 90 Percent confidence interval - upper 0.073
## P-value H_0: Robust RMSEA <= 0.050 0.244
## P-value H_0: Robust RMSEA >= 0.080 0.009
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.030 0.030
## SRMR (between covariance matrix) 0.075 0.075
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 (L1) 1.711 0.070 24.445 0.000 1.063 0.740
## WHLSM3 (L2) 1.549 0.096 16.146 0.000 0.963 0.679
## WHLSM5 (L3) 1.273 0.127 10.002 0.000 0.791 0.545
## sWC =~
## WHLSM2 (L4) 1.584 0.069 22.926 0.000 0.935 0.662
## WHLSM4 (L5) 1.268 0.096 13.227 0.000 0.749 0.551
## WHLSM6 (L6) 1.520 0.085 17.853 0.000 0.898 0.658
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.347 0.046 7.480 0.000 0.946 0.946
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE (wWE) 0.386 0.052 7.480 0.000 1.000 1.000
## sWC (wWC) 0.349 0.050 6.951 0.000 1.000 1.000
## .WHLSM1 0.934 0.100 9.327 0.000 0.934 0.453
## .WHLSM3 1.081 0.104 10.364 0.000 1.081 0.538
## .WHLSM5 1.477 0.161 9.148 0.000 1.477 0.703
## .WHLSM2 1.122 0.120 9.367 0.000 1.122 0.562
## .WHLSM4 1.286 0.138 9.345 0.000 1.286 0.697
## .WHLSM6 1.053 0.117 9.015 0.000 1.053 0.567
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 (L1) 1.711 0.070 24.445 0.000 1.340 0.910
## WHLSM3 (L2) 1.549 0.096 16.146 0.000 1.214 0.788
## WHLSM5 (L3) 1.273 0.127 10.002 0.000 0.997 0.671
## tWC =~
## WHLSM2 (L4) 1.584 0.069 22.926 0.000 1.279 0.984
## WHLSM4 (L5) 1.268 0.096 13.227 0.000 1.023 0.736
## WHLSM6 (L6) 1.520 0.085 17.853 0.000 1.227 0.908
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.540 0.063 8.629 0.000 0.855 0.855
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.847 0.133 28.934 0.000 3.847 2.612
## .WHLSM3 3.576 0.150 23.769 0.000 3.576 2.323
## .WHLSM5 3.063 0.153 20.038 0.000 3.063 2.062
## .WHLSM2 3.664 0.123 29.770 0.000 3.664 2.820
## .WHLSM4 3.594 0.131 27.535 0.000 3.594 2.584
## .WHLSM6 3.101 0.135 23.052 0.000 3.101 2.296
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE (bWE) 0.614 0.052 11.890 0.000 1.000 1.000
## tWC (bWC) 0.651 0.050 12.987 0.000 1.000 1.000
## .WHLSM1 0.373 0.097 3.867 0.000 0.373 0.172
## .WHLSM3 0.897 0.213 4.211 0.000 0.897 0.378
## .WHLSM5 1.213 0.212 5.718 0.000 1.213 0.550
## .WHLSM2 0.054 0.070 0.774 0.439 0.054 0.032
## .WHLSM4 0.888 0.175 5.074 0.000 0.888 0.459
## .WHLSM6 0.319 0.105 3.030 0.002 0.319 0.175
##
## Constraints:
## |Slack|
## bWE - (1-wWE) 0.000
## bWC - (1-wWC) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar22 <- cfa('level: 1
sWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
sWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
sWE ~~ NA*sWE + wWE*sWE
sWC ~~ NA*sWC + wWC*sWC
level: 2
tWE =~ L1*WHLSM1 + L2*WHLSM3 + L3*WHLSM5
tWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
tWE ~~NA*tWE + bWE*tWE
tWC ~~NA*tWC + bWC*tWC
## constrain between-level variances to == ICCs
bWE == 1 - wWE
bWC == 1 - wWC
WHLSM1 ~~ 0*WHLSM1
WHLSM2 ~~ 0*WHLSM2
WHLSM3 ~~ 0*WHLSM3
WHLSM4 ~~ 0*WHLSM4
WHLSM5 ~~ 0*WHLSM5
WHLSM6 ~~ 0*WHLSM6', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S099 S123 S131
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S007 S045 S049 S055
## S086 S088 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S011 S017 S027 S028
## S039 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101 S105 S117
## S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S039 S049 S086 S131
## S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S037 S049 S088
## S090 S100 S101 S114
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S008 S039 S049 S052
## S077 S081 S086 S088 S090 S092 S100 S101 S114 S125 S127 S131 S142
## Warning in lav_object_post_check(object): lavaan WARNING: covariance matrix of latent variables
## is not positive definite;
## use lavInspect(fit, "cov.lv") to investigate.
summary(scalar2, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 27 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 30
## Number of equality constraints 8
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 845.668 988.189
## Degrees of freedom 26 26
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.856
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.529 0.092
## Tucker-Lewis Index (TLI) 0.456 -0.048
##
## Robust Comparative Fit Index (CFI) 0.521
## Robust Tucker-Lewis Index (TLI) 0.448
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -10019.027 -10019.027
## Scaling correction factor 1.761
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 20082.053 20082.053
## Bayesian (BIC) 20188.045 20188.045
## Sample-size adjusted Bayesian (SABIC) 20118.176 20118.176
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.186 0.201
## 90 Percent confidence interval - lower 0.175 0.190
## 90 Percent confidence interval - upper 0.197 0.213
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.186
## 90 Percent confidence interval - lower 0.176
## 90 Percent confidence interval - upper 0.196
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.093 0.093
## SRMR (between covariance matrix) 0.197 0.197
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 (L1) 1.566 0.085 18.326 0.000 0.804 0.535
## WHLSM3 (L2) 1.646 0.098 16.768 0.000 0.844 0.524
## WHLSM5 (L3) 1.542 0.116 13.309 0.000 0.791 0.456
## sWC =~
## WHLSM2 (L4) 1.544 0.072 21.381 0.000 0.836 0.587
## WHLSM4 (L5) 1.283 0.114 11.284 0.000 0.694 0.433
## WHLSM6 (L6) 1.591 0.082 19.364 0.000 0.861 0.598
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.336 0.045 7.408 0.000 1.210 1.210
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE (wWE) 0.263 0.047 5.640 0.000 1.000 1.000
## sWC (wWC) 0.293 0.050 5.911 0.000 1.000 1.000
## .WHLSM1 1.607 0.148 10.849 0.000 1.607 0.713
## .WHLSM3 1.884 0.215 8.745 0.000 1.884 0.726
## .WHLSM5 2.384 0.274 8.710 0.000 2.384 0.792
## .WHLSM2 1.332 0.135 9.900 0.000 1.332 0.656
## .WHLSM4 2.085 0.232 8.990 0.000 2.085 0.812
## .WHLSM6 1.329 0.146 9.091 0.000 1.329 0.642
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 (L1) 1.566 0.085 18.326 0.000 1.345 1.000
## WHLSM3 (L2) 1.646 0.098 16.768 0.000 1.413 1.000
## WHLSM5 (L3) 1.542 0.116 13.309 0.000 1.324 1.000
## tWC =~
## WHLSM2 (L4) 1.544 0.072 21.381 0.000 1.298 1.000
## WHLSM4 (L5) 1.283 0.114 11.284 0.000 1.079 1.000
## WHLSM6 (L6) 1.591 0.082 19.364 0.000 1.338 1.000
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.577 0.055 10.502 0.000 0.800 0.800
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.873 0.130 29.774 0.000 3.873 2.880
## .WHLSM3 3.558 0.149 23.934 0.000 3.558 2.519
## .WHLSM5 3.097 0.154 20.090 0.000 3.097 2.339
## .WHLSM2 3.677 0.122 30.161 0.000 3.677 2.833
## .WHLSM4 3.596 0.129 27.824 0.000 3.596 3.333
## .WHLSM6 3.115 0.133 23.355 0.000 3.115 2.329
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE (bWE) 0.737 0.047 15.795 0.000 1.000 1.000
## tWC (bWC) 0.707 0.050 14.268 0.000 1.000 1.000
## .WHLSM1 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bWE - (1-wWE) 0.000
## bWC - (1-wWC) 0.000
# inspecting modification indices for testing partial invariance
modificationindices(metric22)[order(modificationindices(metric22)$mi,decreasing=TRUE),][1:4,]
# freeing WHLSM1 loadings in metric-invariance models based on modification indices
metric22.part <- cfa('level: 1
sWE =~ WHLSM1 + L2*WHLSM3 + L3*WHLSM5
sWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
sWE ~~ NA*sWE + wWE*sWE
sWC ~~ NA*sWC + wWC*sWC
level: 2
tWE =~ WHLSM1 + L2*WHLSM3 + L3*WHLSM5
tWC =~ L4*WHLSM2 + L5*WHLSM4 + L6*WHLSM6
## free and label variances to define factor ICC
tWE ~~ NA*tWE + bWE*tWE
tWC ~~ NA*tWC + bWC*tWC
## constrain between-level variances to == ICCs
bWE == 1 - wWE
bWC == 1 - wWC', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM1" has no variance within some clusters.
## The cluster ids with zero within variance are: S049 S055 S081 S086
## S095 S099 S123 S131 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM3" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S007 S045 S049
## S055 S086 S088 S095 S100 S101 S105 S123 S124 S125 S131 S138 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM5" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S011 S017 S027
## S028 S039 S042 S043 S044 S049 S052 S086 S088 S092 S098 S100 S101
## S105 S117 S125 S128 S131 S132 S142 S147
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM2" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S039 S042 S049
## S086 S095 S131 S142 S146
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM4" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S037 S042
## S049 S088 S090 S095 S100 S101 S114 S135
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "WHLSM6" has no variance within some clusters.
## The cluster ids with zero within variance are: S004 S008 S031 S039
## S042 S049 S052 S077 S081 S086 S088 S090 S092 S095 S100 S101 S114
## S125 S127 S131 S142
summary(metric22.part, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 43 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 36
## Number of equality constraints 7
##
## Number of observations 914
## Number of clusters [ID] 135
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 76.790 52.607
## Degrees of freedom 19 19
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.460
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1769.314 1089.302
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.624
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.967 0.968
## Tucker-Lewis Index (TLI) 0.948 0.950
##
## Robust Comparative Fit Index (CFI) 0.971
## Robust Tucker-Lewis Index (TLI) 0.955
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9634.587 -9634.587
## Scaling correction factor 1.315
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9596.193 -9596.193
## Scaling correction factor 1.564
## for the MLR correction
##
## Akaike (AIC) 19327.175 19327.175
## Bayesian (BIC) 19466.892 19466.892
## Sample-size adjusted Bayesian (SABIC) 19374.792 19374.792
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.058 0.044
## 90 Percent confidence interval - lower 0.045 0.032
## 90 Percent confidence interval - upper 0.071 0.056
## P-value H_0: RMSEA <= 0.050 0.160 0.787
## P-value H_0: RMSEA >= 0.080 0.003 0.000
##
## Robust RMSEA 0.053
## 90 Percent confidence interval - lower 0.036
## 90 Percent confidence interval - upper 0.071
## P-value H_0: Robust RMSEA <= 0.050 0.354
## P-value H_0: Robust RMSEA >= 0.080 0.005
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.028 0.028
## SRMR (between covariance matrix) 0.055 0.055
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE =~
## WHLSM1 2.033 0.158 12.876 0.000 1.129 0.769
## WHLSM3 (L2) 1.655 0.092 18.005 0.000 0.919 0.656
## WHLSM5 (L3) 1.398 0.121 11.514 0.000 0.776 0.537
## sWC =~
## WHLSM2 (L4) 1.595 0.070 22.918 0.000 0.939 0.664
## WHLSM4 (L5) 1.284 0.095 13.550 0.000 0.755 0.556
## WHLSM6 (L6) 1.527 0.084 18.113 0.000 0.899 0.658
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE ~~
## sWC 0.309 0.045 6.886 0.000 0.947 0.947
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 0.000 0.000 0.000
## .WHLSM3 0.000 0.000 0.000
## .WHLSM5 0.000 0.000 0.000
## .WHLSM2 0.000 0.000 0.000
## .WHLSM4 0.000 0.000 0.000
## .WHLSM6 0.000 0.000 0.000
## sWE 0.000 0.000 0.000
## sWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sWE (wWE) 0.309 0.052 5.982 0.000 1.000 1.000
## sWC (wWC) 0.346 0.050 6.936 0.000 1.000 1.000
## .WHLSM1 0.881 0.102 8.667 0.000 0.881 0.408
## .WHLSM3 1.116 0.104 10.717 0.000 1.116 0.569
## .WHLSM5 1.487 0.159 9.339 0.000 1.487 0.712
## .WHLSM2 1.116 0.119 9.405 0.000 1.116 0.559
## .WHLSM4 1.274 0.136 9.400 0.000 1.274 0.691
## .WHLSM6 1.060 0.117 9.081 0.000 1.060 0.568
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE =~
## WHLSM1 1.478 0.107 13.844 0.000 1.229 0.879
## WHLSM3 (L2) 1.655 0.092 18.005 0.000 1.376 0.823
## WHLSM5 (L3) 1.398 0.121 11.514 0.000 1.162 0.747
## tWC =~
## WHLSM2 (L4) 1.595 0.070 22.918 0.000 1.290 0.978
## WHLSM4 (L5) 1.284 0.095 13.550 0.000 1.038 0.742
## WHLSM6 (L6) 1.527 0.084 18.113 0.000 1.235 0.911
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE ~~
## tWC 0.579 0.061 9.522 0.000 0.862 0.862
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .WHLSM1 3.866 0.131 29.499 0.000 3.866 2.765
## .WHLSM3 3.567 0.147 24.203 0.000 3.567 2.133
## .WHLSM5 3.098 0.150 20.640 0.000 3.098 1.992
## .WHLSM2 3.671 0.122 30.198 0.000 3.671 2.783
## .WHLSM4 3.592 0.129 27.932 0.000 3.592 2.567
## .WHLSM6 3.125 0.132 23.702 0.000 3.125 2.306
## tWE 0.000 0.000 0.000
## tWC 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tWE (bWE) 0.691 0.052 13.403 0.000 1.000 1.000
## tWC (bWC) 0.654 0.050 13.101 0.000 1.000 1.000
## .WHLSM1 0.444 0.104 4.250 0.000 0.444 0.227
## .WHLSM3 0.904 0.257 3.522 0.000 0.904 0.323
## .WHLSM5 1.069 0.206 5.178 0.000 1.069 0.442
## .WHLSM2 0.076 0.072 1.057 0.291 0.076 0.044
## .WHLSM4 0.880 0.171 5.139 0.000 0.880 0.449
## .WHLSM6 0.312 0.105 2.977 0.003 0.312 0.170
##
## Constraints:
## |Slack|
## bWE - (1-wWE) 0.000
## bWC - (1-wWC) 0.000
Here, we inspect the model fit of the specified MCFA models. According to Hu and Bentler (1999), we consider RMSEA ≤ .06, CFI ≥ .95, and SRMR ≤ .08 as indicative of adequate fit. Robust RMSEA and CFI indices are considered accounting for the non-normality of workaholism item scores.
In the full sample, better fit is shown by
two-factor compared to one-factor solutions, with satisfactory
fit indices shown by the two-factor models assuming either
configural or metric invariance across clusters. While the
two-factor configural model showed overall better fit than the
corresponding metric model, the inspection of modification indices
suggested that relaxing the equality constraint for the first item
WHLSM1
substantially improves the model fit. Coherently,
the two-factor model assuming partial invariance across
levels shows improved fit and was selected as the most accurate
model describing workaholism items. In contrast, both models assuming
scalar invariance are rejected.
## compare fit (considering robust fit indices)
(fit <- fit.ind(model=c(config1,metric1,scalar1,config2,metric2,metric2.part,scalar2),
models.names=c("1F_config","1F_metric","1F_scalar","2F_config","2F_metric","2F_metricPartial","2F_scalar"),
robust=TRUE))
## Loading required package: MuMIn
write.csv2(fit,"RESULTS/Table1.csv") # saving table for the paper
The results obtained on the subsample of participants with at least 3 responses to workaholism items are highly similar to those obtained with the full sample.
## compare fit (considering robust fit indices)
(fit <- fit.ind(model=c(config12,metric12,scalar12,config22,metric22,metric22.part,scalar22),
models.names=c("1F_config","1F_metric","1F_scalar","2F_config","2F_metric","2F_metricPartial","2F_scalar"),
robust=TRUE))
Here, we inspect the standardized parameters estimated by the selected models assumin partial cross-level invariance.
standardizedsolution(metric2.part)
standardizedsolution(metric22.part)
Here, we inspect the ICC and the level-specific reliability based on
the selected MCFA model metric2.part
, considering
coefficients higher than .60 as signs of adequate reliability. We can
note that all measures show adequate reliability at both
levels, with higher estimates for the single-factor
measures.
# ICC
p <- parameterestimates(metric2.part)
p[p$label == "bWE",c("est","se")]
p[p$label == "bWC",c("est","se")]
# Level-specific reliability
data.frame(measure=c("Total score","Working Excessively","Working compulsively"),
omega_w=c(MCFArel(fit=metric2.part,level=1,items=1:6,item.labels=WHLSM),
MCFArel(fit=metric2.part,level=1,items=c(1,3,5),item.labels=WE),
MCFArel(fit=metric2.part,level=1,items=c(2,4,6),item.labels=WC)),
omega_b=c(MCFArel(fit=metric2.part,level=2,items=1:6,item.labels=WHLSM),
MCFArel(fit=metric2.part,level=2,items=c(1,3,5),item.labels=WE),
MCFArel(fit=metric2.part,level=2,items=c(2,4,6),item.labels=WC)))
Results are highly similar to those obtained with the full sample.
# ICC
p <- parameterestimates(metric22.part)
p[p$label == "bWE",c("est","se")]
p[p$label == "bWC",c("est","se")]
# Level-specific reliability
data.frame(measure=c("Total score","Working Excessively","Working compulsively"),
omega_w=c(MCFArel(fit=metric22.part,level=1,items=1:6,item.labels=WHLSM),
MCFArel(fit=metric22.part,level=1,items=c(1,3,5),item.labels=WE),
MCFArel(fit=metric22.part,level=1,items=c(2,4,6),item.labels=WC)),
omega_b=c(MCFArel(fit=metric22.part,level=2,items=1:6,item.labels=WHLSM),
MCFArel(fit=metric22.part,level=2,items=c(1,3,5),item.labels=WE),
MCFArel(fit=metric22.part,level=2,items=c(2,4,6),item.labels=WC)))
Only a single-factor model is specified for the four daily emotional
exhaustion EE
items.
# selecting EE items
(EE <- paste("EE",1:4,sep=""))
## [1] "EE1" "EE2" "EE3" "EE4"
Here, we inspect the distribution and intraclass correlations (ICC)
of EE
items. ICCs range from .44 to .57, indexing an
overall balance between inter- and intra-individual variability.
Overall, item scores show a rather skewed distribution,
with 3 items (i.e., EE2
, EE3
, and
EE4
) being positively skewed and one item EE1
being negatively skewed. A similar scenario is shown by the cluster mean
distributions (i.e., mean item score for each participant), whereas
mean-centered item scores are quite normally distributed.
item.desc(diary,vars=c(EE),multilevel=TRUE)
## EE1 ICC = 0.44
## EE2 ICC = 0.45
## EE3 ICC = 0.48
## EE4 ICC = 0.57
##
## Plotting distributions of cluster means, N = 134
##
## Plotting distributions of mean-centered scores, N = 919
## $<NA>
## NULL
Here, we inspect the correlations among the four EE
items. We can note that the items are moderately to strongly
positively intercorrelated, at both level. As expected,
correlations among individual mean scores (Matrix 2) are stronger than
correlations between mean-centered scores (Matrix 3). Item
EE1
shows the weakest correlations with the remaining
items, and we can note that it is the only item whose exclusion would
increase the Cronbach’s alpha level if the responses were treated as
independent observations. Consequently, below we conduct the analyses by
both including and excluding item EE1
.
corr.matrices(data=diary,text=TRUE,vars=c(EE),cluster="ID")
## [[1]]
##
## [[2]]
##
## [[3]]
# alpha for item dropped
a <- psych::alpha(diary[,EE])
round(a$total[1:2],2) # Cronbach's alpha
round(a$alpha.drop[,1:2],2) # alpha for item dropped
Here, we conduct a multilevel confirmatory factor
analysis (MCFA) in compliance with Kim et al
(2016) to evaluate the validity of the hypothesized measurement
model for EE
(i.e., assuming either one or two correlated
factors at both levels) and the cross-level isomorphism
of our EE
measure.
Here, we specify a single-factor multilevel model for EE
items. Following Jack & Jorgensen (2017), we
specify three models assuming config
ural,
metric
, and scalar
invariance across clusters,
respectively. As noted above, we also replicate the analysis by
excluding item EE1
. Moreover, we fit all models both
considering the full sample (N = 135) and focusing on participants that
provided at least three responses (N = 127). In sum, we specify 3 (i.e.,
configural, metric, and scalar invariance) x 2 (i.e., four-item
vs. three-item scale) x 2 (i.e., full or restricted sample) models. Due
to the skewness of EE
items, all models are fitted with the
MLR robust estimator.
dat <- as.data.frame(na.omit(diary[,c("ID",EE)])) # list-wise deletion
cat("EE: fitting MCFA models on",nrow(dat),"observations from",nlevels(as.factor(as.character(dat$ID))),"participants")
## EE: fitting MCFA models on 919 observations from 134 participants
All models converged normally without warnings, but the
metric1.3
model shows an improper solution
for item EE2
(i.e., Heywood case) at level 2. Since the
upper CI for such variance estimate is positive, we rule out the
possibility of structural misspecification and we handle the problem by
fixing its level-2 residual variance to the 15% of its total level-2
variance (see Joreskog & Sobrom (1996)). A number
of participants (3-to-12%) show no variability in one or more items.
Unsatisfactory fit is shown by any model, suggesting
unsatisfactory measurement properties for the 4-item 1-factor
solution.
# Configural invariance across clusters (unconstrained model)
config1.4 <- cfa('level: 1
sEE =~ EE1 + EE2 + EE3 + EE4
level: 2
tEE =~ EE1 + EE2 + EE3 + EE4', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051 S086
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
summary(config1.4, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 35 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 20
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 209.326 193.617
## Degrees of freedom 4 4
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.081
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1463.897 1027.642
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.425
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.859 0.813
## Tucker-Lewis Index (TLI) 0.576 0.440
##
## Robust Comparative Fit Index (CFI) 0.858
## Robust Tucker-Lewis Index (TLI) 0.575
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -5992.325 -5992.325
## Scaling correction factor 1.503
## for the MLR correction
## Loglikelihood unrestricted model (H1) -5887.662 -5887.662
## Scaling correction factor 1.433
## for the MLR correction
##
## Akaike (AIC) 12024.649 12024.649
## Bayesian (BIC) 12121.115 12121.115
## Sample-size adjusted Bayesian (SABIC) 12057.598 12057.598
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.236 0.227
## 90 Percent confidence interval - lower 0.210 0.201
## 90 Percent confidence interval - upper 0.264 0.254
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.236
## 90 Percent confidence interval - lower 0.208
## 90 Percent confidence interval - upper 0.265
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.084 0.084
## SRMR (between covariance matrix) 0.094 0.094
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE1 0.926 0.063 14.733 0.000 0.926 0.730
## EE2 1.155 0.073 15.755 0.000 1.155 0.861
## EE3 0.826 0.068 12.217 0.000 0.826 0.628
## EE4 0.648 0.078 8.348 0.000 0.648 0.546
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.753 0.069 10.871 0.000 0.753 0.467
## .EE2 0.464 0.091 5.115 0.000 0.464 0.258
## .EE3 1.045 0.103 10.115 0.000 1.045 0.605
## .EE4 0.990 0.097 10.241 0.000 0.990 0.702
## sEE 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE1 0.552 0.122 4.507 0.000 0.552 0.531
## EE2 1.040 0.098 10.574 0.000 1.040 0.884
## EE3 1.223 0.094 13.083 0.000 1.223 0.964
## EE4 1.276 0.107 11.902 0.000 1.276 0.932
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 4.679 0.106 44.267 0.000 4.679 4.503
## .EE2 3.704 0.115 32.179 0.000 3.704 3.151
## .EE3 3.297 0.119 27.782 0.000 3.297 2.598
## .EE4 2.849 0.125 22.744 0.000 2.849 2.082
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.775 0.127 6.090 0.000 0.775 0.718
## .EE2 0.301 0.081 3.708 0.000 0.301 0.218
## .EE3 0.114 0.082 1.393 0.164 0.114 0.071
## .EE4 0.245 0.093 2.649 0.008 0.245 0.131
## tEE 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1.4 <- cfa('level: 1
sEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE ', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051 S086
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated ov
## variances are negative
parameterestimates(metric1.4)[parameterestimates(metric1.4)$op=="~~" & parameterestimates(metric1.4)$est<0,] # Heywood on EE2
# Re-specifying metric invariance model by fixing EE2 lv-2 residual variance to the 15% of its total level-2 variance
metric1.4.fix <- 'level: 1
sEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE
## fixing EE2 level-2 variance to rho2
EE2 ~~ rho2*EE2'
fit <- lmer(EE2 ~ 1 + (1|ID),data=dat) # null LMER model
EE2varlv2 <- as.data.frame(VarCorr(fit))[1,4] # between-subjects variance of item EE2
metric1.4.fix <- cfa(gsub("rho2",EE2varlv2*.15,metric1.4.fix),
data = dat, cluster = 'ID', std.lv = TRUE, estimator = "MLR") # fixing rho2 (problem solved)
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051 S086
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
summary(metric1.4.fix, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 31 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 21
## Number of equality constraints 5
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 258.360 264.582
## Degrees of freedom 8 8
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.976
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1463.897 1027.642
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.425
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.828 0.747
## Tucker-Lewis Index (TLI) 0.741 0.621
##
## Robust Comparative Fit Index (CFI) 0.827
## Robust Tucker-Lewis Index (TLI) 0.740
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6016.841 -6016.841
## Scaling correction factor 1.265
## for the MLR correction
## Loglikelihood unrestricted model (H1) -5887.662 -5887.662
## Scaling correction factor 1.433
## for the MLR correction
##
## Akaike (AIC) 12065.683 12065.683
## Bayesian (BIC) 12142.855 12142.855
## Sample-size adjusted Bayesian (SABIC) 12092.041 12092.041
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.185 0.187
## 90 Percent confidence interval - lower 0.166 0.168
## 90 Percent confidence interval - upper 0.204 0.207
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.185
## 90 Percent confidence interval - lower 0.166
## 90 Percent confidence interval - upper 0.204
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.076 0.076
## SRMR (between covariance matrix) 0.113 0.113
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE1 (L1) 1.251 0.087 14.380 0.000 0.829 0.672
## EE2 (L2) 1.591 0.080 19.775 0.000 1.055 0.804
## EE3 (L3) 1.396 0.132 10.614 0.000 0.926 0.695
## EE4 (L4) 1.175 0.166 7.080 0.000 0.779 0.636
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.440 0.056 7.885 0.000 1.000 1.000
## .EE1 0.836 0.109 7.666 0.000 0.836 0.549
## .EE2 0.607 0.130 4.682 0.000 0.607 0.353
## .EE3 0.915 0.136 6.746 0.000 0.915 0.516
## .EE4 0.894 0.120 7.424 0.000 0.894 0.596
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE1 (L1) 1.251 0.087 14.380 0.000 0.936 0.750
## EE2 (L2) 1.591 0.080 19.775 0.000 1.191 0.930
## EE3 (L3) 1.396 0.132 10.614 0.000 1.045 0.868
## EE4 (L4) 1.175 0.166 7.080 0.000 0.880 0.747
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 4.671 0.105 44.339 0.000 4.671 3.741
## .EE2 3.694 0.114 32.296 0.000 3.694 2.885
## .EE3 3.282 0.118 27.838 0.000 3.282 2.727
## .EE4 2.849 0.125 22.823 0.000 2.849 2.417
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.560 0.056 10.054 0.000 1.000 1.000
## .EE2 0.221 0.221 0.135
## .EE1 0.683 0.126 5.403 0.000 0.683 0.438
## .EE3 0.356 0.135 2.630 0.009 0.356 0.246
## .EE4 0.615 0.199 3.089 0.002 0.615 0.443
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1.4 <- cfa('level: 1
sEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE
## fixing level-2 residual variances to zero
EE1 ~~ 0*EE1
EE2 ~~ 0*EE2
EE3 ~~ 0*EE3
EE4 ~~ 0*EE4', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051 S086
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
summary(scalar1.4, std = TRUE)
## lavaan 0.6.16 ended normally after 25 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 18
## Number of equality constraints 5
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 786.605 NA
## Degrees of freedom 11 11
## P-value (Chi-square) 0.000 NA
## Scaling correction factor NA
## Yuan-Bentler correction (Mplus variant)
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE1 (L1) 1.016 0.120 8.451 0.000 0.614 0.416
## EE2 (L2) 1.473 0.082 17.941 0.000 0.890 0.652
## EE3 (L3) 1.521 0.092 16.625 0.000 0.920 0.680
## EE4 (L4) 1.447 0.127 11.437 0.000 0.874 0.639
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.365 0.047 7.829 0.000 1.000 1.000
## .EE1 1.807 0.201 9.006 0.000 1.807 0.827
## .EE2 1.070 0.179 5.979 0.000 1.070 0.575
## .EE3 0.982 0.155 6.324 0.000 0.982 0.537
## .EE4 1.110 0.194 5.715 0.000 1.110 0.592
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE1 (L1) 1.016 0.120 8.451 0.000 0.809 1.000
## EE2 (L2) 1.473 0.082 17.941 0.000 1.173 1.000
## EE3 (L3) 1.521 0.092 16.625 0.000 1.212 1.000
## EE4 (L4) 1.447 0.127 11.437 0.000 1.153 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 4.687 0.109 43.092 0.000 4.687 5.791
## .EE2 3.713 0.115 32.194 0.000 3.713 3.164
## .EE3 3.288 0.118 27.895 0.000 3.288 2.713
## .EE4 2.816 0.125 22.556 0.000 2.816 2.443
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.635 0.047 13.600 0.000 1.000 1.000
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
All models converged normally without warnings or improper solutions.
Contrarily to the 4-item model, the 3-item metric1.3
model
shows satisfactory fit indices, whereas the
config1.3
model is saturated, and the
scalar1.3
model is rejected. Standardized loadings between
.62 and .98 are estimated by the former model.
# Configural invariance across clusters (unconstrained model)
config1.3 <- cfa('level: 1
sEE =~ EE2 + EE3 + EE4
level: 2
tEE =~ EE2 + EE3 + EE4', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
summary(config1.3, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 29 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 15
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 0.000 0.000
## Degrees of freedom 0 0
##
## Model Test Baseline Model:
##
## Test statistic 893.920 549.663
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 1.626
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 1.000
## Tucker-Lewis Index (TLI) 1.000 1.000
##
## Robust Comparative Fit Index (CFI) NA
## Robust Tucker-Lewis Index (TLI) NA
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4539.044 -4539.044
## Loglikelihood unrestricted model (H1) -4539.044 -4539.044
##
## Akaike (AIC) 9108.088 9108.088
## Bayesian (BIC) 9180.437 9180.437
## Sample-size adjusted Bayesian (SABIC) 9132.799 9132.799
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 NA
## 90 Percent confidence interval - lower 0.000 NA
## 90 Percent confidence interval - upper 0.000 NA
## P-value H_0: RMSEA <= 0.050 NA NA
## P-value H_0: RMSEA >= 0.080 NA NA
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.000
## P-value H_0: Robust RMSEA <= 0.050 NA
## P-value H_0: Robust RMSEA >= 0.080 NA
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.000 0.000
## SRMR (between covariance matrix) 0.000 0.000
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 0.823 0.063 12.973 0.000 0.823 0.620
## EE3 1.085 0.071 15.316 0.000 1.085 0.823
## EE4 0.840 0.072 11.702 0.000 0.840 0.707
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 1.085 0.105 10.295 0.000 1.085 0.615
## .EE3 0.559 0.103 5.451 0.000 0.559 0.322
## .EE4 0.708 0.080 8.800 0.000 0.708 0.501
## sEE 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 1.048 0.088 11.851 0.000 1.048 0.865
## EE3 1.203 0.096 12.488 0.000 1.203 0.959
## EE4 1.254 0.111 11.328 0.000 1.254 0.923
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.701 0.115 32.315 0.000 3.701 3.054
## .EE3 3.291 0.118 27.842 0.000 3.291 2.622
## .EE4 2.850 0.125 22.787 0.000 2.850 2.098
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.370 0.079 4.694 0.000 0.370 0.252
## .EE3 0.127 0.081 1.574 0.115 0.127 0.081
## .EE4 0.273 0.093 2.928 0.003 0.273 0.148
## tEE 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1.3 <- cfa('level: 1
sEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE ', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
summary(metric1.3, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 30 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 17
## Number of equality constraints 4
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 8.098 6.810
## Degrees of freedom 2 2
## P-value (Chi-square) 0.017 0.033
## Scaling correction factor 1.189
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 893.920 549.663
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 1.626
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.993 0.991
## Tucker-Lewis Index (TLI) 0.979 0.973
##
## Robust Comparative Fit Index (CFI) 0.994
## Robust Tucker-Lewis Index (TLI) 0.981
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4543.093 -4543.093
## Scaling correction factor 1.203
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4539.044 -4539.044
## Scaling correction factor 1.522
## for the MLR correction
##
## Akaike (AIC) 9112.186 9112.186
## Bayesian (BIC) 9174.889 9174.889
## Sample-size adjusted Bayesian (SABIC) 9133.602 9133.602
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.058 0.051
## 90 Percent confidence interval - lower 0.021 0.015
## 90 Percent confidence interval - upper 0.101 0.092
## P-value H_0: RMSEA <= 0.050 0.310 0.407
## P-value H_0: RMSEA >= 0.080 0.228 0.134
##
## Robust RMSEA 0.056
## 90 Percent confidence interval - lower 0.014
## 90 Percent confidence interval - upper 0.104
## P-value H_0: Robust RMSEA <= 0.050 0.339
## P-value H_0: Robust RMSEA >= 0.080 0.238
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.015 0.015
## SRMR (between covariance matrix) 0.021 0.021
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 (L2) 1.325 0.081 16.436 0.000 0.830 0.625
## EE3 (L3) 1.622 0.071 22.936 0.000 1.016 0.782
## EE4 (L4) 1.441 0.110 13.085 0.000 0.903 0.746
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.392 0.049 8.038 0.000 1.000 1.000
## .EE2 1.076 0.103 10.480 0.000 1.076 0.610
## .EE3 0.656 0.088 7.446 0.000 0.656 0.389
## .EE4 0.648 0.078 8.354 0.000 0.648 0.443
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 (L2) 1.325 0.081 16.436 0.000 1.033 0.855
## EE3 (L3) 1.622 0.071 22.936 0.000 1.264 0.985
## EE4 (L4) 1.441 0.110 13.085 0.000 1.124 0.881
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.696 0.115 32.271 0.000 3.696 3.057
## .EE3 3.288 0.118 27.850 0.000 3.288 2.560
## .EE4 2.848 0.125 22.814 0.000 2.848 2.233
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.608 0.049 12.457 0.000 1.000 1.000
## .EE2 0.394 0.089 4.426 0.000 0.394 0.270
## .EE3 0.051 0.087 0.578 0.563 0.051 0.031
## .EE4 0.364 0.108 3.366 0.001 0.364 0.224
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1.3 <- cfa('level: 1
sEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE
## fixing level-2 residual variances to zero
EE2 ~~ 0*EE2
EE3 ~~ 0*EE3
EE4 ~~ 0*EE4', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
summary(scalar1.3, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 19 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 14
## Number of equality constraints 4
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 224.455 867.249
## Degrees of freedom 5 5
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.259
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 893.920 549.663
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 1.626
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.753 0.000
## Tucker-Lewis Index (TLI) 0.703 -0.903
##
## Robust Comparative Fit Index (CFI) 0.748
## Robust Tucker-Lewis Index (TLI) 0.697
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4651.271 -4651.271
## Scaling correction factor 1.539
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4539.044 -4539.044
## Scaling correction factor 1.522
## for the MLR correction
##
## Akaike (AIC) 9322.542 9322.542
## Bayesian (BIC) 9370.775 9370.775
## Sample-size adjusted Bayesian (SABIC) 9339.016 9339.016
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.219 0.433
## 90 Percent confidence interval - lower 0.195 0.386
## 90 Percent confidence interval - upper 0.243 0.482
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.220
## 90 Percent confidence interval - lower 0.208
## 90 Percent confidence interval - upper 0.233
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.069 0.069
## SRMR (between covariance matrix) 0.118 0.118
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 (L2) 1.347 0.072 18.709 0.000 0.788 0.549
## EE3 (L3) 1.556 0.071 21.779 0.000 0.911 0.693
## EE4 (L4) 1.548 0.101 15.389 0.000 0.906 0.705
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.342 0.046 7.525 0.000 1.000 1.000
## .EE2 1.441 0.123 11.709 0.000 1.441 0.699
## .EE3 0.898 0.114 7.888 0.000 0.898 0.520
## .EE4 0.832 0.118 7.067 0.000 0.832 0.504
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 (L2) 1.347 0.072 18.709 0.000 1.092 1.000
## EE3 (L3) 1.556 0.071 21.779 0.000 1.262 1.000
## EE4 (L4) 1.548 0.101 15.389 0.000 1.255 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.721 0.116 31.991 0.000 3.721 3.406
## .EE3 3.297 0.119 27.799 0.000 3.297 2.613
## .EE4 2.825 0.125 22.571 0.000 2.825 2.251
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.658 0.046 14.453 0.000 1.000 1.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
# selecting participants with 3+ responses
ee <- character()
dat$ID <- as.factor(as.character(dat$ID))
for(ID in levels(dat$ID)){ if(nrow(dat[dat$ID==ID,])>=3){ ee <- c(ee,ID) }}
dat2 <- dat[dat$ID%in%ee,]
cat("EE: fitting MCFA models on",nrow(dat2),"observations from",nlevels(as.factor(as.character(dat2$ID))),"participants")
## EE: fitting MCFA models on 908 observations from 128 participants
Results are similar to those obtained with the full sample, showing
unsatisfactory fit for both the config1.42
and the metric1.42
model, with the same Heywood case in the
latter.
# Configural invariance across clusters (unconstrained model)
config1.42 <- cfa('level: 1
sEE =~ EE1 + EE2 + EE3 + EE4
level: 2
tEE =~ EE1 + EE2 + EE3 + EE4', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
summary(config1.4, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 35 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 20
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 209.326 193.617
## Degrees of freedom 4 4
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.081
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1463.897 1027.642
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.425
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.859 0.813
## Tucker-Lewis Index (TLI) 0.576 0.440
##
## Robust Comparative Fit Index (CFI) 0.858
## Robust Tucker-Lewis Index (TLI) 0.575
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -5992.325 -5992.325
## Scaling correction factor 1.503
## for the MLR correction
## Loglikelihood unrestricted model (H1) -5887.662 -5887.662
## Scaling correction factor 1.433
## for the MLR correction
##
## Akaike (AIC) 12024.649 12024.649
## Bayesian (BIC) 12121.115 12121.115
## Sample-size adjusted Bayesian (SABIC) 12057.598 12057.598
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.236 0.227
## 90 Percent confidence interval - lower 0.210 0.201
## 90 Percent confidence interval - upper 0.264 0.254
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.236
## 90 Percent confidence interval - lower 0.208
## 90 Percent confidence interval - upper 0.265
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.084 0.084
## SRMR (between covariance matrix) 0.094 0.094
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE1 0.926 0.063 14.733 0.000 0.926 0.730
## EE2 1.155 0.073 15.755 0.000 1.155 0.861
## EE3 0.826 0.068 12.217 0.000 0.826 0.628
## EE4 0.648 0.078 8.348 0.000 0.648 0.546
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.753 0.069 10.871 0.000 0.753 0.467
## .EE2 0.464 0.091 5.115 0.000 0.464 0.258
## .EE3 1.045 0.103 10.115 0.000 1.045 0.605
## .EE4 0.990 0.097 10.241 0.000 0.990 0.702
## sEE 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE1 0.552 0.122 4.507 0.000 0.552 0.531
## EE2 1.040 0.098 10.574 0.000 1.040 0.884
## EE3 1.223 0.094 13.083 0.000 1.223 0.964
## EE4 1.276 0.107 11.902 0.000 1.276 0.932
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 4.679 0.106 44.267 0.000 4.679 4.503
## .EE2 3.704 0.115 32.179 0.000 3.704 3.151
## .EE3 3.297 0.119 27.782 0.000 3.297 2.598
## .EE4 2.849 0.125 22.744 0.000 2.849 2.082
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.775 0.127 6.090 0.000 0.775 0.718
## .EE2 0.301 0.081 3.708 0.000 0.301 0.218
## .EE3 0.114 0.082 1.393 0.164 0.114 0.071
## .EE4 0.245 0.093 2.649 0.008 0.245 0.131
## tEE 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1.42 <- cfa('level: 1
sEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE ', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated ov
## variances are negative
parameterestimates(metric1.42)[parameterestimates(metric1.42)$op=="~~" & parameterestimates(metric1.42)$est<0,] # Heywood EE2
# Re-specifying metric invariance model by fixing EE2 lv-2 residual variance to the 15% of its total level-2 variance
metric1.4.fix2 <- 'level: 1
sEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE
## fixing EE2 level-2 variance to rho2
EE2 ~~ rho2*EE2'
fit <- lmer(EE2 ~ 1 + (1|ID),data=dat2) # null LMER model
EE2varlv2 <- as.data.frame(VarCorr(fit))[1,4] # between-subjects variance of item EE2
metric1.4.fix2 <- cfa(gsub("rho2",EE2varlv2*.15,metric1.4.fix2),
data = dat2, cluster = 'ID', std.lv = TRUE, estimator = "MLR") # fixing rho2 (problem solved)
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
summary(metric1.4.fix2, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 31 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 21
## Number of equality constraints 5
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 263.480 291.079
## Degrees of freedom 8 8
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.905
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1449.955 1020.340
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.421
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.822 0.719
## Tucker-Lewis Index (TLI) 0.733 0.579
##
## Robust Comparative Fit Index (CFI) 0.821
## Robust Tucker-Lewis Index (TLI) 0.732
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -5937.660 -5937.660
## Scaling correction factor 1.295
## for the MLR correction
## Loglikelihood unrestricted model (H1) -5805.920 -5805.920
## Scaling correction factor 1.435
## for the MLR correction
##
## Akaike (AIC) 11907.320 11907.320
## Bayesian (BIC) 11984.299 11984.299
## Sample-size adjusted Bayesian (SABIC) 11933.486 11933.486
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.188 0.197
## 90 Percent confidence interval - lower 0.168 0.177
## 90 Percent confidence interval - upper 0.207 0.218
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.188
## 90 Percent confidence interval - lower 0.170
## 90 Percent confidence interval - upper 0.207
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.078 0.078
## SRMR (between covariance matrix) 0.111 0.111
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE1 (L1) 1.246 0.092 13.471 0.000 0.826 0.669
## EE2 (L2) 1.584 0.086 18.505 0.000 1.050 0.799
## EE3 (L3) 1.402 0.140 10.018 0.000 0.929 0.699
## EE4 (L4) 1.173 0.177 6.641 0.000 0.778 0.639
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.440 0.057 7.696 0.000 1.000 1.000
## .EE1 0.844 0.118 7.146 0.000 0.844 0.553
## .EE2 0.624 0.142 4.378 0.000 0.624 0.361
## .EE3 0.905 0.147 6.170 0.000 0.905 0.512
## .EE4 0.877 0.127 6.929 0.000 0.877 0.592
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE1 (L1) 1.246 0.092 13.471 0.000 0.932 0.749
## EE2 (L2) 1.584 0.086 18.505 0.000 1.185 0.930
## EE3 (L3) 1.402 0.140 10.018 0.000 1.049 0.872
## EE4 (L4) 1.173 0.177 6.641 0.000 0.878 0.748
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 4.703 0.107 43.812 0.000 4.703 3.779
## .EE2 3.707 0.116 31.926 0.000 3.707 2.908
## .EE3 3.287 0.119 27.644 0.000 3.287 2.733
## .EE4 2.840 0.127 22.351 0.000 2.840 2.418
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.560 0.057 9.806 0.000 1.000 1.000
## .EE2 0.220 0.220 0.135
## .EE1 0.680 0.131 5.173 0.000 0.680 0.439
## .EE3 0.347 0.140 2.478 0.013 0.347 0.239
## .EE4 0.608 0.209 2.908 0.004 0.608 0.441
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1.42 <- cfa('level: 1
sEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L1*EE1 + L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE
## fixing level-2 residual variances to zero
EE1 ~~ 0*EE1
EE2 ~~ 0*EE2
EE3 ~~ 0*EE3
EE4 ~~ 0*EE4', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE1" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S051
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
summary(scalar1.42, std = TRUE)
## lavaan 0.6.16 ended normally after 24 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 18
## Number of equality constraints 5
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 788.796 NA
## Degrees of freedom 11 11
## P-value (Chi-square) 0.000 NA
## Scaling correction factor NA
## Yuan-Bentler correction (Mplus variant)
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE1 (L1) 1.009 0.120 8.382 0.000 0.611 0.412
## EE2 (L2) 1.462 0.082 17.785 0.000 0.885 0.645
## EE3 (L3) 1.521 0.091 16.769 0.000 0.920 0.683
## EE4 (L4) 1.450 0.127 11.426 0.000 0.877 0.645
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.366 0.047 7.756 0.000 1.000 1.000
## .EE1 1.822 0.200 9.124 0.000 1.822 0.830
## .EE2 1.098 0.176 6.228 0.000 1.098 0.584
## .EE3 0.968 0.151 6.408 0.000 0.968 0.533
## .EE4 1.078 0.191 5.641 0.000 1.078 0.583
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE1 (L1) 1.009 0.120 8.382 0.000 0.803 1.000
## EE2 (L2) 1.462 0.082 17.785 0.000 1.164 1.000
## EE3 (L3) 1.521 0.091 16.769 0.000 1.211 1.000
## EE4 (L4) 1.450 0.127 11.426 0.000 1.155 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE1 4.702 0.110 42.722 0.000 4.702 5.853
## .EE2 3.723 0.117 31.835 0.000 3.723 3.198
## .EE3 3.294 0.119 27.635 0.000 3.294 2.720
## .EE4 2.817 0.127 22.241 0.000 2.817 2.440
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.634 0.047 13.430 0.000 1.000 1.000
## .EE1 0.000 0.000 0.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
Results are similar to those obtained with the full sample, showing
satisfactory fit for the metric1.32
model.
# Configural invariance across clusters (unconstrained model)
config1.32 <- cfa('level: 1
sEE =~ EE2 + EE3 + EE4
level: 2
tEE =~ EE2 + EE3 + EE4', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
summary(config1.32, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 29 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 15
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 0.000 0.000
## Degrees of freedom 0 0
##
## Model Test Baseline Model:
##
## Test statistic 887.146 542.121
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 1.636
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 1.000
## Tucker-Lewis Index (TLI) 1.000 1.000
##
## Robust Comparative Fit Index (CFI) NA
## Robust Tucker-Lewis Index (TLI) NA
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4474.335 -4474.335
## Loglikelihood unrestricted model (H1) -4474.335 -4474.335
##
## Akaike (AIC) 8978.670 8978.670
## Bayesian (BIC) 9050.839 9050.839
## Sample-size adjusted Bayesian (SABIC) 9003.201 9003.201
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 NA
## 90 Percent confidence interval - lower 0.000 NA
## 90 Percent confidence interval - upper 0.000 NA
## P-value H_0: RMSEA <= 0.050 NA NA
## P-value H_0: RMSEA >= 0.080 NA NA
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.000
## P-value H_0: Robust RMSEA <= 0.050 NA
## P-value H_0: Robust RMSEA >= 0.080 NA
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.000 0.000
## SRMR (between covariance matrix) 0.000 0.000
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 0.817 0.064 12.833 0.000 0.817 0.615
## EE3 1.095 0.071 15.366 0.000 1.095 0.829
## EE4 0.838 0.072 11.597 0.000 0.838 0.710
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 1.100 0.106 10.408 0.000 1.100 0.622
## .EE3 0.543 0.104 5.200 0.000 0.543 0.312
## .EE4 0.692 0.080 8.646 0.000 0.692 0.496
## sEE 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 1.041 0.090 11.595 0.000 1.041 0.861
## EE3 1.193 0.098 12.217 0.000 1.193 0.958
## EE4 1.258 0.114 11.060 0.000 1.258 0.926
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.710 0.116 31.890 0.000 3.710 3.069
## .EE3 3.293 0.119 27.573 0.000 3.293 2.645
## .EE4 2.841 0.127 22.328 0.000 2.841 2.092
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.377 0.080 4.713 0.000 0.377 0.258
## .EE3 0.128 0.080 1.592 0.111 0.128 0.082
## .EE4 0.263 0.093 2.817 0.005 0.263 0.142
## tEE 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1.32 <- cfa('level: 1
sEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE ', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
summary(metric1.32, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 29 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 17
## Number of equality constraints 4
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 9.494 8.285
## Degrees of freedom 2 2
## P-value (Chi-square) 0.009 0.016
## Scaling correction factor 1.146
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 887.146 542.121
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 1.636
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.991 0.988
## Tucker-Lewis Index (TLI) 0.974 0.965
##
## Robust Comparative Fit Index (CFI) 0.992
## Robust Tucker-Lewis Index (TLI) 0.975
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4479.082 -4479.082
## Scaling correction factor 1.216
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4474.335 -4474.335
## Scaling correction factor 1.531
## for the MLR correction
##
## Akaike (AIC) 8984.165 8984.165
## Bayesian (BIC) 9046.711 9046.711
## Sample-size adjusted Bayesian (SABIC) 9005.425 9005.425
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.064 0.059
## 90 Percent confidence interval - lower 0.027 0.024
## 90 Percent confidence interval - upper 0.108 0.100
## P-value H_0: RMSEA <= 0.050 0.226 0.291
## P-value H_0: RMSEA >= 0.080 0.314 0.223
##
## Robust RMSEA 0.063
## 90 Percent confidence interval - lower 0.023
## 90 Percent confidence interval - upper 0.110
## P-value H_0: Robust RMSEA <= 0.050 0.250
## P-value H_0: Robust RMSEA >= 0.080 0.318
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.016 0.016
## SRMR (between covariance matrix) 0.023 0.023
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 (L2) 1.312 0.082 16.028 0.000 0.826 0.621
## EE3 (L3) 1.618 0.071 22.838 0.000 1.019 0.784
## EE4 (L4) 1.436 0.114 12.571 0.000 0.905 0.752
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.397 0.050 7.885 0.000 1.000 1.000
## .EE2 1.090 0.103 10.550 0.000 1.090 0.615
## .EE3 0.651 0.090 7.219 0.000 0.651 0.385
## .EE4 0.627 0.077 8.112 0.000 0.627 0.434
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 (L2) 1.312 0.082 16.028 0.000 1.019 0.848
## EE3 (L3) 1.618 0.071 22.838 0.000 1.257 0.987
## EE4 (L4) 1.436 0.114 12.571 0.000 1.116 0.880
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.707 0.116 31.926 0.000 3.707 3.085
## .EE3 3.291 0.119 27.617 0.000 3.291 2.584
## .EE4 2.839 0.127 22.347 0.000 2.839 2.239
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.603 0.050 11.991 0.000 1.000 1.000
## .EE2 0.406 0.092 4.390 0.000 0.406 0.281
## .EE3 0.042 0.088 0.480 0.631 0.042 0.026
## .EE4 0.363 0.110 3.290 0.001 0.363 0.226
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1.32 <- cfa('level: 1
sEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
sEE ~~ NA*sEE + wEE*sEE
level: 2
tEE =~ L2*EE2 + L3*EE3 + L4*EE4
## free and label variances to define factor ICC
tEE ~~ NA*tEE + bEE*tEE
## constrain between-level variances to == ICCs
bEE == 1 - wEE
## fixing level-2 residual variances to zero
EE2 ~~ 0*EE2
EE3 ~~ 0*EE3
EE4 ~~ 0*EE4', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
summary(scalar1.32, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 21 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 14
## Number of equality constraints 4
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 227.289 961.544
## Degrees of freedom 5 5
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.236
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 887.146 542.121
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 1.636
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.748 0.000
## Tucker-Lewis Index (TLI) 0.697 -1.141
##
## Robust Comparative Fit Index (CFI) 0.742
## Robust Tucker-Lewis Index (TLI) 0.691
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4587.980 -4587.980
## Scaling correction factor 1.556
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4474.335 -4474.335
## Scaling correction factor 1.531
## for the MLR correction
##
## Akaike (AIC) 9195.959 9195.959
## Bayesian (BIC) 9244.072 9244.072
## Sample-size adjusted Bayesian (SABIC) 9212.313 9212.313
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.221 0.459
## 90 Percent confidence interval - lower 0.197 0.410
## 90 Percent confidence interval - upper 0.246 0.510
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.223
## 90 Percent confidence interval - lower 0.211
## 90 Percent confidence interval - upper 0.235
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.070 0.070
## SRMR (between covariance matrix) 0.119 0.119
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 (L2) 1.338 0.073 18.359 0.000 0.785 0.544
## EE3 (L3) 1.550 0.072 21.434 0.000 0.909 0.692
## EE4 (L4) 1.550 0.103 15.064 0.000 0.909 0.713
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE (wEE) 0.344 0.047 7.391 0.000 1.000 1.000
## .EE2 1.462 0.124 11.782 0.000 1.462 0.704
## .EE3 0.901 0.116 7.774 0.000 0.901 0.522
## .EE4 0.799 0.117 6.832 0.000 0.799 0.491
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 (L2) 1.338 0.073 18.359 0.000 1.084 1.000
## EE3 (L3) 1.550 0.072 21.434 0.000 1.255 1.000
## EE4 (L4) 1.550 0.103 15.064 0.000 1.256 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.726 0.118 31.621 0.000 3.726 3.439
## .EE3 3.299 0.120 27.492 0.000 3.299 2.629
## .EE4 2.822 0.127 22.218 0.000 2.822 2.248
## tEE 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE (bEE) 0.656 0.047 14.088 0.000 1.000 1.000
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bEE - (1-wEE) 0.000
Here, we inspect the model fit of the specified MCFA models. According to Hu and Bentler (1999), we consider RMSEA ≤ .06, CFI ≥ .95, and SRMR ≤ .08 as indicative of adequate fit. Robust RMSEA and CFI indices are considered accounting for the non-normality of workaholism item scores.
In the full sample, satisfactory fit is shown by one-factor
model metric1.3
assuming metric invariance across
clusters (i.e., weak invariance across levels) based on three
items (i.e., excluding item EE1
), whereas the
config1.3
model is saturated and shows worse BIC, and the
scalar1.4
model is rejected. The fit of the
scalar1.4
model cannot be evaluated due to a convergence
problem, whereas that of the configural1.4
and the
metric1.4
is unsatisfactory, suggesting measurement
problems with item EE1
.
## compare fit (considering robust fit indices)
fit.ind(model=c(config1.4,metric1.4.fix,config1.3,metric1.3,scalar1.3),
models.names=c("config_4item","metric_4item",
"config_3item","metric_3item","scalar_3item"),robust=TRUE)
The results obtained on the subsample of participants with at least 3
responses to EE
items are highly similar to those
obtained with the full sample. Again, the fit of the
scalar1.4
model cannot be evaluated due to a convergence
problem.
## compare fit (considering robust fit indices)
fit.ind(model=c(config1.42,metric1.4.fix2,config1.32,metric1.32,scalar1.32),
models.names=c("config_4item","metric_4item",
"config_3item","metric_3item","scalar_3item"),robust=TRUE)
Here, we inspect the level-specific reliability based on the selected
MCFA model metric1.3
, considering coefficients higher than
.60 as signs of adequate reliability. We can note that the measure shows
adequate reliability at both levels.
data.frame(measure=c("1F_EE_3item"),
omega_w=MCFArel(fit=metric1.3,level=1,items=1:3,item.labels=EE[2:4]),
omega_b=MCFArel(fit=metric1.3,level=2,items=1:3,item.labels=EE[2:4]))
Results are identical to those obtained with the full sample.
data.frame(measure=c("1F_EE_3item"),
omega_w=MCFArel(fit=metric1.32,level=1,items=1:3,item.labels=EE[2:4]),
omega_b=MCFArel(fit=metric1.32,level=2,items=1:3,item.labels=EE[2:4]))
Only a single-factor structure is specified for the three
PD
items.
# selecting PD items
(PD <- c("R.det1","R.det2","R.det3"))
## [1] "R.det1" "R.det2" "R.det3"
Here, we inspect the distribution and intraclass correlations (ICC)
of DP
items. ICCs range from .30 to .35, indexing higher
variability at the intra- than at the inter-individual level. Overall,
item scores show a rather skewed. In contrast, cluster
means and mean-centered item scores are more normally distributed.
item.desc(diary,vars=PD,multilevel=TRUE)
## R.det1 ICC = 0.32
## R.det2 ICC = 0.35
## R.det3 ICC = 0.3
##
## Plotting distributions of cluster means, N = 134
##
## Plotting distributions of mean-centered scores, N = 919
## $<NA>
## NULL
Here, we inspect the correlations among the three PD
items. We can note that they are strongly and positively
intercorrelated. As expected, correlations among individual
mean scores (Matrix 2) are stronger than correlations between
mean-centered scores (Matrix 3).
corr.matrices(data=diary,text=TRUE,vars=PD,cluster="ID")
## [[1]]
##
## [[2]]
##
## [[3]]
Here, we conduct a multilevel confirmatory factor
analysis (MCFA) in compliance with Kim et al
(2016) to evaluate the validity of the hypothesized measurement
model for RE
(i.e., assuming either one or two correlated
factors at both levels) and the cross-level isomorphism
of our RE
measure.
Here, we specify a single-factor multilevel model of PD
items. Following Jack & Jorgensen (2017), we
specify three models assuming config
ural,
metric
, and scalar
invariance across clusters.
Moreover, we fit all models both considering the full sample (N = 134)
and focusing on participants that provided at least three responses (N =
128). In sum, we specify 3 (i.e., configural, metric, and scalar
invariance) x 2 (i.e., full or restricted sample) models. Due to the
skewness of item scores, all models are fitted with the MLR
robust estimator, and robust fit indices are inspected.
dat <- as.data.frame(na.omit(diary[,c("ID",PD)])) # list-wise deletion
cat("PD: fitting MCFA models on",nrow(dat),"observations from",nlevels(as.factor(as.character(dat$ID))),"participants")
## PD: fitting MCFA models on 919 observations from 134 participants
All models converged normally without problems. Satisfactory
fit is shown by the metric1
model, estimating
standardized loadings between .82 and .98.
# Configural invariance across clusters (unconstrained model)
config1 <- cfa('level: 1
sPD =~ R.det1 + R.det2 + R.det3
level: 2
tPD =~ R.det1 + R.det2 + R.det3',
data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
summary(config1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 33 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 15
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 0.000 0.000
## Degrees of freedom 0 0
##
## Model Test Baseline Model:
##
## Test statistic 1949.321 526.761
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 3.701
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 1.000
## Tucker-Lewis Index (TLI) 1.000 1.000
##
## Robust Comparative Fit Index (CFI) NA
## Robust Tucker-Lewis Index (TLI) NA
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4575.726 -4575.726
## Loglikelihood unrestricted model (H1) -4575.727 -4575.727
##
## Akaike (AIC) 9181.453 9181.453
## Bayesian (BIC) 9253.802 9253.802
## Sample-size adjusted Bayesian (SABIC) 9206.164 9206.164
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 NA
## 90 Percent confidence interval - lower 0.000 NA
## 90 Percent confidence interval - upper 0.000 NA
## P-value H_0: RMSEA <= 0.050 NA NA
## P-value H_0: RMSEA >= 0.080 NA NA
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.000
## P-value H_0: Robust RMSEA <= 0.050 NA
## P-value H_0: Robust RMSEA >= 0.080 NA
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.000 0.000
## SRMR (between covariance matrix) 0.000 0.000
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD =~
## R.det1 1.459 0.062 23.354 0.000 1.459 0.897
## R.det2 1.429 0.060 23.791 0.000 1.429 0.888
## R.det3 1.362 0.074 18.299 0.000 1.362 0.814
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.516 0.097 5.299 0.000 0.516 0.195
## .R.det2 0.550 0.101 5.429 0.000 0.550 0.212
## .R.det3 0.946 0.128 7.386 0.000 0.946 0.338
## sPD 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD =~
## R.det1 1.083 0.091 11.931 0.000 1.083 0.969
## R.det2 1.122 0.088 12.791 0.000 1.122 0.962
## R.det3 1.066 0.082 12.936 0.000 1.066 0.986
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 4.359 0.113 38.486 0.000 4.359 3.898
## .R.det2 4.144 0.116 35.644 0.000 4.144 3.552
## .R.det3 4.537 0.111 41.037 0.000 4.537 4.194
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.077 0.073 1.061 0.289 0.077 0.062
## .R.det2 0.102 0.034 3.056 0.002 0.102 0.075
## .R.det3 0.034 0.036 0.939 0.348 0.034 0.029
## tPD 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1 <- cfa('level: 1
sPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
sPD ~~ NA*sPD + wPD*sPD
level: 2
tPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
tPD ~~ NA*tPD + bPD*tPD
## constrain between-level variances to == ICCs
bPD == 1 - wPD', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
summary(metric1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 35 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 17
## Number of equality constraints 4
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 0.837 0.770
## Degrees of freedom 2 2
## P-value (Chi-square) 0.658 0.681
## Scaling correction factor 1.088
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1949.321 526.761
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 3.701
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 1.000
## Tucker-Lewis Index (TLI) 1.002 1.007
##
## Robust Comparative Fit Index (CFI) 1.000
## Robust Tucker-Lewis Index (TLI) 1.002
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4576.145 -4576.145
## Scaling correction factor 1.820
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4575.727 -4575.727
## Scaling correction factor 2.208
## for the MLR correction
##
## Akaike (AIC) 9178.291 9178.291
## Bayesian (BIC) 9240.994 9240.994
## Sample-size adjusted Bayesian (SABIC) 9199.707 9199.707
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 0.000
## 90 Percent confidence interval - lower 0.000 0.000
## 90 Percent confidence interval - upper 0.051 0.047
## P-value H_0: RMSEA <= 0.050 0.948 0.962
## P-value H_0: RMSEA >= 0.080 0.003 0.001
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.051
## P-value H_0: Robust RMSEA <= 0.050 0.945
## P-value H_0: Robust RMSEA >= 0.080 0.003
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.002 0.002
## SRMR (between covariance matrix) 0.002 0.002
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD =~
## R.det1 (L1) 1.822 0.058 31.222 0.000 1.445 0.893
## R.det2 (L2) 1.812 0.056 32.366 0.000 1.438 0.890
## R.det3 (L3) 1.728 0.060 28.714 0.000 1.371 0.816
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD (wPD) 0.630 0.045 13.902 0.000 1.000 1.000
## .R.det1 0.529 0.097 5.429 0.000 0.529 0.202
## .R.det2 0.541 0.099 5.489 0.000 0.541 0.207
## .R.det3 0.943 0.128 7.373 0.000 0.943 0.334
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD =~
## R.det1 (L1) 1.822 0.058 31.222 0.000 1.109 0.972
## R.det2 (L2) 1.812 0.056 32.366 0.000 1.103 0.958
## R.det3 (L3) 1.728 0.060 28.714 0.000 1.052 0.984
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 4.358 0.113 38.669 0.000 4.358 3.823
## .R.det2 4.143 0.116 35.800 0.000 4.143 3.600
## .R.det3 4.536 0.110 41.156 0.000 4.536 4.244
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD (bPD) 0.370 0.045 8.177 0.000 1.000 1.000
## .R.det1 0.071 0.070 1.004 0.315 0.071 0.054
## .R.det2 0.108 0.032 3.346 0.001 0.108 0.081
## .R.det3 0.036 0.033 1.093 0.274 0.036 0.032
##
## Constraints:
## |Slack|
## bPD - (1-wPD) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1 <- cfa('level: 1
sPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
sPD ~~ NA*sPD + wPD*sPD
level: 2
tPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
tPD ~~ NA*tPD + bPD*tPD
## constrain between-level variances to == ICCs
bPD == 1 - wPD
## fixing level-2 residual variances to zero
R.det1 ~~ 0*R.det1
R.det2 ~~ 0*R.det2
R.det3 ~~ 0*R.det3', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
summary(scalar1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 20 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 14
## Number of equality constraints 4
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 51.440 49.615
## Degrees of freedom 5 5
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.037
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1949.321 526.761
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 3.701
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.976 0.914
## Tucker-Lewis Index (TLI) 0.971 0.897
##
## Robust Comparative Fit Index (CFI) 0.976
## Robust Tucker-Lewis Index (TLI) 0.971
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4601.447 -4601.447
## Scaling correction factor 1.995
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4575.727 -4575.727
## Scaling correction factor 2.208
## for the MLR correction
##
## Akaike (AIC) 9222.894 9222.894
## Bayesian (BIC) 9271.127 9271.127
## Sample-size adjusted Bayesian (SABIC) 9239.368 9239.368
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.101 0.099
## 90 Percent confidence interval - lower 0.077 0.075
## 90 Percent confidence interval - upper 0.126 0.124
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 0.923 0.906
##
## Robust RMSEA 0.100
## 90 Percent confidence interval - lower 0.076
## 90 Percent confidence interval - upper 0.127
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 0.918
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.016 0.016
## SRMR (between covariance matrix) 0.040 0.040
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD =~
## R.det1 (L1) 1.813 0.062 29.369 0.000 1.429 0.878
## R.det2 (L2) 1.822 0.056 32.806 0.000 1.435 0.874
## R.det3 (L3) 1.728 0.060 29.038 0.000 1.361 0.809
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD (wPD) 0.621 0.045 13.711 0.000 1.000 1.000
## .R.det1 0.608 0.136 4.474 0.000 0.608 0.229
## .R.det2 0.636 0.112 5.696 0.000 0.636 0.236
## .R.det3 0.982 0.124 7.907 0.000 0.982 0.346
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD =~
## R.det1 (L1) 1.813 0.062 29.369 0.000 1.117 1.000
## R.det2 (L2) 1.822 0.056 32.806 0.000 1.122 1.000
## R.det3 (L3) 1.728 0.060 29.038 0.000 1.064 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 4.362 0.112 38.831 0.000 4.362 3.906
## .R.det2 4.145 0.116 35.725 0.000 4.145 3.694
## .R.det3 4.530 0.110 41.139 0.000 4.530 4.256
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD (bPD) 0.379 0.045 8.379 0.000 1.000 1.000
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bPD - (1-wPD) 0.000
# selecting participants with 3+ responses
re <- character()
dat$ID <- as.factor(as.character(dat$ID))
for(ID in levels(dat$ID)){ if(nrow(dat[dat$ID==ID,])>=3){ re <- c(re,ID) }}
dat2 <- dat[dat$ID%in%re,]
cat("RE: fitting MCFA models on",nrow(dat2),"observations from",nlevels(as.factor(as.character(dat2$ID))),"participants")
## RE: fitting MCFA models on 908 observations from 128 participants
Results are highly similar to those obtained with the full sample, showing satisfactory fit for the metric invariance model.
# Configural invariance across clusters (unconstrained model)
config12 <- cfa('level: 1
sPD =~ R.det1 + R.det2 + R.det3
level: 2
tPD =~ R.det1 + R.det2 + R.det3',
data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S052 S099
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116
summary(config12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 36 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 15
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 0.000 0.000
## Degrees of freedom 0 0
##
## Model Test Baseline Model:
##
## Test statistic 1941.748 512.803
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 3.787
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 1.000
## Tucker-Lewis Index (TLI) 1.000 1.000
##
## Robust Comparative Fit Index (CFI) NA
## Robust Tucker-Lewis Index (TLI) NA
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4509.715 -4509.715
## Loglikelihood unrestricted model (H1) -4509.715 -4509.715
##
## Akaike (AIC) 9049.429 9049.429
## Bayesian (BIC) 9121.598 9121.598
## Sample-size adjusted Bayesian (SABIC) 9073.960 9073.960
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 NA
## 90 Percent confidence interval - lower 0.000 NA
## 90 Percent confidence interval - upper 0.000 NA
## P-value H_0: RMSEA <= 0.050 NA NA
## P-value H_0: RMSEA >= 0.080 NA NA
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.000
## P-value H_0: Robust RMSEA <= 0.050 NA
## P-value H_0: Robust RMSEA >= 0.080 NA
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.000 0.000
## SRMR (between covariance matrix) 0.000 0.000
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD =~
## R.det1 1.459 0.063 23.348 0.000 1.459 0.899
## R.det2 1.425 0.060 23.677 0.000 1.425 0.886
## R.det3 1.373 0.074 18.500 0.000 1.373 0.819
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.506 0.098 5.164 0.000 0.506 0.192
## .R.det2 0.555 0.102 5.463 0.000 0.555 0.215
## .R.det3 0.925 0.128 7.221 0.000 0.925 0.329
## sPD 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD =~
## R.det1 1.089 0.091 11.943 0.000 1.089 0.970
## R.det2 1.123 0.088 12.747 0.000 1.123 0.961
## R.det3 1.063 0.082 13.005 0.000 1.063 0.986
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 4.377 0.115 38.102 0.000 4.377 3.896
## .R.det2 4.166 0.118 35.319 0.000 4.166 3.563
## .R.det3 4.547 0.112 40.668 0.000 4.547 4.217
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.076 0.073 1.040 0.299 0.076 0.060
## .R.det2 0.105 0.034 3.092 0.002 0.105 0.077
## .R.det3 0.032 0.035 0.924 0.355 0.032 0.028
## tPD 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric12 <- cfa('level: 1
sPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
sPD ~~ NA*sPD + wPD*sPD
level: 2
tPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
tPD ~~ NA*tPD + bPD*tPD
## constrain between-level variances to == ICCs
bPD == 1 - wPD', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S052 S099
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116
summary(metric12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 49 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 17
## Number of equality constraints 4
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 0.682 0.635
## Degrees of freedom 2 2
## P-value (Chi-square) 0.711 0.728
## Scaling correction factor 1.075
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1941.748 512.803
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 3.787
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 1.000
## Tucker-Lewis Index (TLI) 1.002 1.008
##
## Robust Comparative Fit Index (CFI) 1.000
## Robust Tucker-Lewis Index (TLI) 1.002
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4510.056 -4510.056
## Scaling correction factor 1.851
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4509.715 -4509.715
## Scaling correction factor 2.241
## for the MLR correction
##
## Akaike (AIC) 9046.113 9046.113
## Bayesian (BIC) 9108.659 9108.659
## Sample-size adjusted Bayesian (SABIC) 9067.373 9067.373
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 0.000
## 90 Percent confidence interval - lower 0.000 0.000
## 90 Percent confidence interval - upper 0.048 0.044
## P-value H_0: RMSEA <= 0.050 0.958 0.968
## P-value H_0: RMSEA >= 0.080 0.002 0.001
##
## Robust RMSEA 0.000
## 90 Percent confidence interval - lower 0.000
## 90 Percent confidence interval - upper 0.048
## P-value H_0: Robust RMSEA <= 0.050 0.955
## P-value H_0: Robust RMSEA >= 0.080 0.003
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.002 0.002
## SRMR (between covariance matrix) 0.002 0.002
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD =~
## R.det1 (L1) 1.825 0.059 31.035 0.000 1.448 0.896
## R.det2 (L2) 1.808 0.056 32.079 0.000 1.434 0.889
## R.det3 (L3) 1.736 0.060 29.089 0.000 1.377 0.820
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD (wPD) 0.629 0.045 13.857 0.000 1.000 1.000
## .R.det1 0.517 0.098 5.262 0.000 0.517 0.198
## .R.det2 0.546 0.099 5.506 0.000 0.546 0.210
## .R.det3 0.923 0.128 7.207 0.000 0.923 0.327
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD =~
## R.det1 (L1) 1.825 0.059 31.035 0.000 1.111 0.973
## R.det2 (L2) 1.808 0.056 32.079 0.000 1.101 0.957
## R.det3 (L3) 1.736 0.060 29.089 0.000 1.057 0.985
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 4.377 0.115 38.191 0.000 4.377 3.831
## .R.det2 4.165 0.118 35.398 0.000 4.165 3.620
## .R.det3 4.546 0.112 40.726 0.000 4.546 4.238
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD (bPD) 0.371 0.045 8.168 0.000 1.000 1.000
## .R.det1 0.070 0.070 0.993 0.321 0.070 0.054
## .R.det2 0.111 0.033 3.382 0.001 0.111 0.084
## .R.det3 0.033 0.032 1.031 0.302 0.033 0.029
##
## Constraints:
## |Slack|
## bPD - (1-wPD) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar12 <- cfa('level: 1
sPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
sPD ~~ NA*sPD + wPD*sPD
level: 2
tPD =~ L1*R.det1 + L2*R.det2 + L3*R.det3
## free and label variances to define factor ICC
tPD ~~ NA*tPD + bPD*tPD
## constrain between-level variances to == ICCs
bPD == 1 - wPD
## fixing level-2 residual variances to zero
R.det1 ~~ 0*R.det1
R.det2 ~~ 0*R.det2
R.det3 ~~ 0*R.det3', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S052 S099
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116
summary(scalar12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 22 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 14
## Number of equality constraints 4
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 52.283 50.682
## Degrees of freedom 5 5
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.032
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 1941.748 512.803
## Degrees of freedom 6 6
## P-value 0.000 0.000
## Scaling correction factor 3.787
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.976 0.910
## Tucker-Lewis Index (TLI) 0.971 0.892
##
## Robust Comparative Fit Index (CFI) 0.975
## Robust Tucker-Lewis Index (TLI) 0.971
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -4535.857 -4535.857
## Scaling correction factor 2.032
## for the MLR correction
## Loglikelihood unrestricted model (H1) -4509.715 -4509.715
## Scaling correction factor 2.241
## for the MLR correction
##
## Akaike (AIC) 9091.713 9091.713
## Bayesian (BIC) 9139.826 9139.826
## Sample-size adjusted Bayesian (SABIC) 9108.067 9108.067
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.102 0.100
## 90 Percent confidence interval - lower 0.078 0.077
## 90 Percent confidence interval - upper 0.128 0.126
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 0.936 0.923
##
## Robust RMSEA 0.102
## 90 Percent confidence interval - lower 0.078
## 90 Percent confidence interval - upper 0.128
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 0.931
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.016 0.016
## SRMR (between covariance matrix) 0.040 0.040
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD =~
## R.det1 (L1) 1.817 0.062 29.201 0.000 1.431 0.880
## R.det2 (L2) 1.819 0.056 32.542 0.000 1.433 0.872
## R.det3 (L3) 1.735 0.059 29.341 0.000 1.366 0.812
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sPD (wPD) 0.620 0.045 13.666 0.000 1.000 1.000
## .R.det1 0.594 0.137 4.335 0.000 0.594 0.225
## .R.det2 0.644 0.113 5.711 0.000 0.644 0.239
## .R.det3 0.961 0.124 7.721 0.000 0.961 0.340
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD =~
## R.det1 (L1) 1.817 0.062 29.201 0.000 1.120 1.000
## R.det2 (L2) 1.819 0.056 32.542 0.000 1.121 1.000
## R.det3 (L3) 1.735 0.059 29.341 0.000 1.069 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .R.det1 4.381 0.114 38.357 0.000 4.381 3.911
## .R.det2 4.165 0.118 35.328 0.000 4.165 3.715
## .R.det3 4.542 0.112 40.696 0.000 4.542 4.248
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tPD (bPD) 0.380 0.045 8.372 0.000 1.000 1.000
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bPD - (1-wPD) 0.000
Here, we inspect the model fit of the specified MCFA models. According to Hu and Bentler (1999), we consider RMSEA ≤ .06, CFI ≥ .95, and SRMR ≤ .08 as indicative of adequate fit. Robust RMSEA and CFI indices are considered accounting for the non-normality of workaholism item scores.
In the full sample, satisfactory fit is shown by the metric
invariance model metric1
whereas model
scalar1
assuming scalar invariance is rejected due to high
RMSEA, and the fit of model config1
cannot be evaluated
because it is a saturated model. Moreover, in terms of information
criteria, both AIC and BIC highlight model metric1
as the best model.
## compare fit (considering robust fit indices)
fit.ind(model=c(config1,metric1,scalar1),
models.names=c("1F_config","1F_metric","1F_scalar"),robust=TRUE)
The results obtained on the subsample of participants with at least 3 responses to psychological detachment items are highly similar to those obtained with the full sample.
## compare fit (considering robust fit indices)
fit.ind(model=c(config12,metric12,scalar12),
models.names=c("1F_config","1F_metric","1F_scalar"),robust=TRUE)
Here, we inspect the level-specific reliability based on the selected
MCFA model metric1
, considering coefficients higher than
.60 as signs of adequate reliability. We can note that all
measures show adequate reliability at both levels, with higher
estimates for the single-factor measures.
data.frame(measure=c("Psychological detachment"),
omega_w=MCFArel(fit=metric1,level=1,items=1:3,item.labels=PD),
omega_b=MCFArel(fit=metric1,level=2,items=1:3,item.labels=PD))
Results are highly similar to those obtained with the full sample.
data.frame(measure=c("Psychological detachment"),
omega_w=MCFArel(fit=metric12,level=1,items=1:3,item.labels=PD),
omega_b=MCFArel(fit=metric12,level=2,items=1:3,item.labels=PD))
Here, we evaluate the distinctiveness between EE
and
PD
items by evaluating the fit of alternative models
assuming them as either distinct or the same latent factor. Here, we do
not evaluate cross-level invariance but we only focus on the
distinctiveness between the two factors. Note that for the former
measure we only consider three items (i.e., we exclude item
EE1
; see above).
dat <- as.data.frame(na.omit(diary[,c("ID",EE,PD)])) # list-wise deletion
cat("EE & PD: fitting MCFA models on",nrow(dat),"observations from",nlevels(as.factor(as.character(dat$ID))),"participants")
## EE & PD: fitting MCFA models on 919 observations from 134 participants
First, we specify a model with a single factor being reflected by
both EE
and PD
items. Since an Heywood
case is shown at level 2 for item EE3
, we
re-specify the model by fixing its level-2 residual variance to the 15%
of its total level-2 variance (see Joreskog & Sobrom
(1996)).
# Configural invariance across clusters (unconstrained model)
config1 <- cfa('level: 1
state =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3
level: 2
trait =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3',
data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated ov
## variances are negative
parameterestimates(config1)[parameterestimates(config1)$op=="~~" & parameterestimates(config1)$est<0,] # Heywood on EE3
# Re-specifying Configural invariance model by fixing EE3 lv-2 residual variance to the 15% of its total level-2 variance
config1.fix <- 'level: 1
state =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3
level: 2
trait =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3
## fixing EE3 level-2 variance to rho2
EE3 ~~ rho2*EE3'
fit <- lmer(EE3 ~ 1 + (1|ID),data=dat) # null LMER model
EE3varlv2 <- as.data.frame(VarCorr(fit))[1,4] # between-subjects variance of item EE3
config1.fix <- cfa(gsub("rho2",EE3varlv2*.15,config1.fix),
data = dat, cluster = 'ID', std.lv = TRUE, estimator = "MLR") # fixing rho2 (problem solved)
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
summary(config1.fix, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 57 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 29
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 780.853 710.343
## Degrees of freedom 19 19
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.099
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 2896.671 1671.098
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.733
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.734 0.579
## Tucker-Lewis Index (TLI) 0.580 0.335
##
## Robust Comparative Fit Index (CFI) 0.733
## Robust Tucker-Lewis Index (TLI) 0.578
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9478.482 -9478.482
## Scaling correction factor 1.900
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9088.056 -9088.056
## Scaling correction factor 1.583
## for the MLR correction
##
## Akaike (AIC) 19014.965 19014.965
## Bayesian (BIC) 19154.840 19154.840
## Sample-size adjusted Bayesian (SABIC) 19062.740 19062.740
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.209 0.199
## 90 Percent confidence interval - lower 0.196 0.187
## 90 Percent confidence interval - upper 0.222 0.211
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.209
## 90 Percent confidence interval - lower 0.196
## 90 Percent confidence interval - upper 0.222
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.190 0.190
## SRMR (between covariance matrix) 0.333 0.333
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## state =~
## EE2 0.053 0.077 0.687 0.492 0.053 0.040
## EE3 0.226 0.074 3.044 0.002 0.226 0.172
## EE4 0.254 0.079 3.220 0.001 0.254 0.213
## R.det1 -1.766 0.064 -27.462 0.000 -1.766 -0.927
## R.det2 -1.741 0.060 -28.918 0.000 -1.741 -0.920
## R.det3 -1.690 0.064 -26.419 0.000 -1.690 -0.868
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## state 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 1.757 0.134 13.098 0.000 1.757 0.998
## .EE3 1.663 0.115 14.501 0.000 1.663 0.970
## .EE4 1.355 0.117 11.539 0.000 1.355 0.955
## .R.det1 0.510 0.097 5.259 0.000 0.510 0.141
## .R.det2 0.548 0.099 5.554 0.000 0.548 0.153
## .R.det3 0.936 0.128 7.286 0.000 0.936 0.247
## state 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## trait =~
## EE2 1.107 0.086 12.892 0.000 1.107 0.908
## EE3 1.208 0.091 13.293 0.000 1.208 0.927
## EE4 1.314 0.108 12.128 0.000 1.314 0.970
## R.det1 -0.148 0.180 -0.820 0.412 -0.148 -0.427
## R.det2 -0.084 0.188 -0.447 0.655 -0.084 -0.216
## R.det3 -0.164 0.181 -0.908 0.364 -0.164 -0.569
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.707 0.114 32.381 0.000 3.707 3.041
## .EE3 3.293 0.118 27.977 0.000 3.293 2.528
## .EE4 2.838 0.124 22.897 0.000 2.838 2.096
## .R.det1 4.359 0.114 38.376 0.000 4.359 12.595
## .R.det2 4.145 0.116 35.591 0.000 4.145 10.657
## .R.det3 4.540 0.111 40.936 0.000 4.540 15.739
## trait 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE3 0.239 0.239 0.141
## .EE2 0.262 0.087 3.008 0.003 0.262 0.176
## .EE4 0.108 0.101 1.066 0.286 0.108 0.059
## .R.det1 0.098 0.065 1.502 0.133 0.098 0.818
## .R.det2 0.144 0.044 3.253 0.001 0.144 0.953
## .R.det3 0.056 0.035 1.596 0.111 0.056 0.677
## trait 1.000 1.000 1.000
Second, we specify the two-factor models with EE
and
PD
being different latent constructs. Both models show an
Heywood case at level 2 for item EE3
,
which we handle by fixing its level-2 residual variance to the 15% of
its total level-2 variance (see Joreskog & Sobrom
(1996)).
# EE items with Det
config2 <- cfa('level: 1
sEE =~ EE2 + EE3 + EE4
sPD =~ R.det1 + R.det2 + R.det3
level: 2
tEE =~ EE2 + EE3 + EE4
tPD =~ R.det1 + R.det2 + R.det3', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
parameterestimates(config2)[parameterestimates(config2)$op=="~~" & parameterestimates(config2)$est<0,] # Heywood on EE3
config2.fix <- 'level: 1
sEE =~ EE2 + EE3 + EE4
sPD =~ R.det1 + R.det2 + R.det3
level: 2
tEE =~ EE2 + EE3 + EE4
tPD =~ R.det1 + R.det2 + R.det3
## fixing EE3 level-2 variance to rho2
EE3 ~~ rho2*EE3'
config2.fix <- cfa(gsub("rho2",EE3varlv2*.15,config2.fix),
data = dat, cluster = 'ID', std.lv = TRUE, estimator = "MLR") # fixing rho2 (problem solved)
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S086 S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S059 S062 S082
## S100 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S086 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S135 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S025 S043 S052
## S099 S125
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116 S125
summary(config2.fix, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 44 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 31
##
## Number of observations 919
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 33.884 29.663
## Degrees of freedom 17 17
## P-value (Chi-square) 0.009 0.029
## Scaling correction factor 1.142
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 2896.671 1671.098
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.733
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.994 0.992
## Tucker-Lewis Index (TLI) 0.990 0.986
##
## Robust Comparative Fit Index (CFI) 0.995
## Robust Tucker-Lewis Index (TLI) 0.991
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9104.998 -9104.998
## Scaling correction factor 1.825
## for the MLR correction
## Loglikelihood unrestricted model (H1) -9088.056 -9088.056
## Scaling correction factor 1.583
## for the MLR correction
##
## Akaike (AIC) 18271.995 18271.995
## Bayesian (BIC) 18421.517 18421.517
## Sample-size adjusted Bayesian (SABIC) 18323.065 18323.065
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.033 0.028
## 90 Percent confidence interval - lower 0.016 0.011
## 90 Percent confidence interval - upper 0.049 0.044
## P-value H_0: RMSEA <= 0.050 0.961 0.990
## P-value H_0: RMSEA >= 0.080 0.000 0.000
##
## Robust RMSEA 0.030
## 90 Percent confidence interval - lower 0.010
## 90 Percent confidence interval - upper 0.048
## P-value H_0: Robust RMSEA <= 0.050 0.966
## P-value H_0: Robust RMSEA >= 0.080 0.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.034 0.034
## SRMR (between covariance matrix) 0.037 0.037
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 0.818 0.063 12.970 0.000 0.818 0.616
## EE3 1.082 0.070 15.384 0.000 1.082 0.823
## EE4 0.848 0.072 11.747 0.000 0.848 0.713
## sPD =~
## R.det1 1.460 0.062 23.388 0.000 1.460 0.897
## R.det2 1.429 0.060 23.774 0.000 1.429 0.887
## R.det3 1.362 0.074 18.317 0.000 1.362 0.814
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE ~~
## sPD -0.170 0.045 -3.777 0.000 -0.170 -0.170
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 1.095 0.105 10.408 0.000 1.095 0.620
## .EE3 0.560 0.101 5.528 0.000 0.560 0.323
## .EE4 0.695 0.078 8.927 0.000 0.695 0.491
## .R.det1 0.514 0.097 5.316 0.000 0.514 0.194
## .R.det2 0.552 0.100 5.495 0.000 0.552 0.213
## .R.det3 0.945 0.129 7.315 0.000 0.945 0.337
## sEE 1.000 1.000 1.000
## sPD 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 1.048 0.089 11.712 0.000 1.048 0.865
## EE3 1.174 0.093 12.666 0.000 1.174 0.923
## EE4 1.274 0.110 11.586 0.000 1.274 0.939
## tPD =~
## R.det1 1.084 0.091 11.935 0.000 1.084 0.969
## R.det2 1.119 0.088 12.693 0.000 1.119 0.960
## R.det3 1.068 0.083 12.940 0.000 1.068 0.986
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE ~~
## tPD -0.227 0.112 -2.030 0.042 -0.227 -0.227
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.702 0.115 32.324 0.000 3.702 3.058
## .EE3 3.290 0.118 27.804 0.000 3.290 2.587
## .EE4 2.850 0.125 22.779 0.000 2.850 2.099
## .R.det1 4.357 0.113 38.455 0.000 4.357 3.896
## .R.det2 4.142 0.116 35.594 0.000 4.142 3.554
## .R.det3 4.535 0.111 40.991 0.000 4.535 4.188
## tEE 0.000 0.000 0.000
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE3 0.239 0.239 0.148
## .EE2 0.368 0.081 4.530 0.000 0.368 0.251
## .EE4 0.219 0.085 2.582 0.010 0.219 0.119
## .R.det1 0.076 0.072 1.056 0.291 0.076 0.061
## .R.det2 0.106 0.034 3.068 0.002 0.106 0.078
## .R.det3 0.032 0.036 0.883 0.377 0.032 0.027
## tEE 1.000 1.000 1.000
## tPD 1.000 1.000 1.000
# selecting participants with 3+ responses
eere <- character()
dat$ID <- as.factor(as.character(dat$ID))
for(ID in levels(dat$ID)){ if(nrow(dat[dat$ID==ID,])>=3){ eere <- c(eere,ID) }}
dat2 <- dat[dat$ID%in%eere,]
cat("EE & PD: fitting MCFA models on",nrow(dat2),"observations from",nlevels(as.factor(as.character(dat2$ID))),"participants")
## EE & PD: fitting MCFA models on 908 observations from 128 participants
First, we specify a model with a single factor being reflected by
both EE
and PD
items. Since an Heywood
case is shown at level 2 for item EE3
, we
re-specify the model by fixing its level-2 residual variance to the 15%
of its total level-2 variance (see Joreskog & Sobrom
(1996)).
# Configural invariance across clusters (unconstrained model)
config12 <- cfa('level: 1
state =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3
level: 2
trait =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3',
data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S052 S099
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116
## Warning in lav_object_post_check(object): lavaan WARNING: some estimated ov
## variances are negative
parameterestimates(config12)[parameterestimates(config12)$op=="~~" & parameterestimates(config12)$est<0,] # Heywood on EE3
# Re-specifying Configural invariance model by fixing EE3 lv-2 residual variance to the 15% of its total level-2 variance
config12.fix <- 'level: 1
state =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3
level: 2
trait =~ EE2 + EE3 + EE4 + R.det1 + R.det2 + R.det3
## fixing EE3 level-2 variance to rho2
EE3 ~~ rho2*EE3'
fit <- lmer(EE3 ~ 1 + (1|ID),data=dat2) # null LMER model
EE3varlv22 <- as.data.frame(VarCorr(fit))[1,4] # between-subjects variance of item EE3
config12.fix <- cfa(gsub("rho2",EE3varlv22*.15,config12.fix),
data = dat2, cluster = 'ID', std.lv = TRUE, estimator = "MLR") # fixing rho2 (problem solved)
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S052 S099
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116
summary(config12.fix, std=TRUE, fit=TRUE)
## lavaan 0.6.16 ended normally after 56 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 29
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 781.413 709.235
## Degrees of freedom 19 19
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.102
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 2879.940 1642.600
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.753
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.732 0.572
## Tucker-Lewis Index (TLI) 0.578 0.324
##
## Robust Comparative Fit Index (CFI) 0.731
## Robust Tucker-Lewis Index (TLI) 0.575
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -9349.234 -9349.234
## Scaling correction factor 1.921
## for the MLR correction
## Loglikelihood unrestricted model (H1) -8958.527 -8958.527
## Scaling correction factor 1.597
## for the MLR correction
##
## Akaike (AIC) 18756.467 18756.467
## Bayesian (BIC) 18895.994 18895.994
## Sample-size adjusted Bayesian (SABIC) 18803.894 18803.894
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.210 0.200
## 90 Percent confidence interval - lower 0.198 0.188
## 90 Percent confidence interval - upper 0.223 0.212
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.210
## 90 Percent confidence interval - lower 0.197
## 90 Percent confidence interval - upper 0.223
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.191 0.191
## SRMR (between covariance matrix) 0.339 0.339
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## state =~
## EE2 0.054 0.077 0.702 0.483 0.054 0.041
## EE3 0.225 0.074 3.037 0.002 0.225 0.172
## EE4 0.259 0.080 3.257 0.001 0.259 0.219
## R.det1 -1.769 0.065 -27.365 0.000 -1.769 -0.928
## R.det2 -1.737 0.060 -28.767 0.000 -1.737 -0.919
## R.det3 -1.700 0.063 -26.920 0.000 -1.700 -0.871
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## state 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 1.765 0.135 13.041 0.000 1.765 0.998
## .EE3 1.671 0.116 14.463 0.000 1.671 0.970
## .EE4 1.335 0.117 11.409 0.000 1.335 0.952
## .R.det1 0.501 0.098 5.126 0.000 0.501 0.138
## .R.det2 0.553 0.099 5.575 0.000 0.553 0.155
## .R.det3 0.916 0.129 7.117 0.000 0.916 0.241
## state 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## trait =~
## EE2 1.096 0.087 12.554 0.000 1.096 0.903
## EE3 1.196 0.092 12.999 0.000 1.196 0.927
## EE4 1.313 0.111 11.813 0.000 1.313 0.972
## R.det1 -0.137 0.182 -0.752 0.452 -0.137 -0.403
## R.det2 -0.066 0.189 -0.347 0.729 -0.066 -0.168
## R.det3 -0.138 0.181 -0.762 0.446 -0.138 -0.519
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.716 0.116 31.963 0.000 3.716 3.064
## .EE3 3.297 0.119 27.686 0.000 3.297 2.556
## .EE4 2.834 0.126 22.451 0.000 2.834 2.097
## .R.det1 4.369 0.115 38.122 0.000 4.369 12.865
## .R.det2 4.159 0.118 35.367 0.000 4.159 10.673
## .R.det3 4.541 0.111 40.725 0.000 4.541 17.061
## trait 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE3 0.233 0.233 0.140
## .EE2 0.271 0.088 3.064 0.002 0.271 0.184
## .EE4 0.102 0.100 1.019 0.308 0.102 0.056
## .R.det1 0.097 0.065 1.482 0.138 0.097 0.838
## .R.det2 0.148 0.045 3.269 0.001 0.148 0.972
## .R.det3 0.052 0.033 1.551 0.121 0.052 0.731
## trait 1.000 1.000 1.000
Second, we specify the two-factor models with EE
and
PD
being different latent constructs.
# EE items with Det
config22 <- cfa('level: 1
sEE =~ EE2 + EE3 + EE4
sPD =~ R.det1 + R.det2 + R.det3
level: 2
tEE =~ EE2 + EE3 + EE4
tPD =~ R.det1 + R.det2 + R.det3', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE2" has no variance within some clusters. The
## cluster ids with zero within variance are: S023 S028 S053 S077
## S107
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE3" has no variance within some clusters. The
## cluster ids with zero within variance are: S018 S062 S082 S100
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "EE4" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S009 S018 S023
## S028 S039 S051 S077 S090 S095 S100 S107 S115 S117 S129
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det1" has no variance within some clusters.
## The cluster ids with zero within variance are: S043 S052 S099 S106
## S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det2" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S052 S099
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "R.det3" has no variance within some clusters.
## The cluster ids with zero within variance are: S014 S043 S047 S099
## S116
summary(config22, std=TRUE, fit=TRUE)
## lavaan 0.6.16 ended normally after 49 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 32
##
## Number of observations 908
## Number of clusters [ID] 128
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 29.922 26.864
## Degrees of freedom 16 16
## P-value (Chi-square) 0.018 0.043
## Scaling correction factor 1.114
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 2879.940 1642.600
## Degrees of freedom 30 30
## P-value 0.000 0.000
## Scaling correction factor 1.753
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.995 0.993
## Tucker-Lewis Index (TLI) 0.991 0.987
##
## Robust Comparative Fit Index (CFI) 0.996
## Robust Tucker-Lewis Index (TLI) 0.992
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -8973.488 -8973.488
## Scaling correction factor 1.838
## for the MLR correction
## Loglikelihood unrestricted model (H1) -8958.527 -8958.527
## Scaling correction factor 1.597
## for the MLR correction
##
## Akaike (AIC) 18010.977 18010.977
## Bayesian (BIC) 18164.937 18164.937
## Sample-size adjusted Bayesian (SABIC) 18063.309 18063.309
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.031 0.027
## 90 Percent confidence interval - lower 0.013 0.007
## 90 Percent confidence interval - upper 0.048 0.044
## P-value H_0: RMSEA <= 0.050 0.969 0.990
## P-value H_0: RMSEA >= 0.080 0.000 0.000
##
## Robust RMSEA 0.029
## 90 Percent confidence interval - lower 0.005
## 90 Percent confidence interval - upper 0.047
## P-value H_0: Robust RMSEA <= 0.050 0.972
## P-value H_0: Robust RMSEA >= 0.080 0.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.034 0.034
## SRMR (between covariance matrix) 0.034 0.034
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE =~
## EE2 0.812 0.063 12.826 0.000 0.812 0.611
## EE3 1.087 0.071 15.349 0.000 1.087 0.823
## EE4 0.849 0.073 11.665 0.000 0.849 0.719
## sPD =~
## R.det1 1.460 0.062 23.389 0.000 1.460 0.899
## R.det2 1.424 0.060 23.650 0.000 1.424 0.886
## R.det3 1.373 0.074 18.512 0.000 1.373 0.819
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sEE ~~
## sPD -0.171 0.045 -3.782 0.000 -0.171 -0.171
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.000 0.000 0.000
## .EE3 0.000 0.000 0.000
## .EE4 0.000 0.000 0.000
## .R.det1 0.000 0.000 0.000
## .R.det2 0.000 0.000 0.000
## .R.det3 0.000 0.000 0.000
## sEE 0.000 0.000 0.000
## sPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 1.108 0.106 10.501 0.000 1.108 0.627
## .EE3 0.561 0.103 5.455 0.000 0.561 0.322
## .EE4 0.674 0.078 8.674 0.000 0.674 0.483
## .R.det1 0.504 0.097 5.178 0.000 0.504 0.191
## .R.det2 0.558 0.101 5.523 0.000 0.558 0.216
## .R.det3 0.924 0.129 7.150 0.000 0.924 0.329
## sEE 1.000 1.000 1.000
## sPD 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE =~
## EE2 1.040 0.090 11.583 0.000 1.040 0.860
## EE3 1.195 0.098 12.224 0.000 1.195 0.961
## EE4 1.255 0.114 11.004 0.000 1.255 0.924
## tPD =~
## R.det1 1.090 0.091 11.945 0.000 1.090 0.970
## R.det2 1.121 0.089 12.639 0.000 1.121 0.960
## R.det3 1.064 0.082 12.996 0.000 1.064 0.987
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tEE ~~
## tPD -0.210 0.114 -1.837 0.066 -0.210 -0.210
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 3.710 0.116 31.893 0.000 3.710 3.069
## .EE3 3.293 0.119 27.574 0.000 3.293 2.647
## .EE4 2.841 0.127 22.331 0.000 2.841 2.092
## .R.det1 4.376 0.115 38.084 0.000 4.376 3.896
## .R.det2 4.165 0.118 35.291 0.000 4.165 3.565
## .R.det3 4.545 0.112 40.643 0.000 4.545 4.214
## tEE 0.000 0.000 0.000
## tPD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .EE2 0.380 0.081 4.711 0.000 0.380 0.260
## .EE3 0.120 0.080 1.493 0.135 0.120 0.077
## .EE4 0.269 0.093 2.880 0.004 0.269 0.146
## .R.det1 0.074 0.072 1.028 0.304 0.074 0.059
## .R.det2 0.108 0.035 3.099 0.002 0.108 0.079
## .R.det3 0.031 0.035 0.879 0.379 0.031 0.027
## tEE 1.000 1.000 1.000
## tPD 1.000 1.000 1.000
Here, we compare the model fit of the specified MCFA models.
In the full sample, better fit is shown by
three-factor model, whereas all the alternative models not
distinguishing between EE
and RE
are rejected.
This pattern is consistent across all the considered fit indices and
information criteria.
fit.ind(model=c(config1.fix,config2.fix),models.names=c("One-factor","Two-factor"),robust=TRUE)
The results obtained on the subsample of participants with at least 3 responses are highly similar to those obtained with the full sample.
fit.ind(model=c(config12.fix,config22),models.names=c("One-factor","Two-factor"),robust=TRUE)
Only a single-factor model is specified for the three daily sleep
disturbances SD
items.
# selecting SD items
(SD <- paste("SQ",1:4,sep=""))
## [1] "SQ1" "SQ2" "SQ3" "SQ4"
Here, we inspect the distribution and intraclass correlations (ICC)
of SQ
items. ICCs range from .30 to .40, indexing sightly
more intra-individual than inter-individual variability. Overall, item
scores show a highly skewed distribution. A similar
scenario is shown by the cluster mean distributions (i.e., mean item
score for each participant), whereas mean-centered item scores are quite
normally distributed.
item.desc(diary,vars=c(SD),multilevel=TRUE)
## SQ1 ICC = 0.32
## SQ2 ICC = 0.3
## SQ3 ICC = 0.4
## SQ4 ICC = 0.37
##
## Plotting distributions of cluster means, N = 134
##
## Plotting distributions of mean-centered scores, N = 909
## $<NA>
## NULL
Here, we inspect the correlations among the three SD
items. We can note that the items are weakly-to-moderately
positively intercorrelated, at both level. As expected,
correlations among individual mean scores (Matrix 2) are stronger than
correlations between mean-centered scores (Matrix 3). Item
SQ1
shows the lowest correlations with the other items, but
its exclusion is not associated by an increase in Cronbach’s alpha.
Thus, we keep all the four items.
corr.matrices(data=diary,text=TRUE,vars=c(SD),cluster="ID")
## [[1]]
##
## [[2]]
##
## [[3]]
# alpha for item dropped
a <- psych::alpha(diary[,SD])
round(a$total[1:2],2) # Cronbach's alpha
round(a$alpha.drop[,1:2],2) # alpha for item dropped
Here, we conduct a multilevel confirmatory factor
analysis (MCFA) in compliance with Kim et al
(2016) to evaluate the validity of the hypothesized measurement
model for SD
(i.e., assuming either one or two correlated
factors at both levels) and the cross-level isomorphism
of our SD
measure.
Here, we specify a single-factor multilevel model for SD
items. Following Jack & Jorgensen (2017), we
specify three models assuming config
ural,
metric
, and scalar
invariance across clusters,
respectively. Moreover, we fit all models both considering the full
sample (N = 135) and focusing on participants that provided at least
three responses (N = 127). In sum, we specify 3 (i.e., configural,
metric, and scalar invariance) x 2 (i.e., full or restricted sample)
models. Due to the skewness of sleep items, all models are fitted with
the MLR robust estimator.
dat <- as.data.frame(na.omit(diary[,c("ID",SD)])) # list-wise deletion
cat("SD: fitting MCFA models on",nrow(dat),"observations from",nlevels(as.factor(as.character(dat$ID))),"participants")
## SD: fitting MCFA models on 909 observations from 134 participants
All models converged normally without warnings. A number of
participants (10-to-16%) show no variability in one or more items.
Acceptable fit indices are shown by both the
config1
and the metric1
model, whereas the
scalar1
model is rejected. Standardized loadings between
.84 and .95 are estimated by the former model.
# Configural invariance across clusters (unconstrained model)
config1 <- cfa('level: 1
sSD =~ SQ1 + SQ2 + SQ3 + SQ4
level: 2
tSD =~ SQ1 + SQ2 + SQ3 + SQ4', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ1" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S009 S017 S030
## S037 S039 S043 S045 S050 S075 S080 S081 S095 S099 S101 S114 S115
## S116 S124 S125 S127 S142
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ2" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S017 S030 S039
## S043 S050 S065 S099 S100 S101 S107 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ3" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S014 S017 S027
## S043 S054 S081 S099 S101 S114 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ4" has no variance within some clusters. The
## cluster ids with zero within variance are: S006 S011 S016 S017
## S027 S028 S043 S045 S050 S076 S085 S086 S099 S100 S101 S103 S105
## S114 S116
summary(config1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 31 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 20
##
## Number of observations 909
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 34.707 27.842
## Degrees of freedom 4 4
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.247
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 885.877 498.068
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.779
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.965 0.951
## Tucker-Lewis Index (TLI) 0.895 0.853
##
## Robust Comparative Fit Index (CFI) 0.966
## Robust Tucker-Lewis Index (TLI) 0.897
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6544.995 -6544.995
## Scaling correction factor 1.812
## for the MLR correction
## Loglikelihood unrestricted model (H1) -6527.641 -6527.641
## Scaling correction factor 1.718
## for the MLR correction
##
## Akaike (AIC) 13129.989 13129.989
## Bayesian (BIC) 13226.236 13226.236
## Sample-size adjusted Bayesian (SABIC) 13162.719 13162.719
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.092 0.081
## 90 Percent confidence interval - lower 0.065 0.057
## 90 Percent confidence interval - upper 0.121 0.107
## P-value H_0: RMSEA <= 0.050 0.006 0.019
## P-value H_0: RMSEA >= 0.080 0.784 0.560
##
## Robust RMSEA 0.090
## 90 Percent confidence interval - lower 0.061
## 90 Percent confidence interval - upper 0.123
## P-value H_0: Robust RMSEA <= 0.050 0.015
## P-value H_0: Robust RMSEA >= 0.080 0.739
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.023 0.023
## SRMR (between covariance matrix) 0.075 0.075
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD =~
## SQ1 0.703 0.080 8.787 0.000 0.703 0.511
## SQ2 1.143 0.077 14.888 0.000 1.143 0.786
## SQ3 0.945 0.088 10.746 0.000 0.945 0.618
## SQ4 0.961 0.093 10.297 0.000 0.961 0.619
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
## sSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 1.401 0.132 10.651 0.000 1.401 0.739
## .SQ2 0.809 0.139 5.805 0.000 0.809 0.383
## .SQ3 1.445 0.180 8.029 0.000 1.445 0.618
## .SQ4 1.486 0.148 10.008 0.000 1.486 0.617
## sSD 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD =~
## SQ1 0.769 0.120 6.432 0.000 0.769 0.831
## SQ2 0.920 0.096 9.574 0.000 0.920 0.963
## SQ3 0.916 0.150 6.125 0.000 0.916 0.737
## SQ4 0.846 0.149 5.664 0.000 0.846 0.705
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 2.301 0.093 24.648 0.000 2.301 2.487
## .SQ2 2.599 0.097 26.810 0.000 2.599 2.720
## .SQ3 2.785 0.120 23.163 0.000 2.785 2.240
## .SQ4 2.583 0.118 21.959 0.000 2.583 2.151
## tSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.264 0.095 2.793 0.005 0.264 0.309
## .SQ2 0.067 0.092 0.726 0.468 0.067 0.073
## .SQ3 0.706 0.208 3.389 0.001 0.706 0.457
## .SQ4 0.726 0.238 3.050 0.002 0.726 0.503
## tSD 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric1 <- cfa('level: 1
sSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
sSD ~~ NA*sSD + wSD*sSD
level: 2
tSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
tSD ~~ NA*tSD + bSD*tSD
## constrain between-level variances to == ICCs
bSD == 1 - wSD', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ1" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S009 S017 S030
## S037 S039 S043 S045 S050 S075 S080 S081 S095 S099 S101 S114 S115
## S116 S124 S125 S127 S142
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ2" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S017 S030 S039
## S043 S050 S065 S099 S100 S101 S107 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ3" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S014 S017 S027
## S043 S054 S081 S099 S101 S114 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ4" has no variance within some clusters. The
## cluster ids with zero within variance are: S006 S011 S016 S017
## S027 S028 S043 S045 S050 S076 S085 S086 S099 S100 S101 S103 S105
## S114 S116
summary(metric1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 26 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 22
## Number of equality constraints 5
##
## Number of observations 909
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 39.565 30.632
## Degrees of freedom 7 7
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.292
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 885.877 498.068
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.779
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.963 0.951
## Tucker-Lewis Index (TLI) 0.936 0.917
##
## Robust Comparative Fit Index (CFI) 0.965
## Robust Tucker-Lewis Index (TLI) 0.939
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6547.424 -6547.424
## Scaling correction factor 1.463
## for the MLR correction
## Loglikelihood unrestricted model (H1) -6527.641 -6527.641
## Scaling correction factor 1.718
## for the MLR correction
##
## Akaike (AIC) 13128.848 13128.848
## Bayesian (BIC) 13210.658 13210.658
## Sample-size adjusted Bayesian (SABIC) 13156.668 13156.668
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.072 0.061
## 90 Percent confidence interval - lower 0.051 0.042
## 90 Percent confidence interval - upper 0.094 0.081
## P-value H_0: RMSEA <= 0.050 0.044 0.157
## P-value H_0: RMSEA >= 0.080 0.285 0.059
##
## Robust RMSEA 0.069
## 90 Percent confidence interval - lower 0.045
## 90 Percent confidence interval - upper 0.095
## P-value H_0: Robust RMSEA <= 0.050 0.089
## P-value H_0: Robust RMSEA >= 0.080 0.267
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.027 0.027
## SRMR (between covariance matrix) 0.081 0.081
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD =~
## SQ1 (L1) 0.999 0.091 11.013 0.000 0.752 0.538
## SQ2 (L2) 1.467 0.070 20.841 0.000 1.105 0.766
## SQ3 (L3) 1.283 0.109 11.766 0.000 0.966 0.629
## SQ4 (L4) 1.278 0.110 11.595 0.000 0.962 0.621
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
## sSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD (wSD) 0.567 0.058 9.799 0.000 1.000 1.000
## .SQ1 1.386 0.132 10.474 0.000 1.386 0.710
## .SQ2 0.858 0.133 6.475 0.000 0.858 0.413
## .SQ3 1.426 0.182 7.836 0.000 1.426 0.605
## .SQ4 1.477 0.145 10.167 0.000 1.477 0.615
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD =~
## SQ1 (L1) 0.999 0.091 11.013 0.000 0.658 0.775
## SQ2 (L2) 1.467 0.070 20.841 0.000 0.966 0.990
## SQ3 (L3) 1.283 0.109 11.766 0.000 0.844 0.698
## SQ4 (L4) 1.278 0.110 11.595 0.000 0.841 0.694
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 2.303 0.093 24.801 0.000 2.303 2.712
## .SQ2 2.598 0.097 26.878 0.000 2.598 2.663
## .SQ3 2.785 0.120 23.182 0.000 2.785 2.304
## .SQ4 2.583 0.117 22.061 0.000 2.583 2.131
## tSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD (bSD) 0.433 0.058 7.491 0.000 1.000 1.000
## .SQ1 0.289 0.090 3.212 0.001 0.289 0.400
## .SQ2 0.019 0.082 0.233 0.816 0.019 0.020
## .SQ3 0.749 0.197 3.794 0.000 0.749 0.512
## .SQ4 0.761 0.218 3.493 0.000 0.761 0.518
##
## Constraints:
## |Slack|
## bSD - (1-wSD) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar1 <- cfa('level: 1
sSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
sSD ~~ NA*sSD + wSD*sSD
level: 2
tSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
tSD ~~ NA*tSD + bSD*tSD
## constrain between-level variances to == ICCs
bSD == 1 - wSD
## fixing level-2 residual variances to zero
SQ1 ~~ 0*SQ1
SQ2 ~~ 0*SQ2
SQ3 ~~ 0*SQ3
SQ4 ~~ 0*SQ4', data = dat, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ1" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S009 S017 S030
## S037 S039 S043 S045 S050 S075 S080 S081 S095 S099 S101 S114 S115
## S116 S124 S125 S127 S142
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ2" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S017 S030 S039
## S043 S050 S065 S099 S100 S101 S107 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ3" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S014 S017 S027
## S043 S054 S081 S099 S101 S114 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ4" has no variance within some clusters. The
## cluster ids with zero within variance are: S006 S011 S016 S017
## S027 S028 S043 S045 S050 S076 S085 S086 S099 S100 S101 S103 S105
## S114 S116
summary(scalar1, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 20 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 18
## Number of equality constraints 5
##
## Number of observations 909
## Number of clusters [ID] 134
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 368.645 720.895
## Degrees of freedom 11 11
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.511
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 885.877 498.068
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.779
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.591 0.000
## Tucker-Lewis Index (TLI) 0.554 -0.593
##
## Robust Comparative Fit Index (CFI) 0.580
## Robust Tucker-Lewis Index (TLI) 0.542
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6711.964 -6711.964
## Scaling correction factor 1.978
## for the MLR correction
## Loglikelihood unrestricted model (H1) -6527.641 -6527.641
## Scaling correction factor 1.718
## for the MLR correction
##
## Akaike (AIC) 13449.928 13449.928
## Bayesian (BIC) 13512.488 13512.488
## Sample-size adjusted Bayesian (SABIC) 13471.202 13471.202
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.189 0.266
## 90 Percent confidence interval - lower 0.173 0.244
## 90 Percent confidence interval - upper 0.206 0.290
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.191
## 90 Percent confidence interval - lower 0.179
## 90 Percent confidence interval - upper 0.202
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.069 0.069
## SRMR (between covariance matrix) 0.277 0.277
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD =~
## SQ1 (L1) 0.979 0.105 9.318 0.000 0.686 0.460
## SQ2 (L2) 1.348 0.094 14.382 0.000 0.944 0.650
## SQ3 (L3) 1.445 0.103 14.026 0.000 1.013 0.596
## SQ4 (L4) 1.359 0.103 13.223 0.000 0.952 0.559
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
## sSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD (wSD) 0.491 0.059 8.341 0.000 1.000 1.000
## .SQ1 1.750 0.183 9.553 0.000 1.750 0.788
## .SQ2 1.216 0.204 5.961 0.000 1.216 0.577
## .SQ3 1.858 0.284 6.546 0.000 1.858 0.644
## .SQ4 1.999 0.258 7.764 0.000 1.999 0.688
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD =~
## SQ1 (L1) 0.979 0.105 9.318 0.000 0.698 1.000
## SQ2 (L2) 1.348 0.094 14.382 0.000 0.961 1.000
## SQ3 (L3) 1.445 0.103 14.026 0.000 1.031 1.000
## SQ4 (L4) 1.359 0.103 13.223 0.000 0.969 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 2.301 0.091 25.257 0.000 2.301 3.295
## .SQ2 2.602 0.098 26.674 0.000 2.602 2.706
## .SQ3 2.798 0.124 22.500 0.000 2.798 2.714
## .SQ4 2.562 0.119 21.523 0.000 2.562 2.643
## tSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD (bSD) 0.509 0.059 8.649 0.000 1.000 1.000
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bSD - (1-wSD) 0.000
# selecting participants with 3+ responses
sq <- character()
dat$ID <- as.factor(as.character(dat$ID))
for(ID in levels(dat$ID)){ if(nrow(dat[dat$ID==ID,])>=3){ sq <- c(sq,ID) }}
dat2 <- dat[dat$ID%in%sq,]
cat("WL: fitting MCFA models on",nrow(dat2),"observations from",nlevels(as.factor(as.character(dat2$ID))),"participants")
## WL: fitting MCFA models on 903 observations from 129 participants
Results are consistent with those obtained with the full sample.
# Configural invariance across clusters (unconstrained model)
config12 <- cfa('level: 1
sSD =~ SQ1 + SQ2 + SQ3 + SQ4
level: 2
tSD =~ SQ1 + SQ2 + SQ3 + SQ4', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distr
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ1" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S009 S017 S030
## S037 S039 S043 S045 S050 S075 S080 S081 S095 S099 S101 S114 S115
## S116 S124 S125 S127 S142
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ2" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S017 S030 S039
## S043 S050 S065 S099 S100 S101 S107 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ3" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S014 S017 S027
## S043 S054 S081 S099 S101 S114 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ4" has no variance within some clusters. The
## cluster ids with zero within variance are: S006 S011 S016 S017
## S027 S028 S043 S045 S050 S076 S085 S086 S099 S100 S101 S103 S105
## S114 S116
summary(config12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 31 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 20
##
## Number of observations 903
## Number of clusters [ID] 129
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 34.532 27.803
## Degrees of freedom 4 4
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.242
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 876.656 493.578
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.776
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.965 0.951
## Tucker-Lewis Index (TLI) 0.894 0.852
##
## Robust Comparative Fit Index (CFI) 0.965
## Robust Tucker-Lewis Index (TLI) 0.896
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6506.497 -6506.497
## Scaling correction factor 1.809
## for the MLR correction
## Loglikelihood unrestricted model (H1) -6489.231 -6489.231
## Scaling correction factor 1.715
## for the MLR correction
##
## Akaike (AIC) 13052.994 13052.994
## Bayesian (BIC) 13149.108 13149.108
## Sample-size adjusted Bayesian (SABIC) 13085.592 13085.592
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.092 0.081
## 90 Percent confidence interval - lower 0.065 0.057
## 90 Percent confidence interval - upper 0.121 0.108
## P-value H_0: RMSEA <= 0.050 0.006 0.019
## P-value H_0: RMSEA >= 0.080 0.784 0.565
##
## Robust RMSEA 0.090
## 90 Percent confidence interval - lower 0.061
## 90 Percent confidence interval - upper 0.124
## P-value H_0: Robust RMSEA <= 0.050 0.015
## P-value H_0: Robust RMSEA >= 0.080 0.740
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.023 0.023
## SRMR (between covariance matrix) 0.075 0.075
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD =~
## SQ1 0.702 0.080 8.739 0.000 0.702 0.509
## SQ2 1.142 0.077 14.816 0.000 1.142 0.785
## SQ3 0.944 0.088 10.688 0.000 0.944 0.617
## SQ4 0.961 0.094 10.262 0.000 0.961 0.619
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
## sSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 1.408 0.132 10.644 0.000 1.408 0.741
## .SQ2 0.812 0.140 5.791 0.000 0.812 0.384
## .SQ3 1.451 0.181 8.029 0.000 1.451 0.619
## .SQ4 1.487 0.149 9.973 0.000 1.487 0.617
## sSD 1.000 1.000 1.000
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD =~
## SQ1 0.774 0.121 6.395 0.000 0.774 0.831
## SQ2 0.927 0.097 9.559 0.000 0.927 0.963
## SQ3 0.920 0.152 6.067 0.000 0.920 0.736
## SQ4 0.857 0.151 5.686 0.000 0.857 0.708
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 2.318 0.095 24.346 0.000 2.318 2.487
## .SQ2 2.614 0.099 26.492 0.000 2.614 2.715
## .SQ3 2.813 0.123 22.952 0.000 2.813 2.251
## .SQ4 2.594 0.120 21.682 0.000 2.594 2.143
## tSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.269 0.097 2.781 0.005 0.269 0.310
## .SQ2 0.067 0.094 0.716 0.474 0.067 0.073
## .SQ3 0.715 0.212 3.372 0.001 0.715 0.458
## .SQ4 0.731 0.243 3.014 0.003 0.731 0.499
## tSD 1.000 1.000 1.000
# Metric invariance across clusters == metric invariance across levels
metric12 <- cfa('level: 1
sSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
sSD ~~ NA*sSD + wSD*sSD
level: 2
tSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
tSD ~~ NA*tSD + bSD*tSD
## constrain between-level variances to == ICCs
bSD == 1 - wSD', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ1" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S009 S017 S030
## S037 S039 S043 S045 S050 S075 S080 S081 S095 S099 S101 S114 S115
## S116 S124 S125 S127 S142
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ2" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S017 S030 S039
## S043 S050 S065 S099 S100 S101 S107 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ3" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S014 S017 S027
## S043 S054 S081 S099 S101 S114 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ4" has no variance within some clusters. The
## cluster ids with zero within variance are: S006 S011 S016 S017
## S027 S028 S043 S045 S050 S076 S085 S086 S099 S100 S101 S103 S105
## S114 S116
summary(metric12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 25 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 22
## Number of equality constraints 5
##
## Number of observations 903
## Number of clusters [ID] 129
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 39.263 30.444
## Degrees of freedom 7 7
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 1.290
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 876.656 493.578
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.776
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.963 0.951
## Tucker-Lewis Index (TLI) 0.936 0.917
##
## Robust Comparative Fit Index (CFI) 0.965
## Robust Tucker-Lewis Index (TLI) 0.939
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6508.863 -6508.863
## Scaling correction factor 1.460
## for the MLR correction
## Loglikelihood unrestricted model (H1) -6489.231 -6489.231
## Scaling correction factor 1.715
## for the MLR correction
##
## Akaike (AIC) 13051.726 13051.726
## Bayesian (BIC) 13133.423 13133.423
## Sample-size adjusted Bayesian (SABIC) 13079.434 13079.434
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.071 0.061
## 90 Percent confidence interval - lower 0.051 0.042
## 90 Percent confidence interval - upper 0.094 0.081
## P-value H_0: RMSEA <= 0.050 0.045 0.159
## P-value H_0: RMSEA >= 0.080 0.284 0.060
##
## Robust RMSEA 0.069
## 90 Percent confidence interval - lower 0.045
## 90 Percent confidence interval - upper 0.095
## P-value H_0: Robust RMSEA <= 0.050 0.091
## P-value H_0: Robust RMSEA >= 0.080 0.266
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.027 0.027
## SRMR (between covariance matrix) 0.081 0.081
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD =~
## SQ1 (L1) 1.002 0.091 10.967 0.000 0.752 0.537
## SQ2 (L2) 1.472 0.071 20.795 0.000 1.104 0.766
## SQ3 (L3) 1.285 0.110 11.688 0.000 0.964 0.627
## SQ4 (L4) 1.284 0.111 11.546 0.000 0.963 0.621
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
## sSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD (wSD) 0.563 0.058 9.678 0.000 1.000 1.000
## .SQ1 1.393 0.133 10.469 0.000 1.393 0.711
## .SQ2 0.861 0.133 6.455 0.000 0.861 0.414
## .SQ3 1.432 0.183 7.839 0.000 1.432 0.606
## .SQ4 1.477 0.146 10.118 0.000 1.477 0.614
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD =~
## SQ1 (L1) 1.002 0.091 10.967 0.000 0.663 0.774
## SQ2 (L2) 1.472 0.071 20.795 0.000 0.973 0.990
## SQ3 (L3) 1.285 0.110 11.688 0.000 0.850 0.698
## SQ4 (L4) 1.284 0.111 11.546 0.000 0.849 0.696
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 2.318 0.095 24.518 0.000 2.318 2.709
## .SQ2 2.613 0.098 26.543 0.000 2.613 2.658
## .SQ3 2.812 0.122 22.983 0.000 2.812 2.311
## .SQ4 2.593 0.119 21.754 0.000 2.593 2.126
## tSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD (bSD) 0.437 0.058 7.521 0.000 1.000 1.000
## .SQ1 0.293 0.092 3.195 0.001 0.293 0.400
## .SQ2 0.019 0.083 0.229 0.819 0.019 0.020
## .SQ3 0.759 0.201 3.782 0.000 0.759 0.512
## .SQ4 0.767 0.222 3.463 0.001 0.767 0.516
##
## Constraints:
## |Slack|
## bSD - (1-wSD) 0.000
# Scalar invariance across clusters implies Level-2 residual variances == 0
scalar12 <- cfa('level: 1
sSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
sSD ~~ NA*sSD + wSD*sSD
level: 2
tSD =~ L1*SQ1 + L2*SQ2 + L3*SQ3 + L4*SQ4
## free and label variances to define factor ICC
tSD ~~ NA*tSD + bSD*tSD
## constrain between-level variances to == ICCs
bSD == 1 - wSD
## fixing level-2 residual variances to zero
SQ1 ~~ 0*SQ1
SQ2 ~~ 0*SQ2
SQ3 ~~ 0*SQ3
SQ4 ~~ 0*SQ4', data = dat2, cluster = "ID",
std.lv = TRUE, estimator = "MLR") # standardized latent variables, MLR due to non-normal distribution
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ1" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S009 S017 S030
## S037 S039 S043 S045 S050 S075 S080 S081 S095 S099 S101 S114 S115
## S116 S124 S125 S127 S142
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ2" has no variance within some clusters. The
## cluster ids with zero within variance are: S004 S017 S030 S039
## S043 S050 S065 S099 S100 S101 S107 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ3" has no variance within some clusters. The
## cluster ids with zero within variance are: S002 S014 S017 S027
## S043 S054 S081 S099 S101 S114 S116 S124 S138
## Warning in lav_data_full(data = data, group = group, cluster = cluster, : lavaan WARNING:
## Level-1 variable "SQ4" has no variance within some clusters. The
## cluster ids with zero within variance are: S006 S011 S016 S017
## S027 S028 S043 S045 S050 S076 S085 S086 S099 S100 S101 S103 S105
## S114 S116
summary(scalar12, std = TRUE, fit = TRUE)
## lavaan 0.6.16 ended normally after 21 iterations
##
## Estimator ML
## Optimization method NLMINB
## Number of model parameters 18
## Number of equality constraints 5
##
## Number of observations 903
## Number of clusters [ID] 129
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 367.975 723.267
## Degrees of freedom 11 11
## P-value (Chi-square) 0.000 0.000
## Scaling correction factor 0.509
## Yuan-Bentler correction (Mplus variant)
##
## Model Test Baseline Model:
##
## Test statistic 876.656 493.578
## Degrees of freedom 12 12
## P-value 0.000 0.000
## Scaling correction factor 1.776
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 0.587 0.000
## Tucker-Lewis Index (TLI) 0.550 -0.613
##
## Robust Comparative Fit Index (CFI) 0.576
## Robust Tucker-Lewis Index (TLI) 0.538
##
## Loglikelihood and Information Criteria:
##
## Loglikelihood user model (H0) -6673.219 -6673.219
## Scaling correction factor 1.975
## for the MLR correction
## Loglikelihood unrestricted model (H1) -6489.231 -6489.231
## Scaling correction factor 1.715
## for the MLR correction
##
## Akaike (AIC) 13372.437 13372.437
## Bayesian (BIC) 13434.912 13434.912
## Sample-size adjusted Bayesian (SABIC) 13393.626 13393.626
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.190 0.268
## 90 Percent confidence interval - lower 0.173 0.245
## 90 Percent confidence interval - upper 0.206 0.291
## P-value H_0: RMSEA <= 0.050 0.000 0.000
## P-value H_0: RMSEA >= 0.080 1.000 1.000
##
## Robust RMSEA 0.191
## 90 Percent confidence interval - lower 0.179
## 90 Percent confidence interval - upper 0.203
## P-value H_0: Robust RMSEA <= 0.050 0.000
## P-value H_0: Robust RMSEA >= 0.080 1.000
##
## Standardized Root Mean Square Residual (corr metric):
##
## SRMR (within covariance matrix) 0.069 0.069
## SRMR (between covariance matrix) 0.277 0.277
##
## Parameter Estimates:
##
## Standard errors Sandwich
## Information bread Observed
## Observed information based on Hessian
##
##
## Level 1 [within]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD =~
## SQ1 (L1) 0.981 0.106 9.269 0.000 0.684 0.458
## SQ2 (L2) 1.352 0.094 14.329 0.000 0.943 0.649
## SQ3 (L3) 1.449 0.104 13.974 0.000 1.011 0.595
## SQ4 (L4) 1.366 0.103 13.214 0.000 0.953 0.559
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
## sSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## sSD (wSD) 0.486 0.059 8.240 0.000 1.000 1.000
## .SQ1 1.762 0.184 9.553 0.000 1.762 0.790
## .SQ2 1.222 0.205 5.949 0.000 1.222 0.579
## .SQ3 1.867 0.285 6.556 0.000 1.867 0.646
## .SQ4 2.000 0.259 7.713 0.000 2.000 0.688
##
##
## Level 2 [ID]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD =~
## SQ1 (L1) 0.981 0.106 9.269 0.000 0.703 1.000
## SQ2 (L2) 1.352 0.094 14.329 0.000 0.969 1.000
## SQ3 (L3) 1.449 0.104 13.974 0.000 1.039 1.000
## SQ4 (L4) 1.366 0.103 13.214 0.000 0.979 1.000
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .SQ1 2.315 0.093 24.992 0.000 2.315 3.292
## .SQ2 2.618 0.099 26.366 0.000 2.618 2.703
## .SQ3 2.820 0.126 22.351 0.000 2.820 2.715
## .SQ4 2.577 0.121 21.291 0.000 2.577 2.632
## tSD 0.000 0.000 0.000
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## tSD (bSD) 0.514 0.059 8.698 0.000 1.000 1.000
## .SQ1 0.000 0.000 0.000
## .SQ2 0.000 0.000 0.000
## .SQ3 0.000 0.000 0.000
## .SQ4 0.000 0.000 0.000
##
## Constraints:
## |Slack|
## bSD - (1-wSD) 0.000
Here, we inspect the model fit of the specified MCFA models. According to Hu and Bentler (1999), we consider RMSEA ≤ .06, CFI ≥ .95, and SRMR ≤ .08 as indicative of adequate fit. Robust RMSEA and CFI indices are considered accounting for the non-normality of workaholism item scores.
In the full sample, satisfactory fit is shown by one-factor
model assuming metric invariance metric1
across
clusters (i.e., weak invariance across levels), as also indicated by
both information criteria. In contrast, although the
config1
model shows better CFI and SRMR indices than the
selected model, its RMSEA value is quite above the considered cut-off.
Finally, the scalar1
model is rejected.
## compare fit (considering robust fit indices)
fit.ind(model=c(config1,metric1,scalar1),models.names=c("1F_config","1F_metric","1F_scalar"),robust=TRUE)
The results obtained on the subsample of participants with at least 3 responses to sleep items are highly similar to those obtained with the full sample.
## compare fit (considering robust fit indices)
fit.ind(model=c(config12,metric12,scalar12),models.names=c("1F_config","1F_metric","1F_scalar"),robust=TRUE)
Here, we inspect the level-specific reliability based on the selected
MCFA model metric1
, considering coefficients higher than
.60 as signs of adequate reliability. We can note that the measure shows
adequate reliability at both levels.
data.frame(measure=c("Sleep disturbances"),
omega_w=MCFArel(fit=metric1,level=1,items=1:4,item.labels=SD),
omega_b=MCFArel(fit=metric1,level=2,items=1:4,item.labels=SD))
Results are identical to those obtained with the full sample.
data.frame(measure=c("Sleep disturbances"),
omega_w=MCFArel(fit=metric12,level=1,items=1:4,item.labels=SD),
omega_b=MCFArel(fit=metric12,level=2,items=1:4,item.labels=SD))
Here, we compute and plot the aggregated score for each considered scale.
# computing aggregate score of diary scales = average
diary$WHLSM <- apply(diary[,WHLSM],1,mean,na.rm=TRUE) # state workaholism
diary$EE <- apply(diary[,EE[2:4]],1,mean,na.rm=TRUE) # emotional exhaustion (only item 2, 3, and 4)
diary$PD <- apply(diary[,PD],1,mean,na.rm=TRUE) # psychological detachment
diary$SD <- apply(diary[,SD],1,mean,na.rm=TRUE) # sleep disturbances
par(mfrow=c(2,5)); for(Var in c("WHLSM","EE","PD","SD")){ hist(diary[,Var],main=Var)}
# computing aggregate score for working excessively and working compulsively (for robustness check)
diary$WE <- apply(diary[,paste0("WHLSM",c(1,3,5))],1,mean,na.rm=TRUE) # working excessively
diary$WC <- apply(diary[,paste0("WHLSM",c(2,4,6))],1,mean,na.rm=TRUE) # working compulsively
# removing raw item scores
diary[,c(WHLSM,EE,PD,SD)] <- NULL
# sorting diary columns
diary <- diary[,c(1:which(colnames(diary)=="meal_aft"),which(colnames(diary)=="WHLSM"),
which(colnames(diary)=="WE"),which(colnames(diary)=="WC"),
which(colnames(diary)=="start_eve"):which(colnames(diary)=="dailyHassles_eve"),
which(colnames(diary)=="EE"):which(colnames(diary)=="PD"),
which(colnames(diary)=="start_mor"):which(colnames(diary)=="hhFromAwake"),
which(colnames(diary)=="SD"),
which(colnames(diary)=="gender"):which(colnames(diary)=="weekHours"),
grep("duwas",colnames(diary)))]
Here, , and we provide a definition for each variable in the aggregated dataset.
str(diary)
## 'data.frame': 1084 obs. of 75 variables:
## $ ID : Factor w/ 135 levels "S001","S002",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ day : num 1 2 3 4 5 7 8 9 10 11 ...
## $ aft : Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ...
## $ eve : Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ...
## $ mor : Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 2 2 2 ...
## $ flagTime : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ flagBP_aft : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ flagBP_eve : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ careless : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ start_aft : POSIXct, format: "2022-01-24 16:42:17" "2022-01-25 16:50:20" ...
## $ end_aft : POSIXct, format: "2022-01-24 16:45:52" "2022-01-25 16:52:14" ...
## $ dayOff_aft : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ SBP_aft : num 130 114 114 120 112 ...
## $ DBP_aft : num 73 75 75.5 78.5 75.5 82 76 83.5 75.5 80 ...
## $ where_aft : Factor w/ 3 levels "home","workplace",..: 1 1 1 1 1 1 1 1 2 1 ...
## $ confounders_aft : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ coffee_aft : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ smoke_aft : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ sport_aft : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ meal_aft : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ WHLSM : num 1.67 4.5 3.33 2 2.17 ...
## $ WE : num 1.67 4.67 2.33 2 1.67 ...
## $ WC : num 1.67 4.33 4.33 2 2.67 ...
## $ start_eve : POSIXct, format: "2022-01-24 22:50:17" "2022-01-25 23:17:12" ...
## $ end_eve : POSIXct, format: "2022-01-24 22:53:33" "2022-01-25 23:20:13" ...
## $ dayOff_eve : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ SBP_eve : num 122 108 106 113 112 ...
## $ DBP_eve : num 77 76 66.5 75 74 75.5 80 76 86.5 84 ...
## $ confounders_eve : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ coffee_eve : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ smoke_eve : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ sport_eve : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ meal_eve : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...
## $ teleWork : Factor w/ 4 levels "office","teleWork",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ workHours : num 6 6 6 6 6 6 6 6 9 6 ...
## $ dailyHassles_eve: Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ EE : num 3.67 2 2.67 2.33 2 ...
## $ PD : num 3.67 2.33 3.33 1 1 ...
## $ start_mor : POSIXct, format: "2022-01-25 09:03:06" "2022-01-26 09:01:20" ...
## $ end_mor : POSIXct, format: "2022-01-25 09:05:29" "2022-01-26 09:03:11" ...
## $ dayOffyesterday : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ lateWorkHours : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ wakeTime : POSIXct, format: "2024-05-17 06:45:00" "2024-05-17 06:45:00" ...
## $ hhFromAwake : num 1.3 1.27 1.27 1.68 1.37 ...
## $ SD : num 1.75 1 1 2.75 1.25 1.25 1.5 1 2 1.5 ...
## $ gender : Factor w/ 2 levels "F","M": 1 1 1 1 1 1 1 1 1 1 ...
## $ age : int 59 59 59 59 59 59 59 59 59 59 ...
## $ BMI : num 18.8 18.8 18.8 18.8 18.8 ...
## $ edu : Factor w/ 2 levels "highschool-",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ mStatus : Factor w/ 4 levels "single","partner",..: 2 2 2 2 2 2 2 2 2 2 ...
## $ home : Factor w/ 5 levels "alone","partner",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ children : Factor w/ 2 levels "No","Yes": 2 2 2 2 2 2 2 2 2 2 ...
## $ home_child : Factor w/ 2 levels "No","Yes": 2 2 2 2 2 2 2 2 2 2 ...
## $ partner : Factor w/ 2 levels "No","Yes": 2 2 2 2 2 2 2 2 2 2 ...
## $ home_partner : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ smoker : Factor w/ 2 levels "No","Yes": 2 2 2 2 2 2 2 2 2 2 ...
## $ bp_drugs : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ horm_drugs : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ psy_drugs : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ cv_dysf : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ sleep_dysf : Factor w/ 2 levels "No","Yes": 1 1 1 1 1 1 1 1 1 1 ...
## $ job : Factor w/ 22 levels "Administrative and commercial managers",..: 3 3 3 3 3 3 3 3 3 3 ...
## $ position : Factor w/ 3 levels "Employee","Manager/Employers",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ sector : Factor w/ 2 levels "Private","Public": 1 1 1 1 1 1 1 1 1 1 ...
## $ weekHours : num 35 35 35 35 35 35 35 35 35 35 ...
## $ duwas1 : int 2 2 2 2 2 2 2 2 2 2 ...
## $ duwas2 : int 4 4 4 4 4 4 4 4 4 4 ...
## $ duwas3 : int 2 2 2 2 2 2 2 2 2 2 ...
## $ duwas4 : int 4 4 4 4 4 4 4 4 4 4 ...
## $ duwas5 : int 2 2 2 2 2 2 2 2 2 2 ...
## $ duwas6 : int 2 2 2 2 2 2 2 2 2 2 ...
## $ duwas7 : int 1 1 1 1 1 1 1 1 1 1 ...
## $ duwas8 : int 2 2 2 2 2 2 2 2 2 2 ...
## $ duwas9 : int 1 1 1 1 1 1 1 1 1 1 ...
## $ duwas10 : int 3 3 3 3 3 3 3 3 3 3 ...
Identification
ID
= participant’s identification code
day
= day of participation (from 1 to 11)
Compliance
aft
= day including the response to the Afternoon
questionnaire (1) or not (0)
eve
= day including the response to the Evening
questionnaire (1) or not (0)
mor
= day including the response to the Morning
questionnaire (1) or not (0)
Data quality
flagTime
= responses recoded due to wrong response
timing (i.e., responses given outside the scheduled intervals)
flagBP_aft
- flagBP_eve
= flagged cases
that were reprocessed due to extreme BP values
careless
= participant flagged as a careless
respondent (careless = TRUE
) due to inconsistent responses
in the DayOff
variables
Afternoon questionnaire
start_aft
= starting time of the Afternoon
questionnaire (yyyy-mm-dd hh:mm:ss)
end_aft
= submission time of the Afternoon
questionnaire (yyyy-mm-dd hh:mm:ss)
dayOff_aft
= logical variable indicating whether the
participant reported working on that day (FALSE) or not (TRUE)
SBP_aft
- DBP_aft
= systolic and
diastolic aggregate blood pressure value (mmHg) measured in the
Afternoon
where_aft
= place where the Afternoon blood pressure
recording was done (“home”, “workplace”, “other”)
confounders_aft
= logical variable indicating the
presence (TRUE) or absence (FALSE) of any confounder before the
Afternoon recording
coffee_aft
- meal_aft
= variables
indicating the presence (1) or absence (0) of each confounder (i.e.,
cofee, smoke, sport, and meal)
WHLSM
= aggregated (i.e., mean) score at the six
workaholism items (1-7)
WE
- WC
= aggregated (i.e., mean) score
at the working excessively (1-7) and the working compulsively (1-7)
dimensions of the state wrokaholism measure
Evening questionnaire
start_eve
= starting time of the Evening
questionnaire (yyyy-mm-dd hh:mm:ss)
end_eve
= submission time of the Evening
questionnaire (yyyy-mm-dd hh:mm:ss)
dayOff_eve
= logical variable indicating whether the
participant reported working on that day (FALSE) or not (TRUE)
SBP_eve
- DBP_eve
= systolic and
diastolic aggregate blood pressure value (mmHg) measured in the
Evening
confounders_eve
= logical variable indicating the
presence (TRUE) or absence (FALSE) of any confounder before the Evening
recording
coffee_eve
- meal_eve
= variables
indicating the presence (1) or absence (0) of each confounder (i.e.,
cofee, smoke, sport, and meal)
teleWork
= factor indicating whether on that day the
participant worked in the “office”, did “teleWork”, or “both”
workHours
= number of working hours for that day
(No.)
dailyHassless_eve
= factor indicating whether the
participant reported some daily hassles outside the working time on that
day (“Yes”) or not (“No”)
EE
= aggregated (i.e., mean) score at the four
emotional exhaustion items (1-7)
PD
= aggregated (i.e., mean) score at the
psychological detachment subscale of the Recovery Experience
Questionnaire
Morning questionnaire
start_mor
= starting time of the Morning
questionnaire (yyyy-mm-dd hh:mm:ss)
end_mor
= submission time of the Morning
questionnaire (yyyy-mm-dd hh:mm:ss)
dayOffyesterday
= logical variable indicating
whether the participant reported working on the previous day day (FALSE)
or not (TRUE)
lateWorkHours
= logical variable indicating whether
the participant reported working in the previous evening (TRUE) or not
(FALSE)
wakeTime
= self-reported waking time (yyyy-mm-dd
hh:mm:ss)
hhFromAwake
= number of hours between waketime and
the response to the Morning questionnaire
SD
= aggregated (i.e., mean) score at at the Mini
Sleep Questionnaire (1-7)
Retrospective time-invariant variables (measured with the preliminary questionnaire)
Demographics
gender
= participant’s gender (“F” or “M”)
age
= participant’s age (years)
BMI
= participant’s body mass index
(kg/m^2)
edu
= participant’s education level (“middle”,
“highschool”, “university+”)
mStatus
= participant’s marital status (“single”,
“partner”, “divorced”, “widowed”)
home
= family situation (living “alone” or with
“partner”, “children”, “parents”, “others”)
children
= number of children (No.)
home_child
= living with children (Yes/No)
partner
= having a partner (Yes/No)
home_partner
= living with partner (Yes/No)
Confounders and inclusion criteria
smoker
= smoking status (“No”, “Yes”, “Quit_less”,
“Quit_more”)
bp_drugs
= participant reporting taking blood
pressure medications (e.g., diuretics, beta-blokkants,
anti-hypertension)
horm_drugs
= participant reporting taking hormonal
medications (e.g., birth control)
psy_drugs
= participant reporting taking psychiatric
drugs (e.g., antidepressants, anxiety)
cv_dysf
= participant reporting suffering from a
cardiovascular disease (e.g., hypertension, ischemia, strokes)
sleep_dysf
= participant reporting suffering from a
sleep-related disease (e.g., insomnia, parasomnia, sleep apnea)
Occupational variables
job
= participant’s job recoded using the ISCO-08
classification of occupations (level 2) (Ganzeboom, 2010
position
= participant’s job position (“Employee”,
“Project”, “Manager”, “(Self-)Employer”)
sector
= participant’s job sector (“Private” or
“Public”)
weekHours
= participant’s self-reported mean number
of working hours per week (No.)
dwas1
- dwas10
= raw item scores at the
retrospective version of the Dutch Work Addiction Questionnaire
administered in the preliminary questionnaire (1-4)
Here, we export the recoded and pre-processed diary_wide
dataset (renamed as diary
) to be used for further analyses.
Both datasets are exported in multiple format.
# exporting diary data
save(diary,file="DATI/diary_aggregated.RData") # RData
write.csv2(diary,file="DATI/diary_aggregated.csv", row.names=FALSE) # csv with ";"
Avanzi, L., Balducci, C., & Fraccaroli, F. (2013). Contributo alla validazione italiana del Copenhagen Burnout Inventory (CBI) [Contribution to the Italian validation of the Copenhagen Burnout Inventory (CBI)]. Psicologia Della Salute, 2, 120–135. https://doi.org/10.3280/PDS2013-002008
Balducci, C., Avanzi, L., Consiglio, C., Fraccaroli, F., & Schaufeli, W. (2017). A Cross-National Study on the Psychometric Quality of the Italian Version of the Dutch Work Addiction Scale (DUWAS). European Journal of Psychological Assessment, 33(6), 422–428. https://doi.org/10.1027/1015-5759/
Kim, E. S., Dedrick, R. F., Cao, C., & Ferron, J. M. (2016). Multilevel Factor Analysis: Reporting Guidelines and a Review of Reporting Practices. Multivariate Behavioral Research, 51(6), 0–0. https://doi.org/10.1080/00273171.2016.1228042
Kristensen, T. S., Borritz, M., Villadsen, E., & Christensen, K. B. (2005). The Copenhagen Burnout Inventory: A new tool for the assessment of burnout. Work & Stress, 19(3), 192–207. https://doi.org/10.1080/02678370500297720
Natale, V., Fabbri, M., Tonetti, L., & Martoni, M. (2014). Psychometric goodness of the Mini Sleep Questionnaire. Psychiatry and Clinical Neurosciences, 68(7), 568–573. https://doi.org/10.1111/pcn.12161
Schaufeli, W. B., Shimazu, A., & Taris, T. W. (2009). Being Driven to Work Excessively Hard. Cross-Cultural Research, 43(4), 320–348. https://doi.org/10.1177/1069397109337239
Rosseel, Y. (2012). lavaan: An R Package for Structural Equation Modeling. Journal of Statistical Software, 48(2), 1–36. https://doi.org/10.18637/jss.v048.i02
Sonnentag, S., & Fritz, C. (2007). The Recovery Experience Questionnaire: Development and validation of a measure for assessing recuperation and unwinding from work. Journal of Occupational Health Psychology, 12(3), 204–221. https://doi.org/10.1037/1076-8998.12.3.204
Zito, M., Molino, M., & Sonnentag, S. (2013). Adattamento italiano del Recovery Experience Questionnaire [Italian Adaptation of the Recovery Experience Questionnaire]. Giornate Nazionali Di Psicologia Positiva, VI Edizione-PROMUOVERE RISORSE NEL CAMBIAMENTO, 68–69.