Aims and content

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())


1. Data reading

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


2. Psychometrics

The considered scales among those included in the daily diaries are:

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).


2.1. Workaholism

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)]


2.1.1. Item description

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


2.1.2. Correlations

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]]


2.1.3. MCFA

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.

2.1.3.1. Model specification

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 configural, 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.

N = 135
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
ONE-FACTOR

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


TWO-FACTOR

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


N = 127
# 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
ONE-FACTOR

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


TWO-FACTOR

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


2.1.3.2. Model fit

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.

N = 135

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


N = 127

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))


2.1.4. Standardized solution

Here, we inspect the standardized parameters estimated by the selected models assumin partial cross-level invariance.

N = 135

standardizedsolution(metric2.part)

N = 127

standardizedsolution(metric22.part)

2.1.5. Reliability

N = 135

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)))


N = 127

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)))


2.2. Emotional Exhaustion

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"


2.2.1. Item description

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


2.2.2. Correlations

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


2.2.3. MCFA

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.

2.2.3.1. Model specification

Here, we specify a single-factor multilevel model for EE items. Following Jack & Jorgensen (2017), we specify three models assuming configural, 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.

N = 134
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
4-ITEM

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


3-ITEM

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


N = 128
# 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
4-ITEM

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


3-ITEM

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


2.2.3.2. Model fit

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.

N = 134

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)


N = 128

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)


2.2.4. Reliability

N = 134

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]))


N = 128

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]))


2.3. Psychological Detachment

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"


2.3.1. Item description

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


2.3.2. Correlations

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]]


2.3.3. MCFA

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.

2.3.3.1. Model specification

Here, we specify a single-factor multilevel model of PD items. Following Jack & Jorgensen (2017), we specify three models assuming configural, 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.

N = 134
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


N = 128
# 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


2.3.3.2. Model fit

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.

N = 134

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)


N = 128

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)


2.3.4. Reliability

N = 134

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))


N = 128

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))


2.4. Exhaustion vs. Detachment

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).

2.4.1. Model specification

N = 134

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
ONE-FACTOR

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


TWO-FACTOR

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


N = 128

# 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
ONE-FACTOR

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


TWO-FACTOR

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


2.4.2. Model fit

Here, we compare the model fit of the specified MCFA models.

N = 134

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)


N = 128

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)


2.5. Sleep disturbances

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"


2.5.1. Item description

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


2.5.2. Correlations

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


2.5.3. MCFA

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.

2.5.3.1. Model specification

Here, we specify a single-factor multilevel model for SD items. Following Jack & Jorgensen (2017), we specify three models assuming configural, 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.

N = 134
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
N = 129
# 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


2.5.3.2. Model fit

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.

N = 134

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)


N = 129

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)


2.5.4. Reliability

N = 135

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))


N = 127

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))


3. Aggregated scores

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)))]


4. Data dictionary

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)


5. Data export

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 ";"


References

  • 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.

R packages

