Escenario unidimensional 4- 7 opciones n = 100

  1. Se establece la primera matriz de correlación 4x4 alta
library(LikertMakeR) #library for create the initial cor matrix
items <- 4 # 4 variable per factor
alpha <- 0.25 # alpha for LOWER correlations
variance <- 0.3
set.seed(142)
cor_matrix142 <- makeCorrAlpha(items = items, alpha = alpha, variance = variance)
## correlation values consistent with desired alpha in 4015 iterations
## The correlation matrix is positive definite

Establecimiento de los modelos

library(lavaan) #library to establish models
onef_cor0_load03_05 <- '
  F1 =~ 0.35*x1 + 0.40*x2 + 0.45*x3+0.49*x4' #low fact loading

onef_cor0_load05_07 <- '
  F1 =~ 0.55*x1 + 0.60*x2 + 0.65*x3+0.70*x4' #moderate fact loading, orthogonal

onef_cor0_load07_9 <- '
  F1 =~ 0.75*x1 + 0.80*x2 + 0.85*x3+0.90*x4' #High fact loading, orthogonal
mod1f<- c(onef_cor0_load03_05, onef_cor0_load05_07, onef_cor0_load07_9 )

Se crea la segunda matriz de correlación

library(doParallel) #library for parallel process
library(foreach) #library for conditional coding 
data <- list(NULL) # initial data 
iter<-500 # iterations
registerDoParallel(cores = 2) # cores for dev.
cor_matrices <- list(NULL) # cor matrix
n <- 100 # sample size


clean_matrix <- function(mat) {
  if (is.matrix(mat)) {
    # Suppress rows and cols names
    rownames(mat) <- NULL
    colnames(mat) <- NULL
    # Verify every object is numeric
    as.matrix(mat)
  } else {
    stop("No matrix")
  }
}


for (i in 1:iter) {
  data[[i]] <- lapply(1:3, function(b) {
    lavaan::simulateData(model = mod1f[[b]], sample.nobs = n, ov.var = cor_matrix142, 
                         model.type = "cfa", return.type = "data.frame", 
                         return.fit = FALSE, standardized = FALSE)
  })
  
  cor_matrices[[i]] <- lapply(data[[i]], function(df) {
    cor_matrix <- cor(as.matrix(df))
    clean_matrix(cor_matrix)
  })
}

Se realizan las bases de datos con 4 y 7 opciones de respuesta

library(MASS)
base_likert4 <- list(NULL) # final data set 4 options
base_likert7 <- list(NULL) # final data set 7 options

set.seed(142)
for (i in 1:iter) {
  base_likert4[[i]] <- lapply(1:3, function(j) {
    cor_matrix <- cor_matrices[[i]][[j]] #matrix correlations
    
    continuous_data <- mvrnorm(n = n, mu = rep(0, ncol(cor_matrix)), Sigma = cor_matrix) # simulation continous variables
    
    likert_data <- apply(continuous_data, 2, function(x) {
      cut(x, breaks = quantile(x, probs = seq(0, 1, by = 0.25)), labels = FALSE, include.lowest = TRUE)
    }) #discretization 
    
    #data frame - numeric
    likert_data <- as.data.frame(likert_data)
    likert_data[] <- lapply(likert_data, as.numeric)  
      return(likert_data)
  })
}

set.seed(142)
for (i in 1:iter) {
  base_likert7[[i]] <- lapply(1:3, function(j) {
    cor_matrix <- cor_matrices[[i]][[j]] #matrix correlations
    
    continuous_data <- mvrnorm(n = n, mu = rep(0, ncol(cor_matrix)), Sigma = cor_matrix) # simulation continous variables
    
    likert_data <- apply(continuous_data, 2, function(x) {
      cut(x, breaks = quantile(x, probs = seq(0, 1, by = 1/7)), labels = FALSE, include.lowest = TRUE)
    }) #discretization 
    
    #data frame - numeric
    likert_data <- as.data.frame(likert_data)
    likert_data[] <- lapply(likert_data, as.numeric)  
      return(likert_data)
  })
}

Se estiman las correlaciones de Pearson y Spearman para cada caso

cor_pearson4 <- list(NULL) # pearson correlations matrix based on 4 options
cor_spearman4 <- list(NULL) # spearman correlation matrix based on 4 options
cor_pearson7 <- list(NULL) # pearson correlations matrix based on 7 options
cor_spearman7 <- list(NULL) # spearman correlation matrix based on 7 options

set.seed(142)
for (i in 1:iter) {
  cor_pearson4[[i]] <- foreach(dataset = base_likert4[[i]], .combine = 'list', .multicombine = TRUE, .options.RNG = 142) %dopar% {
    cor_matrixp <- cor(as.matrix(dataset)) 
    clean_matrix(cor_matrixp)
  }
  cor_spearman4[[i]] <- foreach(dataset = base_likert4[[i]], .combine = 'list', .multicombine = TRUE, .options.RNG = 142) %dopar% {
    cor_matrixsp <- cor(as.matrix(dataset), method = "spearman") 
    clean_matrix(cor_matrixsp)
  }
}

set.seed(142)
for (i in 1:iter) {
  cor_pearson7[[i]] <- foreach(dataset = base_likert7[[i]], .combine = 'list', .multicombine = TRUE, .options.RNG = 142) %dopar% {
    cor_matrixp <- cor(as.matrix(dataset)) 
    clean_matrix(cor_matrixp)
  }
  cor_spearman7[[i]] <- foreach(dataset = base_likert7[[i]], .combine = 'list', .multicombine = TRUE, .options.RNG = 142) %dopar% {
    cor_matrixsp <- cor(as.matrix(dataset), method = "spearman") 
    clean_matrix(cor_matrixsp)
  }
}

Comparación matrices promediando todos los modelos latentes

mean_cor_lavaan <- matrix(0, nrow = nrow(cor_matrices[[1]][[1]]), ncol = ncol(cor_matrices[[1]][[1]]))

for (i in 1:iter) {
  for (j in 1:3) {  # Tienes 3 modelos
    mean_cor_lavaan <- mean_cor_lavaan + abs(cor_matrices[[i]][[j]])
  }
}
mean_cor_lavaan <- mean_cor_lavaan / (iter * 3)

Se obtiene el promedio de las matrices de Pearson y Spearman acorde al número de opciones

mean_cor_pearson4 <- matrix(0, nrow = nrow(cor_pearson4[[1]][[1]]), ncol = ncol(cor_pearson4[[1]][[1]]))

for (i in 1:iter) {
  for (j in 1:3) {
    mean_cor_pearson4 <- mean_cor_pearson4 + abs(cor_pearson4[[i]][[j]])
  }
}
mean_cor_pearson4 <- mean_cor_pearson4 / (iter * 3)

mean_cor_spearman4 <- matrix(0, nrow = nrow(cor_spearman4[[1]][[1]]), ncol = ncol(cor_spearman4[[1]][[1]]))

# Promediar las matrices Spearman de 4 opciones
for (i in 1:iter) {
  for (j in 1:3) {
    mean_cor_spearman4 <- mean_cor_spearman4 + abs(cor_spearman4[[i]][[j]])
  }
}

# Dividir por el número total de matrices
mean_cor_spearman4 <- mean_cor_spearman4 / (iter * 3)

mean_cor_pearson7 <- matrix(0, nrow = nrow(cor_pearson7[[1]][[1]]), ncol = ncol(cor_pearson7[[1]][[1]]))

for (i in 1:iter) {
  for (j in 1:3) {
    mean_cor_pearson7 <- mean_cor_pearson7 + abs(cor_pearson7[[i]][[j]])
  }
}
mean_cor_pearson7 <- mean_cor_pearson7 / (iter * 3)

mean_cor_spearman7 <- matrix(0, nrow = nrow(cor_spearman7[[1]][[1]]), ncol = ncol(cor_spearman7[[1]][[1]]))

# Promediar las matrices Spearman de 4 opciones
for (i in 1:iter) {
  for (j in 1:3) {
    mean_cor_spearman7 <- mean_cor_spearman7 + abs(cor_spearman7[[i]][[j]])
  }
}