Bartoń, Kamil. 2023. MuMIn: Multi-Model Inference. https://CRAN.R-project.org/package=MuMIn.
Bates, Douglas, Martin Mächler, Ben Bolker, and Steve Walker. 2015. “Fitting Linear Mixed-Effects Models Using lme4.” Journal of Statistical Software 67 (1): 1–48. https://doi.org/10.18637/jss.v067.i01.
Bates, Douglas, Martin Maechler, Ben Bolker, and Steven Walker. 2023. Lme4: Linear Mixed-Effects Models Using Eigen and S4. https://github.com/lme4/lme4/.
Hope, Ryan M. 2022. Rmisc: Ryan Miscellaneous. https://CRAN.R-project.org/package=Rmisc.
Korkmaz, Selcuk, Dincer Goksuluk, and Gokmen Zararsiz. 2014. “MVN: An r Package for Assessing Multivariate Normality.” The R Journal 6 (2): 151–62. https://journal.r-project.org/archive/2014-2/korkmaz-goksuluk-zararsiz.pdf.
———. 2021. MVN: Multivariate Normality Tests. https://CRAN.R-project.org/package=MVN.
R Core Team. 2023. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Revelle, William. 2023. Psych: Procedures for Psychological, Psychometric, and Personality Research. https://personality-project.org/r/psych/ https://personality-project.org/r/psych-manual.pdf.
Rosseel, Yves. 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.
Rosseel, Yves, Terrence D. Jorgensen, and Nicholas Rockwood. 2023. Lavaan: Latent Variable Analysis. https://lavaan.ugent.be.
Wickham, Hadley. 2007. “Reshaping Data with the reshape Package.” Journal of Statistical Software 21 (12): 1–20. http://www.jstatsoft.org/v21/i12/.
———. 2016. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org.
———. 2020. Reshape2: Flexibly Reshape Data: A Reboot of the Reshape Package. https://github.com/hadley/reshape.
Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, Kara Woo, Hiroaki Yutani, and Dewey Dunnington. 2023. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics. https://CRAN.R-project.org/package=ggplot2.
LS0tDQp0aXRsZTogIlRoZSBkYWlseSBjb3N0cyBvZiB3b3JrYWhvbGlzbSINCnN1YnRpdGxlOiAiU3VwcGxlbWVud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2J1c3QiLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3N1YigiY2ZpIiwiY2ZpLnJvYnVzdCIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdzdWIoImNoaXNxIiwiY2hpc3Euc2NhbGVkIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnc3ViKCJkZiIsImRmLnNjYWxlZCIsZml0cykpKSkgfQ0KICANCiAgIyByZXR1cm5pbmcgZGF0YWZyYW1lIG9mIG1vZGVscyBmaXQgaW5kaWNlcyB3aGVuIG1vcmUgdGhhbiBvbmUgbW9kZWwgaXMgY29uc2lkZXJlZA0KICBpZihmcm9tX3N1bW1hcnk9PUZBTFNFKXsNCiAgICBpZihsZW5ndGgobW9kZWwpPjEpew0KICAgICAgZml0LmluZGljZXMgPC0gZml0bWVhc3VyZXMobW9kZWxbWzFdXSlbZml0c10NCiAgICAgIGZvcihpIGluIDI6bGVuZ3RoKG1vZGVsKSl7DQogICAgICAgIGZpdC5pbmRpY2VzIDwtIHJiaW5kKGZpdC5pbmRpY2VzLGZpdG1lYXN1cmVzKG1vZGVsW1tpXV0pW2ZpdHNdKSB9DQogICAgICBpZihpbmZvY3JpdD09VFJVRSl7IA0KICAgICAgICBmaXQuaW5kaWNlcyA8LSBjYmluZChmaXQuaW5kaWNlcywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUlDdz1XZWlnaHRzKHNhcHBseShtb2RlbCxBSUMpKSxCSUN3PVdlaWdodHMoc2FwcGx5KG1vZGVsLEJJQykpKSAgfQ0KICAgICAgaWYoIWlzLm5hKG1vZGVscy5uYW1lc1sxXSkpeyByb3cubmFtZXMoZml0LmluZGljZXMpIDwtIG1vZGVscy5uYW1lcyB9DQogICAgICBmaXQuaW5kaWNlcyA8LSByb3VuZChhcy5kYXRhLmZyYW1lKGZpdC5pbmRpY2VzKSxkaWdpdHMpDQogICAgICByZXR1cm4oYXMuZGF0Y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AgICAgICAgICAgICAgc3RkLmx2ID0gVFJVRSwgZXN0aW1hdG9yID0gIk1MUiIpICMgc3RhbmRhcmRpemVkIGxhdGVudCB2YXJpYWJsZXMsIE1MUiBkdWUgdG8gbm9uLW5vcm1hbCBkaXN0cg0Kc3VtbWFyeShjb25maWcxLCBzdGQgPSBUUlVFLCBmaXQgPSBUUlVFKQ0KDQojIE1ldHJpYyBpbnZhcmlhbmNlIGFjcm9zcyBjbHVzdGVycyA9PSBtZXRyaWMgaW52YXJpYW5jZSBhY3Jvc3MgbGV2ZWxzDQptZXRyaWMxIDwtIGNmYSgnbGV2ZWw6IDENCiAgICAgICAgICAgICAgICBzV0hMU00gPX4gTDEqV0hMU00xICsgTDIqV0hMU00yICsgTDMqV0hMU00zICsgTDQqV0hMU000ICsgTDUqV0hMU001ICsgTDYqV0hMU002DQogICAgICAgICAgICAgICAgIyMgZnJlZSBhbmQgbGFiZWwgdmFyaWFuY2VzIHRvIGRlZmluZSBmYWN0b3IgSUNDDQogICAgICAgICAgICAgICAgc1dITFNNIH5+IE5BKnNXSExTTSArIHdXSExTTSpzV0hMU00gDQogICAgICAgICAgICAgICAgbGV2ZWw6IDINCiAgICAgICAgICAgICAgICB0V0hMU00gPX4gTDEqV0hMU00xICsgTDIqV0hMU00yICsgTDMqV0hMU00zICsgTDQqV0hMU000ICsgTDUqV0hMU001ICsgTDYqV0hMU002DQogICAgICAgICAgICAgICAgIyMgZnJlZSBhbmQgbGFiZWwgdmFyaWFuY2VzIHRvIGRlZmluZSBmYWN0b3IgSUNDDQogICAgICAgICAgICAgICAgdFdITFNNIH5+IE5BKnRXSExTTSArIGJXSExTTSp0V0hMU00gDQogICAgICAgICAgICAgICAgIyMgY29uc3RyYWluIGJldHdlZW4tbGV2ZWwgdmFyaWFuY2VzIHRvID09IElDQ3MNCiAgICAgICAgICAgICAgICBiV0hMU00gPT0gMSAtIHdXSExTTSAnLCBkYXRhID0gZGF0LCBjbHVzdGVyID0gIklEIiwgDQogICAgICAgICAgICAgICAgc3RkLmx2ID0gVFJVRSwgZXN0aW1hdG9yID0gIk1MUiIpICMgc3RhbmRhcmRpemVkIGxhdGVudCB2YXJpYWJsZXMsIE1MUiBkdWUgdG8gbm9uLW5vcm1hbCBkaXN0cmlidXRpb24NCnN1bW1hcnkobWV0cmljMSwgc3RkID0gVFJVRSwgZml0ID0gVFJVRSkNCg0KIyBTY2FsYXIgaW52YXJpYW5jZSBhY3Jvc3MgY2x1c3RlcnMgaW1wbGllcyBMZXZlbC0yIHJlc2lkdWFsIHZhcmlhbmNlcyA9PSAwDQpzY2FsYXIxIDwtIGNmYSgnbGV2ZWw6IDENCiAgICAgICAgICAgICAgICBzV0hMU00gPX4gTDEqV0hMU00xICsgTDIqV0hMU00yICsgTDMqV0hMU00zICsgTDQqV0hMU000ICsgTDUqV0hMU001ICsgTDYqV0hMU002DQogICAgICAgICAgICAgICAgIyMgZnJlZSBhbmQgbGFiZWwgdmFyaWFuY2VzIHRvIGRlZmluZSBmYWN0b3IgSUNDDQogICAgICAgICAgICAgICAgc1dITFNNIH5+IE5BKnNXSExTTSArIHdXSExTTSpzV0hMU00gDQogICAgICAgICAgICAgICAgbGV2ZWw6IDINCiAgICAgICAgICAgICAgICB0V0hMU00gPX4gTDEqV0hMU00xICsgTDIqV0hMU00yICsgTDMqV0hMU00zICsgTDQqV0hMU000ICsgTDUqV0hMU001ICsgTDYqV0hMU002DQogICAgICAgICAgICAgICAgIyMgZnJlZSBhbmQgbGFiZWwgdmFyaWFuY2VzIHRvIGRlZmluZSBmYWN0b3IgSUNDDQogICAgICAgICAgICAgICAgdFdITFNNIH5+IE5BKnRXSExTTSArIGJXSExTTSp0V0hMU00gDQogICAgICAgICAgICAgICAgIyMgY29uc3RyYWluIGJldHdlZW4tbGV2ZWwgdmFyaWFuY2VzIHRvID09IElDQ3MNCiAgICAgICAgICAgICAgICBiV0hMU00gPT0gMSAtIHdXSExTTSANCiAgICAgICAgICAgICAgICAjIyBmaXhpbmcgbGV2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yIDwtIGNmYSgnbGV2ZWw6IDENCiAgICAgICAgICAgICAgICBzV0UgPX4gTDEqV0hMU00xICsgTDIqV0hMU00zICsgTDMqV0hMU001DQogICAgICAgICAgICAgICAgc1dDID1+IEw0KldITFNNMiArIEw1KldITFNNNCArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHNXRSB+fiBOQSpzV0UgKyB3V0Uqc1dFIA0KICAgICAgICAgICAgICAgIHNXQyB+fiBOQSpzV0MgKyB3V0Mqc1dDIA0KICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFdFID1+IEwxKldITFNNMSArIEwyKldITFNNMyArIEwzKldITFNNNQ0KICAgICAgICAgICAgICAgIHRXQyA9fiBMNCpXSExTTTIgKyBMNSpXSExTTTQgKyBMNipXSExTTTYNCiAgICAgICAgICAgICAgICAjIyBmcmVlIGFuZCBsYWJlbCB2YXJpYW5jZXMgdG8gZGVmaW5lIGZhY3RvciBJQ0MNCiAgICAgICAgICAgICAgICB0V0Ugfn4gTkEqdFdFICsgYldFKnRXRSANCiAgICAgICAgICAgICAgICB0V0Mgfn4gTkEqdFdDICsgYldDKnRXQyANCiAgICAgICAgICAgICAgICAjIyBjb25zdHJhaW4gYmV0d2Vlbi1sZXZlbCB2YXJpYW5jZXMgdG8gPT0gSUNDcw0KICAgICAgICAgICAgICAgIGJXRSA9PSAxIC0gd1dFDQogICAgICAgICAgICAgICAgYldDID09IDEgLSB3V0MnLCBkYXRhID0gZGF0LCBjbHVzdGVyID0gIklEIiwgDQogICAgICAgICAgICAgICAgc3RkLmx2ID0gVFJVRSwgZXN0aW1hdG9yID0gIk1MUiIpICMgc3RhbmRhcmRpemVkIGxhdGVudCB2YXJpYWJsZXMsIE1MUiBkdWUgdG8gbm9uLW5vcm1hbCBkaXN0cg0Kc3VtbWFyeShtZXRyaWMyLCBzdGQgPSBUUlVFLCBmaXQgPSBUUlVFKQ0KDQojIFNjYWxhciBpbnZhcmlhbmNlIGFjcm9zcyBjbHVzdGVycyBpbXBsaWVzIExldmVsLTIgcmVzaWR1YWwgdmFyaWFuY2VzID09IDANCnNjYWxhcjIgPC0gY2ZhKCdsZXZlbDogMQ0KICAgICAgICAgICAgICAgIHNXRSA9fiBMMSpXSExTTTEgKyBMMipXSExTTTMgKyBMMypXSExTTTUNCiAgICAgICAgICAgICAgICBzV0MgPX4gTDQqV0hMU00yICsgTDUqV0hMU000ICsgTDYqV0hMU002DQogICAgICAgICAgICAgICAgIyMgZnJlZSBhbmQgbGFiZWwgdmFyaWFuY2VzIHRvIGRlZmluZSBmYWN0b3IgSUNDDQogICAgICAgICAgICAgICAgc1dFIH5+IE5BKnNXRSArIHdXRSpzV0UgDQogICAgICAgICAgICAgICAgc1dDIH5+IE5BKnNXQyArIHdXQypzV0MgDQogICAgICAgICAgICAgICAgbGV2ZWw6IDINCiAgICAgICAgICAgICAgICB0V0UgPX4gTDEqV0hMU00xICsgTDIqV0hMU00zICsgTDMqV0hMU001DQogICAgICAgICAgICAgICAgdFdDID1+IEw0KldITFNNMiArIEw1KldITFNNNCArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHRXRSB+fk5BKnRXRSArIGJXRSp0V0UgDQogICAgICAgICAgICAgICAgdFdDIH5+TkEqdFdDICsgYldDKnRXQyANCiAgICAgICAgICAgICAgICAjIyBjb25zdHJhaW4gYmV0d2Vlbi1sZXZlbCB2YXJpYW5jZXMgdG8gPT0gSUNDcw0KICAgICAgICAgICAgICAgIGJXRSA9PSAxIC0gd1dFDQogICAgICAgICAgICAgICAgYldDID09IDEgLSB3V0MNCiAgICAgICAgICAgICAgICBXSExTTTEgfn4gMCpXSExTTTENCiAgICAgICAgICA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IHdXRSpzV0UgDQogICAgICAgICAgICAgICAgc1dDIH5+IE5BKnNXQyArIHdXQypzV0MgDQogICAgICAgICAgICAgICAgbGV2ZWw6IDINCiAgICAgICAgICAgICAgICB0V0UgPX4gV0hMU00xICsgTDIqV0hMU00zICsgTDMqV0hMU001DQogICAgICAgICAgICAgICAgdFdDID1+IEw0KldITFNNMiArIEw1KldITFNNNCArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHRXRSB+fiBOQSp0V0UgKyBiV0UqdFdFIA0KICAgICAgICAgICAgICAgIHRXQyB+fiBOQSp0V0MgKyBiV0MqdFdDIA0KICAgICAgICAgICAgICAgICMjIGNvbnN0cmFpbiBiZXR3ZWVuLWxldmVsIHZhcmlhbmNlcyB0byA9PSBJQ0NzDQogICAgICAgICAgICAgICAgYldFID09IDEgLSB3V0UNCiAgICAgICAgICAgICAgICBiV0MgPT0gMSAtIHdXQycsIGRhdGEgPSBkYXQsIGNsdXN0ZXIgPSAiSUQiLCANCiAgICAgICAgICAgICAgICBzdGQubHYgPSBUUlVFLCBlc3RpbWF0b3IgPSAiTUxSIikgIyBzdGFuZGFyZGl6ZWQgbGF0ZW50IHZhcmlhYmxlcywgTUxSIGR1ZSB0byBub24tbm9ybWFsIGRpc3RyDQpzdW1tYXJ5KG1ldHJpYzIucGFydCwgc3RkID0gVFJVRSwgZml0ID0gVFJVRSkNCmBgYA0KDQo8YnI+DQoNCiMjIyMjIE4gPSAxMjcgey50YWJzZXQgLnRhYnNldC1mYWRlIC50YWJzZXQtcGlsbHN9DQpgYGB7ciB9DQojIHNlbGVjdGluZyBwYXJ0aWNpcGFudHMgd2l0aCAzKyByZXNwb25zZXMNCndobHNtIDwtIGNoYXJhY3RlcigpDQpkYXQkSUQgPC0gYXMuZmFjdG9yKGFzLmNoYXJhY3RlcihkYXQkSUQpKSA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KQ0KDQojIE1ldHJpYyBpbnZhcmlhbmNlIGFjcm9zcyBjbHVzdGVycyA9PSBtZXRyaWMgaW52YXJpYW5jZSBhY3Jvc3MgbGV2ZWxzDQptZXRyaWMxMiA8LSBjZmEoJ2xldmVsOiAxDQogICAgICAgICAgICAgICAgc1dITFNNID1+IEwxKldITFNNMSArIEwyKldITFNNMiArIEwzKldITFNNMyArIEw0KldITFNNNCArIEw1KldITFNNNSArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHNXSExTTSB+fiBOQSpzV0hMU00gKyB3V0hMU00qc1dITFNNIA0KICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFdITFNNID1+IEwxKldITFNNMSArIEwyKldITFNNMiArIEwzKldITFNNMyArIEw0KldITFNNNCArIEw1KldITFNNNSArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHRXSExTTSB+fiBOQSp0V0hMU00gKyBiV0hMU00qdFdITFNNIA0KICAgICAgICAgICAgICAgICMjIGNvbnN0cmFpbiBiZXR3ZWVuLWxldmVsIHZhcmlhbmNlcyB0byA9PSBJQ0NzDQogICAgICAgICAgICAgICAgYldITFNNID09IDEgLSB3V0hMU00gJywgZGF0YSA9IGRhdDIsIGNsdXN0ZXIgPSAiSUQiLCANCiAgICAgICAgICAgICAgICBzdGQubHYgPSBUUlVFLCBlc3RpbWF0b3IgPSAiTUxSIikgIyBzdGFuZGFyZGl6ZWQgbGF0ZW50IHZhcmlhYmxlcywgTUxSIGR1ZSB0byBub24tbm9ybWFsIGRpc3RyaWJ1dGlvbg0Kc3VtbWFyeShtZXRyaWMxMiwgc3RkID0gVFJVRSwgZml0ID0gVFJVRSkNCg0KIyBTY2FsYXIgaW52YXJpYW5jZSBhY3Jvc3MgY2x1c3RlcnMgaW1wbGllcyBMZXZlbC0yIHJlc2lkdWFsIHZhcmlhbmNlcyA9PSAwDQpzY2FsYXIxMiA8LSBjZmEoJ2xldmVsOiAxDQogICAgICAgICAgICAgICAgc1dITFNNID1+IEwxKldITFNNMSArIEwyKldITFNNMiArIEwzKldITFNNMyArIEw0KldITFNNNCArIEw1KldITFNNNSArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHNXSExTTSB+fiBOQSpzV0hMU00gKyB3V0hMU00qc1dITFNNIA0KICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFdITFNNID1+IEwxKldITFNNMSArIEwyKldITFNNMiArIEwzKldITFNNMyArIEw0KldITFNNNCArIEw1KldITFNNNSArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHRXSExTTSB+fiBOQSp0V0hMU00gKyBiV0hMU00qdFdITFNNIA0KICAgICAgICAgICAgICAgICMjIGNvbnN0cmFpbiBiZXR3ZWVuLWxldmVsIHZhcmlhbmNlcyB0byA9PSBJQ0NzDQogICAgICAgICAgICAgICAgYldITFNNID09IDEgLSB3V0hMU00gDQogICAgICAgICAgICAgICAgIyMgZml4aW5nIGxldmVsLTIgcmVzaWR1YWwgdmFyaWFuY2VzIHRvIHplcm8NCiAgICAgICAgICAgICAgICBXSExTTTEgfn4gMCpXSExTTTENCiAgICAgICAgICAgICAgICBXSExTTTIgfn4gMCpXSExTTTINCiAgICAgICAgICAgICAgICBXSExTTTMgfn4gMCpXSExTTTMNCiAgICAgICAgICAgICAgICBXSExTTTQgfn4gMCpXSExTTT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koY29uZmlnMjIsIHN0ZCA9IFRSVUUsIGZpdCA9IFRSVUUpDQoNCiMgTWV0cmljIGludmFyaWFuY2UgYWNyb3NzIGNsdXN0ZXJzID09IG1ldHJpYyBpbnZhcmlhbmNlIGFjcm9zcyBsZXZlbHMNCm1ldHJpYzIyIDwtIGNmYSgnbGV2ZWw6IDENCiAgICAgICAgICAgICAgICBzV0UgPX4gTDEqV0hMU00xICsgTDIqV0hMU00zICsgTDMqV0hMU001DQogICAgICAgICAgICAgICAgc1dDID1+IEw0KldITFNNMiArIEw1KldITFNNNCArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHNXRSB+fiBOQSpzV0UgKyB3V0Uqc1dFIA0KICAgICAgICAgICAgICAgIHNXQyB+fiBOQSpzV0MgKyB3V0Mqc1dDIA0KICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFdFID1+IEwxKldITFNNMSArIEwyKldITFNNMyArIEwzKldITFNNNQ0KICAgICAgICAgICAgICAgIHRXQyA9fiBMNCpXSExTTTIgKyBMNSpXSExTTTQgKyBMNipXSExTTTYNCiAgICAgICAgICAgICAgICAjIyBmcmVlIGFuZCBsYWJlbCB2YXJpYW5jZXMgdG8gZGVmaW5lIGZhY3RvciBJQ0MNCiAgICAgICAgICAgICAgICB0V0Ugfn4gTkEqdFdFICsgYldFKnRXRSANCiAgICAgICAgICAgICAgICB0V0Mgfn4gTkEqdFdDICsgYldDKnRXQyANCiAgICAgICAgICAgICAgICAjIyBjb25zdHJhaW4gYmV0d2Vlbi1sZXZlbCB2YXJpYW5jZXMgdG8gPT0gSUNDcw0KICAgICAgICAgICAgICAgIGJXRSA9PSAxIC0gd1dFDQogICAgICAgICAgICAgICAgYldDID09IDEgLSB3V0MnLCBkYXRhID0gZGF0MiwgY2x1c3RlciA9ICJJRCIsIA0KICAgICAgICAgICAgICAgIHN0ZC5sdiA9IFRSVUUsIGVzdGltYXRvciA9ICJNTFIiKSAjIHN0YW5kYXJkaXplZCBsYXRlbnQgdmFyaWFibGVzLCBNTFIgZHVlIHRvIG5vbi1ub3JtYWwgZGlzdHINCnN1bW1hcnkobWV0cmljMjIsIHN0ZCA9IFRSVUUsIGZpdCA9IFRSVUUpDQoNCiMgU2NhbGFyIGludmFyaWFuY2UgYWNyb3NzIGNsdXN0ZXJzIGltcGxpZXMgTGV2ZWwtMiByZXNpZHVhbCB2YXJpYW5jZXMgPT0gMA0Kc2NhbGFyMjIgPC0gY2ZhKCdsZXZlbDogMQ0KICAgICAgICAgICAgICAgIHNXRSA9fiBMMSpXSExTTTEgKyBMMipXSExTTTMgKyBMMypXSExTTTUNCiAgICAgICAgICAgICAgICBzV0MgPX4gTDQqV0hMU00yICsgTDUqV0hMU000ICsgTDYqV0hMU002DQogICAgICAgICAgICAgICAgIyMgZnJlZSBhbmQgbGFiZWwgdmFyaWFuY2VzIHRvIGRlZmluZSBmYWN0b3IgSUNDDQogICAgICAgICAgICAgICAgc1dFIH5+IE5BKnNXRSArIHdXRSpzV0UgDQogICAgICAgICAgICAgICAgc1dDIH5+IE5BKnNXQyArIHdXQypzV0MgDQogICAgICAgICAgICAgICAgbGV2ZWw6IDINCiAgICAgICAgICAgICAgICB0V0UgPX4gTDEqV0hMU00xICsgTDIqV0hMU00zICsgTDMqV0hMU001DQogICAgICAgICAgICAgICAgdFdDID1+IEw0KldITFNNMiArIEw1KldITFNNNCArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHRXRSB+fk5BKnRXRSArIGJXRSp0V0UgDQogICAgICAgICAgICAgICAgdFdDIH5+TkEqdFdDICsgYldDKnRXQyANCiAgICAgICAgICAgICAgICAjIyBjb25zdHJhaW4gYmV0d2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ICAgICAgICAgICAgc1dDID1+IEw0KldITFNNMiArIEw1KldITFNNNCArIEw2KldITFNNNg0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHNXRSB+fiBOQSpzV0UgKyB3V0Uqc1dFIA0KICAgICAgICAgICAgICAgIHNXQyB+fiBOQSpzV0MgKyB3V0Mqc1dDIA0KICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFdFID1+IFdITFNNMSArIEwyKldITFNNMyArIEwzKldITFNNNQ0KICAgICAgICAgICAgICAgIHRXQyA9fiBMNCpXSExTTTIgKyBMNSpXSExTTTQgKyBMNipXSExTTTYNCiAgICAgICAgICAgICAgICAjIyBmcmVlIGFuZCBsYWJlbCB2YXJpYW5jZXMgdG8gZGVmaW5lIGZhY3RvciBJQ0MNCiAgICAgICAgICAgICAgICB0V0Ugfn4gTkEqdFdFICsgYldFKnRXRSANCiAgICAgICAgICAgICAgICB0V0Mgfn4gTkEqdFdDICsgYldDKnRXQyANCiAgICAgICAgICAgICAgICAjIyBjb25zdHJhaW4gYmV0d2Vlbi1sZXZlbCB2YXJpYW5jZXMgdG8gPT0gSUNDcw0KICAgICAgICAgICAgICAgIGJXRSA9PSAxIC0gd1dFDQogICAgICAgICAgICAgICAgYldDID09IDEgLSB3V0MnLCBkYXRhID0gZGF0LCBjbHVzdGVyID0gIklEIiwgDQogICAgICAgICAgICAgICAgc3RkLmx2ID0gVFJVRSwgZXN0aW1hdG9yID0gIk1MUiIpICMgc3RhbmRhcmRpemVkIGxhdGVudCB2YXJpYWJsZXMsIE1MUiBkdWUgdG8gbm9uLW5vcm1hbCBkaXN0cg0Kc3VtbWFyeShtZXRyaWMyMi5wYXJ0LCBzdGQgPSBUUlVFLCBmaXQgPSBUUlVFKQ0KYGBgDQoNCjxicj4NCg0KIyMjIyAyLjEuMy4yLiBNb2RlbCB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xICsgUi5kZXQyICsgUi5kZXQzDQogICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFBEID1+IFIuZGV0MSArIFIuZGV0MiArIFIuZGV0MycsIA0KICAgICAgICAgICAgICAgZGF0YSA9IGRhdCwgY2x1c3RlciA9ICJJRCIsICANCiAgICAgICAgICAgICAgIHN0ZC5sdiA9IFRSVUUsIGVzdGltYXRvciA9ICJNTFIiKSAjIHN0YW5kYXJkaXplZCBsYXRlbnQgdmFyaWFibGVzLCBNTFIgZHVlIHRvIG5vbi1ub3JtYWwgZGlzdHINCnN1bW1hcnkoY29uZmlnMSwgc3RkID0gVFJVRSwgZml0ID0gVFJVRSkNCg0KIyBNZXRyaWMgaW52YXJpYW5jZSBhY3Jvc3MgY2x1c3RlcnMgPT0gbWV0cmljIGludmFyaWFuY2UgYWNyb3NzIGxldmVscw0KbWV0cmljMSA8LSBjZmEoJ2xldmVsOiAxDQogICAgICAgICAgICAgICAgc1BEID1+IEwxKlIuZGV0MSArIEwyKlIuZGV0MiArIEwzKlIuZGV0Mw0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHNQRCB+fiBOQSpzUEQgKyB3UEQqc1BEIA0KICAgICAgICAgICAgICAgIGxldmVsOiAyDQogICAgICAgICAgICAgICAgdFBEID1+IEwxKlIuZGV0MSArIEwyKlIuZGV0MiArIEwzKlIuZGV0Mw0KICAgICAgICAgICAgICAgICMjIGZyZWUgYW5kIGxhYmVsIHZhcmlhbmNlcyB0byBkZWZpbmUgZmFjdG9yIElDQw0KICAgICAgICAgICAgICAgIHRQRCB+fiBOQSp0UEQgKyBiUEQqdFBEIA0KICAgICAgICAgICAgICAgICMjIGNvbnN0cmFpbiBiZXR3ZWVuLWxldmVsIHZhcmlhbmNlcyB0byA9PSBJQ0NzDQogICAgICAgICAgICAgICAgYlBEID09IDEgL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c1BEID1+IFIuZGV0MSArIFIuZGV0MiArIFIuZGV0Mw0KICAgICAgICAgICAgICAgICBsZXZlbDogMg0KICAgICAgICAgICAgICAgICB0RUUgPX4gRUUyICsgRUUzICsgRUU0IA0KICAgICAgICAgICAgICAgICB0UEQgPX4gUi5kZXQxICsgUi5kZXQyICsgUi5kZXQzJywgZGF0YSA9IGRhdCwgY2x1c3RlciA9ICJJRCIsIA0KICAgICAgICAgICAgICAgICBzdGQubHYgPSBUUlVFLCBlc3RpbWF0b3IgPSAiTUxSIikgIyBzdGFuZGFyZGl6ZWQgbGF0ZW50IHZhcmlhYmxlcywgTUxSIGR1ZSB0byBub24tbm9ybWFsIGRpc3RyDQpwYXJhbWV0ZXJlc3RpbWF0ZXMoY29uZmlnMilbcGFyYW1ldGVyZXN0aW1hdGVzKGNvbmZpZzIpJG9wPT0ifn4iICYgcGFyYW1ldGVyZXN0aW1hdGVzKGNvbmZpZzIpJGVzdDwwLF0gIyBIZXl3b29kIG9uIEVFMw0KY29uZmlnMi5maXggPC0gJ2xldmVsOiAxDQogICAgICAgICAgICAgICAgIHNFRSA9fiBFRTIgKyBFRTMgKyBFRTQgDQogICAgICAgICAgICAgICAgIHNQRCA9fiBSLmRldDEgKyBSLmRldDIgKyBSLmRldDMNCiAgICAgICAgICAgICAgICAgbGV2ZWw6IDINCiAgICAgICAgICAgICAgICAgdEVFID1+IEVFMiArIEVFMyArIEVFNCANCiAgICAgICAgICAgICAgICAgdFBEID1+IFIuZGV0MSArIFIuZGV0MiArIFIuZGV0Mw0KICAgICAgICAgICAgICAgICAjIyBmaXhpbmcgRUUzIGxldmVsLTIgdmFyaWFuY2UgdG8gcmhvMg0KICAgICAgICAgICAgICAgICBFRTMgfn4gcmhvMipFRTMnDQpjb25maWcyLmZpeCA8LSBjZmEoZ3N1YigicmhvMiIsRUUzdmFybHYyKi4xNSxjb25maWcyLmZpeCksDQogICAgICAgICAgICAgICAgICAgIGRhdGEgPSBkYXQsIGNsdXN0ZXIgP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