# Dividir por el número total de matrices
mean_cor_spearman7 <- mean_cor_spearman7 / (iter * 3)

Matriz inicial

##             [,1]       [,2]        [,3]       [,4]
## [1,]  1.00000000 -0.1902365 -0.05870172 0.09173024
## [2,] -0.19023649  1.0000000  0.13071937 0.22397942
## [3,] -0.05870172  0.1307194  1.00000000 0.26414735
## [4,]  0.09173024  0.2239794  0.26414735 1.00000000

Matriz simulada lavaan promediada

##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3305637 0.3310585 0.2735300
## [2,] 0.3305637 1.0000000 0.4983716 0.3923321
## [3,] 0.3310585 0.4983716 1.0000000 0.3893279
## [4,] 0.2735300 0.3923321 0.3893279 1.0000000

Matriz simulada Pearson 4 opciones promediada

##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.2907947 0.2903307 0.2464480
## [2,] 0.2907947 1.0000000 0.4340000 0.3439147
## [3,] 0.2903307 0.4340000 1.0000000 0.3390187
## [4,] 0.2464480 0.3439147 0.3390187 1.0000000

Matriz simulada Spearman 4 opciones promediada

##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.2907947 0.2903307 0.2464480
## [2,] 0.2907947 1.0000000 0.4340000 0.3439147
## [3,] 0.2903307 0.4340000 1.0000000 0.3390187
## [4,] 0.2464480 0.3439147 0.3390187 1.0000000

Matriz simulada Pearson 7 opciones promediada

##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3075203 0.3085821 0.2587886
## [2,] 0.3075203 1.0000000 0.4612976 0.3658959
## [3,] 0.3085821 0.4612976 1.0000000 0.3617220
## [4,] 0.2587886 0.3658959 0.3617220 1.0000000

Matriz simulada Spearman 7 opciones promediada

##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3079021 0.3089412 0.2590866
## [2,] 0.3079021 1.0000000 0.4618033 0.3663312
## [3,] 0.3089412 0.4618033 1.0000000 0.3621527
## [4,] 0.2590866 0.3663312 0.3621527 1.0000000

Visualización diferencias globales

diff_pearson4 <- mean_cor_lavaan - mean_cor_pearson4
diff_spearman4 <- mean_cor_lavaan - mean_cor_spearman4
diff_pearson7 <- mean_cor_lavaan - mean_cor_pearson7
diff_spearman7 <- mean_cor_lavaan - mean_cor_spearman7

library(reshape2)
library(dplyr)

# Melt de las diferencias y añadir una columna indicando la matriz
melt_diff_pearson4 <- melt(diff_pearson4) %>% mutate(method = "Pearson (4 opciones)")
melt_diff_spearman4 <- melt(diff_spearman4) %>% mutate(method = "Spearman (4 opciones)")
melt_diff_pearson7 <- melt(diff_pearson7) %>% mutate(method = "Pearson (7 opciones)")
melt_diff_spearman7 <- melt(diff_spearman7) %>% mutate(method = "Spearman (7 opciones)")

# Combinar todas las matrices en un solo data frame
all_diffs <- bind_rows(melt_diff_pearson4, melt_diff_spearman4, melt_diff_pearson7, melt_diff_spearman7)


library(ggplot2)

# Crear el heatmap con facetas para visualizar las diferencias de todas las matrices
ggplot(data = all_diffs, aes(x = Var1, y = Var2, fill = value)) +
  geom_tile() +
  scale_fill_gradient2(low = "blue", high = "red", mid = "white", 
                       midpoint = 0, limit = c(min(all_diffs$value), max(all_diffs$value))) +
  theme_minimal() +
  labs(title = "Diferencias entre Lavaan y Pearson/Spearman", 
       x = "Variable 1", y = "Variable 2", fill = "Diferencia") +
  facet_wrap(~method)  # Facetear por el tipo de método y número de opciones

Revisando los datos de las matrices

Diferencias entre Lavaan y Pearson (4 opciones)

##            [,1]       [,2]      [,3]       [,4]
## [1,] 0.00000000 0.03976904 0.0407278 0.02708202
## [2,] 0.03976904 0.00000000 0.0643716 0.04841741
## [3,] 0.04072780 0.06437160 0.0000000 0.05030920
## [4,] 0.02708202 0.04841741 0.0503092 0.00000000

Diferencias entre Lavaan y Spearman (4 opciones):

##            [,1]       [,2]      [,3]       [,4]
## [1,] 0.00000000 0.03976904 0.0407278 0.02708202
## [2,] 0.03976904 0.00000000 0.0643716 0.04841741
## [3,] 0.04072780 0.06437160 0.0000000 0.05030920
## [4,] 0.02708202 0.04841741 0.0503092 0.00000000

Diferencias entre Lavaan y Pearson (7 opciones)

##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.02304338 0.02247636 0.01474141
## [2,] 0.02304338 0.00000000 0.03707404 0.02643614
## [3,] 0.02247636 0.03707404 0.00000000 0.02760591
## [4,] 0.01474141 0.02643614 0.02760591 0.00000000

Diferencias entre Lavaan y Spearman (7 opciones)

##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.02266161 0.02211730 0.01444344
## [2,] 0.02266161 0.00000000 0.03656828 0.02600090
## [3,] 0.02211730 0.03656828 0.00000000 0.02717518
## [4,] 0.01444344 0.02600090 0.02717518 0.00000000

Revisando el detalle por modelos latentes

MATRIZ INICIAL lavaan

mean_cor_lavaan_esp <- list()
for (j in 1:3) {
  mean_cor_lavaan_esp[[j]] <- matrix(0, nrow = nrow(cor_matrices[[1]][[1]]), ncol = ncol(cor_matrices[[1]][[1]]))
}

for (i in 1:iter) {
  for (j in 1:3) {
    mean_cor_lavaan_esp[[j]] <- mean_cor_lavaan_esp[[j]] + abs(cor_matrices[[i]][[j]])
  }
}

for (j in 1:3) {
  mean_cor_lavaan_esp[[j]] <- mean_cor_lavaan_esp[[j]] / iter 
}

names(mean_cor_lavaan_esp) <- c("Carga factorial baja", "Carga factorial moderada", "Carga factorial alta")

print(mean_cor_lavaan_esp)
## $`Carga factorial baja`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.2307027 0.2355920 0.1469768
## [2,] 0.2307027 1.0000000 0.5007059 0.3082338
## [3,] 0.2355920 0.5007059 1.0000000 0.3036163
## [4,] 0.1469768 0.3082338 0.3036163 1.0000000
## 
## $`Carga factorial moderada`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3403935 0.3382157 0.2768255
## [2,] 0.3403935 1.0000000 0.4972190 0.3967971
## [3,] 0.3382157 0.4972190 1.0000000 0.4012111
## [4,] 0.2768255 0.3967971 0.4012111 1.0000000
## 
## $`Carga factorial alta`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.4205949 0.4193678 0.3967878
## [2,] 0.4205949 1.0000000 0.4971899 0.4719653
## [3,] 0.4193678 0.4971899 1.0000000 0.4631563
## [4,] 0.3967878 0.4719653 0.4631563 1.0000000

Matrices de Pearson por modelo con 4 opciones de respuesta

mean_cor_pearson_esp <- list()

for (j in 1:3) {
  mean_cor_pearson_esp[[j]] <- matrix(0, nrow = nrow(cor_pearson4[[1]][[1]]), ncol = ncol(cor_pearson4[[1]][[1]]))
}

for (i in 1:iter) {
  for (j in 1:3) {  
    mean_cor_pearson_esp[[j]] <- mean_cor_pearson_esp[[j]] + abs(cor_pearson4[[i]][[j]])
  }
}

for (j in 1:3) {
  mean_cor_pearson_esp[[j]] <- mean_cor_pearson_esp[[j]] / iter
}
names(mean_cor_pearson_esp) <- c("Carga factorial baja", "Carga factorial moderada", "Carga factorial alta")

print(mean_cor_pearson_esp)
## $`Carga factorial baja`
##          [,1]     [,2]     [,3]     [,4]
## [1,] 1.000000 0.204992 0.203856 0.143360
## [2,] 0.204992 1.000000 0.434256 0.270032
## [3,] 0.203856 0.434256 1.000000 0.266048
## [4,] 0.143360 0.270032 0.266048 1.000000
## 
## $`Carga factorial moderada`
##          [,1]     [,2]     [,3]     [,4]
## [1,] 1.000000 0.300768 0.297392 0.248832
## [2,] 0.300768 1.000000 0.430608 0.346032
## [3,] 0.297392 0.430608 1.000000 0.348848
## [4,] 0.248832 0.346032 0.348848 1.000000
## 
## $`Carga factorial alta`
##          [,1]     [,2]     [,3]     [,4]
## [1,] 1.000000 0.366624 0.369744 0.347152
## [2,] 0.366624 1.000000 0.437136 0.415680
## [3,] 0.369744 0.437136 1.000000 0.402160
## [4,] 0.347152 0.415680 0.402160 1.000000

Matrices de Spearman por modelo con 4 opciones de respuesta

mean_cor_spearman_esp <- list()

for (j in 1:3) {
  mean_cor_spearman_esp[[j]] <- matrix(0, nrow = nrow(cor_spearman4[[1]][[1]]), ncol = ncol(cor_spearman4[[1]][[1]]))
}

for (i in 1:iter) {
  for (j in 1:3) {  
    mean_cor_spearman_esp[[j]] <- mean_cor_spearman_esp[[j]] + abs(cor_spearman4[[i]][[j]])
  }
}

for (j in 1:3) {
  mean_cor_spearman_esp[[j]] <- mean_cor_spearman_esp[[j]] / iter
}

names(mean_cor_spearman_esp) <- c("Carga factorial baja", "Carga factorial moderada", "Carga factorial alta")
print(mean_cor_spearman_esp)
## $`Carga factorial baja`
##          [,1]     [,2]     [,3]     [,4]
## [1,] 1.000000 0.204992 0.203856 0.143360
## [2,] 0.204992 1.000000 0.434256 0.270032
## [3,] 0.203856 0.434256 1.000000 0.266048
## [4,] 0.143360 0.270032 0.266048 1.000000
## 
## $`Carga factorial moderada`
##          [,1]     [,2]     [,3]     [,4]
## [1,] 1.000000 0.300768 0.297392 0.248832
## [2,] 0.300768 1.000000 0.430608 0.346032
## [3,] 0.297392 0.430608 1.000000 0.348848
## [4,] 0.248832 0.346032 0.348848 1.000000
## 
## $`Carga factorial alta`
##          [,1]     [,2]     [,3]     [,4]
## [1,] 1.000000 0.366624 0.369744 0.347152
## [2,] 0.366624 1.000000 0.437136 0.415680
## [3,] 0.369744 0.437136 1.000000 0.402160
## [4,] 0.347152 0.415680 0.402160 1.000000

Matrices de Pearson por modelo con 7 opciones de respuesta

mean_cor_pearson_esp7 <- list()

for (j in 1:3) {
  mean_cor_pearson_esp7[[j]] <- matrix(0, nrow = nrow(cor_pearson7[[1]][[1]]), ncol = ncol(cor_pearson7[[1]][[1]]))
}

for (i in 1:iter) {
  for (j in 1:3) {  
    mean_cor_pearson_esp7[[j]] <- mean_cor_pearson_esp7[[j]] + abs(cor_pearson7[[i]][[j]])
  }
}

for (j in 1:3) {
  mean_cor_pearson_esp7[[j]] <- mean_cor_pearson_esp7[[j]] / iter
}
names(mean_cor_pearson_esp7) <- c("Carga factorial baja", "Carga factorial moderada", "Carga factorial alta")

print(mean_cor_pearson_esp7)
## $`Carga factorial baja`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.2187902 0.2191073 0.1498732
## [2,] 0.2187902 1.0000000 0.4624390 0.2866439
## [3,] 0.2191073 0.4624390 1.0000000 0.2830634
## [4,] 0.1498732 0.2866439 0.2830634 1.0000000
## 
## $`Carga factorial moderada`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3177610 0.3151659 0.2596829
## [2,] 0.3177610 1.0000000 0.4591415 0.3713268
## [3,] 0.3151659 0.4591415 1.0000000 0.3728878
## [4,] 0.2596829 0.3713268 0.3728878 1.0000000
## 
## $`Carga factorial alta`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3860098 0.3914732 0.3668098
## [2,] 0.3860098 1.0000000 0.4623122 0.4397171
## [3,] 0.3914732 0.4623122 1.0000000 0.4292146
## [4,] 0.3668098 0.4397171 0.4292146 1.0000000

Matrices de Spearman para cada modelo 7 opciones de respuesta

mean_cor_spearman_esp7 <- list()

for (j in 1:3) {
  mean_cor_spearman_esp7[[j]] <- matrix(0, nrow = nrow(cor_spearman7[[1]][[1]]), ncol = ncol(cor_spearman7[[1]][[1]]))
}

for (i in 1:iter) {
  for (j in 1:3) {  
    mean_cor_spearman_esp7[[j]] <- mean_cor_spearman_esp7[[j]] + abs(cor_spearman7[[i]][[j]])
  }
}

for (j in 1:3) {
  mean_cor_spearman_esp7[[j]] <- mean_cor_spearman_esp7[[j]] / iter
}
names(mean_cor_spearman_esp7) <- c("Carga factorial baja", "Carga factorial moderada", "Carga factorial alta")

print(mean_cor_spearman_esp7)
## $`Carga factorial baja`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.2190817 0.2194118 0.1500031
## [2,] 0.2190817 1.0000000 0.4629531 0.2869897
## [3,] 0.2194118 0.4629531 1.0000000 0.2834109
## [4,] 0.1500031 0.2869897 0.2834109 1.0000000
## 
## $`Carga factorial moderada`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3181631 0.3155205 0.2600045
## [2,] 0.3181631 1.0000000 0.4596615 0.3718030
## [3,] 0.3155205 0.4596615 1.0000000 0.3733631
## [4,] 0.2600045 0.3718030 0.3733631 1.0000000
## 
## $`Carga factorial alta`
##           [,1]      [,2]      [,3]      [,4]
## [1,] 1.0000000 0.3864616 0.3918912 0.3672522
## [2,] 0.3864616 1.0000000 0.4627953 0.4402008
## [3,] 0.3918912 0.4627953 1.0000000 0.4296841
## [4,] 0.3672522 0.4402008 0.4296841 1.0000000

#Estimando las diferencias entre las matrices Diferencias entre Lavaan y Pearson (4 opciones) por modelo

diff_lavaan_pearson4_esp <- list()
diff_lavaan_spearman4_esp <- list()
diff_lavaan_pearson7_esp <- list()
diff_lavaan_spearman7_esp <- list()


for (j in 1:3) {
  diff_lavaan_pearson4_esp[[j]] <- mean_cor_lavaan_esp[[j]] - mean_cor_pearson_esp[[j]]
  diff_lavaan_spearman4_esp[[j]] <- mean_cor_lavaan_esp[[j]] - mean_cor_spearman_esp[[j]]
  diff_lavaan_pearson7_esp[[j]] <- mean_cor_lavaan_esp[[j]] - mean_cor_pearson_esp7[[j]]
  diff_lavaan_spearman7_esp[[j]] <- mean_cor_lavaan_esp[[j]] - mean_cor_spearman_esp7[[j]]
}
names(diff_lavaan_pearson4_esp) <- c("Carga factorial baja", "Carga factorial moderada", "Carga factorial alta")
print(diff_lavaan_pearson4_esp)
## $`Carga factorial baja`
##             [,1]       [,2]       [,3]        [,4]
## [1,] 0.000000000 0.02571073 0.03173599 0.003616767
## [2,] 0.025710735 0.00000000 0.06644989 0.038201829
## [3,] 0.031735991 0.06644989 0.00000000 0.037568254
## [4,] 0.003616767 0.03820183 0.03756825 0.000000000
## 
## $`Carga factorial moderada`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.03962554 0.04082366 0.02799353
## [2,] 0.03962554 0.00000000 0.06661099 0.05076510
## [3,] 0.04082366 0.06661099 0.00000000 0.05236306
## [4,] 0.02799353 0.05076510 0.05236306 0.00000000
## 
## $`Carga factorial alta`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.05397085 0.04962376 0.04963578
## [2,] 0.05397085 0.00000000 0.06005392 0.05628529
## [3,] 0.04962376 0.06005392 0.00000000 0.06099627
## [4,] 0.04963578 0.05628529 0.06099627 0.00000000

Diferencias entre Lavaan y Spearman (4 opciones) por modelo

## $`Carga factorial baja`
##             [,1]       [,2]       [,3]        [,4]
## [1,] 0.000000000 0.02571073 0.03173599 0.003616767
## [2,] 0.025710735 0.00000000 0.06644989 0.038201829
## [3,] 0.031735991 0.06644989 0.00000000 0.037568254
## [4,] 0.003616767 0.03820183 0.03756825 0.000000000
## 
## $`Carga factorial moderada`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.03962554 0.04082366 0.02799353
## [2,] 0.03962554 0.00000000 0.06661099 0.05076510
## [3,] 0.04082366 0.06661099 0.00000000 0.05236306
## [4,] 0.02799353 0.05076510 0.05236306 0.00000000
## 
## $`Carga factorial alta`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.05397085 0.04962376 0.04963578
## [2,] 0.05397085 0.00000000 0.06005392 0.05628529
## [3,] 0.04962376 0.06005392 0.00000000 0.06099627
## [4,] 0.04963578 0.05628529 0.06099627 0.00000000

Diferencias entre Lavaan y Pearson (7 opciones) por modelo

## $`Carga factorial baja`
##              [,1]       [,2]       [,3]         [,4]
## [1,]  0.000000000 0.01191249 0.01648467 -0.002896403
## [2,]  0.011912491 0.00000000 0.03826687  0.021589926
## [3,]  0.016484674 0.03826687 0.00000000  0.020552839
## [4,] -0.002896403 0.02158993 0.02055284  0.000000000
## 
## $`Carga factorial moderada`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.02263256 0.02304981 0.01714260
## [2,] 0.02263256 0.00000000 0.03807752 0.02547027
## [3,] 0.02304981 0.03807752 0.00000000 0.02832326
## [4,] 0.01714260 0.02547027 0.02832326 0.00000000
## 
## $`Carga factorial alta`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.03458510 0.02789459 0.02997802
## [2,] 0.03458510 0.00000000 0.03487773 0.03224822
## [3,] 0.02789459 0.03487773 0.00000000 0.03394164
## [4,] 0.02997802 0.03224822 0.03394164 0.00000000

Diferencias entre Lavaan y Spearman (7 opciones) por modelo

## $`Carga factorial baja`
##              [,1]       [,2]       [,3]         [,4]
## [1,]  0.000000000 0.01162108 0.01618021 -0.003026283
## [2,]  0.011621083 0.00000000 0.03775279  0.021244095
## [3,]  0.016180206 0.03775279 0.00000000  0.020205326
## [4,] -0.003026283 0.02124410 0.02020533  0.000000000
## 
## $`Carga factorial moderada`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.02223047 0.02269516 0.01682100
## [2,] 0.02223047 0.00000000 0.03755746 0.02499413
## [3,] 0.02269516 0.03755746 0.00000000 0.02784801
## [4,] 0.01682100 0.02499413 0.02784801 0.00000000
## 
## $`Carga factorial alta`
##            [,1]       [,2]       [,3]       [,4]
## [1,] 0.00000000 0.03413327 0.02747654 0.02953559
## [2,] 0.03413327 0.00000000 0.03439458 0.03176447
## [3,] 0.02747654 0.03439458 0.00000000 0.03347222
## [4,] 0.02953559 0.03176447 0.03347222 0.00000000