INSPEÇÃO DOS DADOS
# 1.1 Carregamento de Pacotes
pacotes <- c("tidyverse", "psych", "lavaan", "semTools",
"blavaan", "qgraph", "bootnet", "MVN", "readxl")
lapply(pacotes, require, character.only = TRUE)
## [[1]]
## [1] TRUE
##
## [[2]]
## [1] TRUE
##
## [[3]]
## [1] TRUE
##
## [[4]]
## [1] TRUE
##
## [[5]]
## [1] TRUE
##
## [[6]]
## [1] TRUE
##
## [[7]]
## [1] FALSE
##
## [[8]]
## [1] TRUE
##
## [[9]]
## [1] TRUE
# 1.2 Importação e Preparação
df <- read_excel("bancodedados.xlsx")
#Verificação estrutural do objeto
# A saída esperada deve incluir "tbl_df", "tbl" e "data.frame"
class(df)
## [1] "tbl_df" "tbl" "data.frame"
# Seleção do subset de itens da escala e variáveis externas para validação
df_escala <- df %>%
select(q01, q02_rev, q03_rev, q04, q05, q06, q07, q08, q09,
q10, q11, q12, q13_rev, q14_rev)
# Inversão matemática dos itens reversos (Escala Likert de 1 a 7)
# Fórmula: Max + Min - Escore (7 + 1 - x = 8 - x)
df_escala <- df_escala %>%
mutate(across(c(q02_rev, q03_rev, q13_rev, q14_rev), ~ 8 - .))
# 1.3 Análise Descritiva e Pressupostos Multivariados
# Estatísticas descritivas básicas (média, desvio padrão, assimetria, curtose)
descritivas <- psych::describe(df_escala)
print(descritivas)
## vars n mean sd median trimmed mad min max range skew kurtosis
## q01 1 309 6.70 1.01 7 6.96 0.00 1 7 6 -4.17 18.08
## q02_rev 2 309 6.20 1.87 7 6.72 0.00 1 7 6 -2.17 2.99
## q03_rev 3 309 6.37 1.71 7 6.90 0.00 1 7 6 -2.54 4.74
## q04 4 309 6.32 1.21 7 6.59 0.00 1 7 6 -2.09 4.35
## q05 5 309 6.21 1.40 7 6.54 0.00 1 7 6 -2.02 3.58
## q06 6 309 6.23 1.33 7 6.54 0.00 1 7 6 -2.07 4.11
## q07 7 309 6.38 1.21 7 6.67 0.00 1 7 6 -2.37 5.95
## q08 8 309 6.43 1.22 7 6.73 0.00 1 7 6 -2.63 7.23
## q09 9 309 6.51 1.09 7 6.78 0.00 1 7 6 -3.03 10.47
## q10 10 309 5.83 1.44 6 6.05 1.48 1 7 6 -1.18 0.93
## q11 11 309 5.76 1.46 6 5.98 1.48 1 7 6 -1.09 0.60
## q12 12 309 5.68 1.53 6 5.91 1.48 1 7 6 -1.01 0.30
## q13_rev 13 309 5.39 1.83 6 5.67 1.48 1 7 6 -0.91 -0.27
## q14_rev 14 309 5.87 1.71 7 6.22 0.00 1 7 6 -1.53 1.36
## se
## q01 0.06
## q02_rev 0.11
## q03_rev 0.10
## q04 0.07
## q05 0.08
## q06 0.08
## q07 0.07
## q08 0.07
## q09 0.06
## q10 0.08
## q11 0.08
## q12 0.09
## q13_rev 0.10
## q14_rev 0.10
# Avaliação da normalidade multivariada (Teste de Mardia)
# Essencial para justificar o uso de estimadores robustos na CFA
normalidade_multivariada <- psych::mardia(df_escala, plot = FALSE)
print(normalidade_multivariada)
## Call: psych::mardia(x = df_escala, plot = FALSE)
##
## Mardia tests of multivariate skew and kurtosis
## Use describe(x) the to get univariate tests
## n.obs = 309 num.vars = 14
## b1p = 132.9 skew = 6844.41 with probability <= 0
## small sample skew = 6919.79 with probability <= 0
## b2p = 471.76 kurtosis = 102.88 with probability <= 0
DADOS AUSENTES
A análise de dados ausentes é conduzida para determinar a viabilidade de técnicas de imputação múltipla ou estimação por máxima verossimilhança com informação completa (FIML) em etapas posteriores.
# Instalação (se necessário) e carregamento de pacotes específicos
pacotes_missing <- c("naniar", "VIM", "tidyverse")
lapply(pacotes_missing, require, character.only = TRUE)
## [[1]]
## [1] TRUE
##
## [[2]]
## [1] TRUE
##
## [[3]]
## [1] TRUE
# Assume-se que o objeto df_escala (contendo apenas os itens do instrumento) já está carregado
# 1. Quantificação Absoluta e Relativa
# Gera um sumário com o número de observações ausentes (n_miss) e a porcentagem (pct_miss) por variável
sumario_ausentes <- miss_var_summary(df_escala)
print("Sumário de Variáveis com Dados Ausentes:")
## [1] "Sumário de Variáveis com Dados Ausentes:"
print(sumario_ausentes)
## # A tibble: 14 × 3
## variable n_miss pct_miss
## <chr> <int> <num>
## 1 q01 0 0
## 2 q02_rev 0 0
## 3 q03_rev 0 0
## 4 q04 0 0
## 5 q05 0 0
## 6 q06 0 0
## 7 q07 0 0
## 8 q08 0 0
## 9 q09 0 0
## 10 q10 0 0
## 11 q11 0 0
## 12 q12 0 0
## 13 q13_rev 0 0
## 14 q14_rev 0 0
# 2. Visualização do Padrão de Ausência
# O gráfico 'aggr' fornece a proporção de NAs e ilustra combinações de ausência simultânea entre variáveis
grafico_padrao_na <- VIM::aggr(df_escala,
col = c('navyblue', 'red'),
numbers = TRUE,
sortVars = TRUE,
labels = names(df_escala),
cex.axis = .7,
gap = 3,
ylab = c("Proporção de Missing", "Padrão Combinado de Missing"))
##
## Variables sorted by number of missings:
## Variable Count
## q01 0
## q02_rev 0
## q03_rev 0
## q04 0
## q05 0
## q06 0
## q07 0
## q08 0
## q09 0
## q10 0
## q11 0
## q12 0
## q13_rev 0
## q14_rev 0
# 3. Teste de Mecanismo de Perda (Teste MCAR de Little)
# Avalia a hipótese nula (H0) de que os dados são Ausentes Completamente ao Acaso (MCAR).
# Um p-valor > 0.05 falha em rejeitar H0, sugerindo que a perda de dados é estocástica.
teste_little <- mcar_test(df_escala)
print("Resultado do Teste MCAR de Little:")
## [1] "Resultado do Teste MCAR de Little:"
print(teste_little)
## # A tibble: 1 × 4
## statistic df p.value missing.patterns
## <dbl> <dbl> <dbl> <int>
## 1 2.08e-27 0 0 1
ANÁLISE FATORIAL EXPLORATÓRIA
# Instalação e carregamento dos pacotes necessários
# install.packages("psych")
# install.packages("dplyr")
library(psych)
library(dplyr)
# 1. Preparação do Banco de Dados
# Certifique-se de que df_escala contenha exclusivamente os 14 itens (q01 a q14_rev)
df_efa <- df_escala %>%
mutate(across(everything(), as.numeric))
# 2. Análise Paralela para Retenção Fatorial
# Estima o número de fatores comparando os autovalores empíricos com autovalores simulados ao acaso.
# O argumento cor = "poly" garante o tratamento adequado da natureza ordinal.
set.seed(123) # Reprodutibilidade das simulações
analise_paralela <- fa.parallel(df_efa,
cor = "poly",
fm = "wls", # Mínimos Quadrados Ponderados
fa = "fa", # Restringe o output apenas à análise de fatores
n.iter = 500, # Número de matrizes aleatórias simuladas
main = "Análise Paralela - Matriz Policórica")
## Parallel analysis suggests that the number of factors = 5 and the number of components = NA
# O console reportará o número sugerido de fatores.
# 3. Estimação da Matriz de Correlação Policórica
matriz_poli <- polychoric(df_efa)$rho
# 4. Análise Fatorial Exploratória (AFE)
# Ajuste o parâmetro 'nfactors' conforme o output empírico da Análise Paralela.
# Mantido nfactors = 5 para alinhamento com a dimensionalidade teórica testada anteriormente.
modelo_afe <- fa(r = matriz_poli,
n.obs = nrow(df_efa),
nfactors = 5,
rotate = "oblimin", # Rotação oblíqua devido à correlação esperada entre os fatores
fm = "wls") # Estimador adequado para violações de normalidade multivariada
# 5. Visualização das Cargas Fatoriais e Índices de Ajuste
# O argumento 'cut = 0.3' omite cargas residuais inferiores a 0.30 para clareza visual.
print(modelo_afe, cut = 0.3, sort = TRUE)
## Factor Analysis using method = wls
## Call: fa(r = matriz_poli, nfactors = 5, n.obs = nrow(df_efa), rotate = "oblimin",
## fm = "wls")
## Standardized loadings (pattern matrix) based upon correlation matrix
## item WLS5 WLS1 WLS2 WLS3 WLS4 h2 u2 com
## q11 11 0.94 0.91 0.087 1.0
## q10 10 0.93 0.89 0.109 1.0
## q12 12 0.92 0.90 0.099 1.0
## q05 5 0.92 0.87 0.127 1.0
## q04 4 0.91 0.89 0.108 1.0
## q06 6 0.90 0.92 0.079 1.0
## q08 8 0.95 0.92 0.077 1.0
## q07 7 0.94 0.86 0.144 1.0
## q09 9 0.87 0.90 0.096 1.0
## q02_rev 2 0.83 0.67 0.329 1.0
## q03_rev 3 0.78 0.67 0.334 1.1
## q01 1 0.54 0.86 0.143 2.2
## q13_rev 13 0.86 0.78 0.224 1.0
## q14_rev 14 0.85 0.80 0.196 1.0
##
## WLS5 WLS1 WLS2 WLS3 WLS4
## SS loadings 2.87 2.84 2.82 1.75 1.57
## Proportion Var 0.20 0.20 0.20 0.13 0.11
## Cumulative Var 0.20 0.41 0.61 0.73 0.85
## Proportion Explained 0.24 0.24 0.24 0.15 0.13
## Cumulative Proportion 0.24 0.48 0.72 0.87 1.00
##
## With factor correlations of
## WLS5 WLS1 WLS2 WLS3 WLS4
## WLS5 1.00 0.62 0.70 0.29 0.45
## WLS1 0.62 1.00 0.77 0.41 0.33
## WLS2 0.70 0.77 1.00 0.52 0.39
## WLS3 0.29 0.41 0.52 1.00 0.41
## WLS4 0.45 0.33 0.39 0.41 1.00
##
## Mean item complexity = 1.1
## Test of the hypothesis that 5 factors are sufficient.
##
## df null model = 91 with the objective function = 17.39 with Chi Square = 5261.79
## df of the model are 31 and the objective function was 1.06
##
## The root mean square of the residuals (RMSR) is 0.01
## The df corrected root mean square of the residuals is 0.02
##
## The harmonic n.obs is 309 with the empirical chi square 5.88 with prob < 1
## The total n.obs was 309 with Likelihood Chi Square = 318.14 with prob < 2.3e-49
##
## Tucker Lewis Index of factoring reliability = 0.835
## RMSEA index = 0.173 and the 90 % confidence intervals are 0.156 0.191
## BIC = 140.41
## Fit based upon off diagonal values = 1
## Measures of factor score adequacy
## WLS5 WLS1 WLS2 WLS3 WLS4
## Correlation of (regression) scores with factors 0.88 0.84 0.78 0.83 0.87
## Multiple R square of scores with factors 0.77 0.71 0.60 0.69 0.75
## Minimum correlation of possible factor scores 0.55 0.43 0.21 0.38 0.50
EVIDÊNCIAS DE VALIDADE - ESTRUTURA INTERNA
# 2.1 Especificação do Modelo Pentafatorial
modelo_penta <- '
# Modelagem das Variáveis Latentes
realidade =~ q01 + q02_rev + q03_rev
causas =~ q04 + q05 + q06
valencia =~ q07 + q08 + q09
espacial =~ q10 + q11 + q12
temporal =~ q13_rev + q14_rev
'
# 2.2 Estimação do Modelo
fit_cfa <- cfa(model = modelo_penta,
data = df_escala,
ordered = names(df_escala), # Declara a natureza ordinal dos itens
estimator = "WLSMV",
bounds = TRUE)
# 2.3 Extração dos Índices de Ajuste
# Valores de referência: CFI/TLI > .95, RMSEA < .06, SRMR < .08
summary(fit_cfa, fit.measures = TRUE, standardized = TRUE, rsquare = TRUE)
## lavaan 0.7-2 ended normally after 46 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of model parameters 108
## Row rank of the constraints matrix 24
##
## Number of observations 309
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 62.942 135.369
## Degrees of freedom 67 67
## P-value (Unknown) NA 0.000
## Scaling correction factor 0.599
## Shift parameter 30.244
## simple second-order correction
##
## Model Test Baseline Model:
##
## Test statistic 59645.408 18566.560
## Degrees of freedom 91 91
## P-value NA 0.000
## Scaling correction factor 3.223
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 0.996
## Tucker-Lewis Index (TLI) 1.000 0.995
##
## Robust Comparative Fit Index (CFI) 0.953
## Robust Tucker-Lewis Index (TLI) 0.937
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 0.058
## 90 Percent confidence interval - lower 0.000 0.043
## 90 Percent confidence interval - upper 0.030 0.072
## P-value H_0: RMSEA <= 0.050 1.000 0.179
## P-value H_0: RMSEA >= 0.080 0.000 0.003
##
## Robust RMSEA 0.109
## 90 Percent confidence interval - lower 0.068
## 90 Percent confidence interval - upper 0.147
## P-value H_0: Robust RMSEA <= 0.050 0.014
## P-value H_0: Robust RMSEA >= 0.080 0.887
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.049 0.049
##
## Goodness of Fit Index:
##
## Goodness of Fit Index (GFI) 1.000
## 90 Percent confidence interval - lower 0.992
## 90 Percent confidence interval - upper 1.000
##
## Robust GFI 0.898
## 90 Percent confidence interval - lower 0.828
## 90 Percent confidence interval - upper 0.958
##
## Parameter Estimates:
##
## Parameterization Delta
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade =~
## q01 1.000 1.127 1.127
## q02_rev 0.536 0.053 10.096 0.000 0.604 0.604
## q03_rev 0.515 0.054 9.495 0.000 0.581 0.581
## causas =~
## q04 1.000 0.931 0.931
## q05 1.003 0.018 57.069 0.000 0.934 0.934
## q06 1.037 0.015 67.677 0.000 0.965 0.965
## valencia =~
## q07 1.000 0.918 0.918
## q08 1.044 0.021 50.924 0.000 0.958 0.958
## q09 1.037 0.023 44.885 0.000 0.952 0.952
## espacial =~
## q10 1.000 0.961 0.961
## q11 1.028 0.008 132.313 0.000 0.988 0.988
## q12 0.984 0.006 151.459 0.000 0.945 0.945
## temporal =~
## q13_rev 1.000 0.867 0.867
## q14_rev 1.035 0.076 13.675 0.000 0.898 0.898
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade ~~
## causas 0.670 0.048 13.975 0.000 0.639 0.639
## valencia 0.724 0.048 15.090 0.000 0.700 0.700
## espacial 0.543 0.057 9.553 0.000 0.501 0.501
## temporal 0.497 0.064 7.767 0.000 0.508 0.508
## causas ~~
## valencia 0.678 0.037 18.323 0.000 0.794 0.794
## espacial 0.569 0.040 14.280 0.000 0.636 0.636
## temporal 0.331 0.053 6.231 0.000 0.410 0.410
## valencia ~~
## espacial 0.621 0.041 15.211 0.000 0.704 0.704
## temporal 0.368 0.053 6.963 0.000 0.463 0.463
## espacial ~~
## temporal 0.411 0.045 9.199 0.000 0.493 0.493
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## q01|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q01|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q01|t3 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q01|t4 -1.727 0.127 -13.555 0.000 -1.727 -1.727
## q01|t5 -1.542 0.113 -13.683 0.000 -1.542 -1.542
## q01|t6 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q02_rev|t1 -1.357 0.101 -13.398 0.000 -1.357 -1.357
## q02_rev|t2 -1.209 0.094 -12.859 0.000 -1.209 -1.209
## q02_rev|t3 -1.160 0.092 -12.618 0.000 -1.160 -1.160
## q02_rev|t4 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q02_rev|t5 -1.041 0.087 -11.910 0.000 -1.041 -1.041
## q02_rev|t6 -0.863 0.082 -10.525 0.000 -0.863 -0.863
## q03_rev|t1 -1.516 0.111 -13.668 0.000 -1.516 -1.516
## q03_rev|t2 -1.317 0.099 -13.280 0.000 -1.317 -1.317
## q03_rev|t3 -1.262 0.096 -13.081 0.000 -1.262 -1.262
## q03_rev|t4 -1.244 0.096 -13.009 0.000 -1.244 -1.244
## q03_rev|t5 -1.193 0.093 -12.781 0.000 -1.193 -1.193
## q03_rev|t6 -1.070 0.088 -12.095 0.000 -1.070 -1.070
## q04|t1 -2.337 0.215 -10.866 0.000 -2.337 -2.337
## q04|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q04|t3 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q04|t4 -1.378 0.102 -13.451 0.000 -1.378 -1.378
## q04|t5 -0.863 0.082 -10.525 0.000 -0.863 -0.863
## q04|t6 -0.449 0.074 -6.055 0.000 -0.449 -0.449
## q05|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q05|t2 -1.659 0.122 -13.648 0.000 -1.659 -1.659
## q05|t3 -1.542 0.113 -13.683 0.000 -1.542 -1.542
## q05|t4 -1.244 0.096 -13.009 0.000 -1.244 -1.244
## q05|t5 -0.783 0.080 -9.791 0.000 -0.783 -0.783
## q05|t6 -0.422 0.074 -5.718 0.000 -0.422 -0.422
## q06|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q06|t2 -1.764 0.131 -13.483 0.000 -1.764 -1.764
## q06|t3 -1.628 0.119 -13.673 0.000 -1.628 -1.628
## q06|t4 -1.298 0.098 -13.217 0.000 -1.298 -1.298
## q06|t5 -0.805 0.080 -10.002 0.000 -0.805 -0.805
## q06|t6 -0.378 0.073 -5.156 0.000 -0.378 -0.378
## q07|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q07|t2 -2.002 0.158 -12.702 0.000 -2.002 -2.002
## q07|t3 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q07|t4 -1.378 0.102 -13.451 0.000 -1.378 -1.378
## q07|t5 -0.923 0.084 -11.035 0.000 -0.923 -0.923
## q07|t6 -0.569 0.076 -7.505 0.000 -0.569 -0.569
## q08|t1 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q08|t2 -1.945 0.150 -12.936 0.000 -1.945 -1.945
## q08|t3 -1.804 0.135 -13.390 0.000 -1.804 -1.804
## q08|t4 -1.421 0.105 -13.544 0.000 -1.421 -1.421
## q08|t5 -1.014 0.086 -11.721 0.000 -1.014 -1.014
## q08|t6 -0.657 0.077 -8.496 0.000 -0.657 -0.657
## q09|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q09|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q09|t3 -1.894 0.144 -13.122 0.000 -1.894 -1.894
## q09|t4 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q09|t5 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q09|t6 -0.687 0.078 -8.823 0.000 -0.687 -0.687
## q10|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q10|t2 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q10|t3 -1.491 0.109 -13.647 0.000 -1.491 -1.491
## q10|t4 -0.948 0.084 -11.234 0.000 -0.948 -0.948
## q10|t5 -0.326 0.073 -4.479 0.000 -0.326 -0.326
## q10|t6 0.037 0.071 0.511 0.609 0.037 0.037
## q11|t1 -2.228 0.193 -11.536 0.000 -2.228 -2.228
## q11|t2 -1.764 0.131 -13.483 0.000 -1.764 -1.764
## q11|t3 -1.421 0.105 -13.544 0.000 -1.421 -1.421
## q11|t4 -0.911 0.083 -10.934 0.000 -0.911 -0.911
## q11|t5 -0.275 0.072 -3.801 0.000 -0.275 -0.275
## q11|t6 0.093 0.072 1.306 0.192 0.093 0.093
## q12|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q12|t2 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q12|t3 -1.317 0.099 -13.280 0.000 -1.317 -1.317
## q12|t4 -0.805 0.080 -10.002 0.000 -0.805 -0.805
## q12|t5 -0.225 0.072 -3.121 0.002 -0.225 -0.225
## q12|t6 0.118 0.072 1.647 0.100 0.118 0.118
## q13_rev|t1 -1.628 0.119 -13.673 0.000 -1.628 -1.628
## q13_rev|t2 -1.298 0.098 -13.217 0.000 -1.298 -1.298
## q13_rev|t3 -0.987 0.086 -11.529 0.000 -0.987 -0.987
## q13_rev|t4 -0.503 0.075 -6.726 0.000 -0.503 -0.503
## q13_rev|t5 -0.208 0.072 -2.895 0.004 -0.208 -0.208
## q13_rev|t6 0.192 0.072 2.668 0.008 0.192 0.192
## q14_rev|t1 -1.659 0.122 -13.648 0.000 -1.659 -1.659
## q14_rev|t2 -1.491 0.109 -13.647 0.000 -1.491 -1.491
## q14_rev|t3 -1.176 0.093 -12.700 0.000 -1.176 -1.176
## q14_rev|t4 -0.898 0.083 -10.832 0.000 -0.898 -0.898
## q14_rev|t5 -0.578 0.076 -7.616 0.000 -0.578 -0.578
## q14_rev|t6 -0.175 0.072 -2.441 0.015 -0.175 -0.175
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .q01 -0.270 -0.270 -0.270
## .q02_rev 0.635 0.635 0.635
## .q03_rev 0.663 0.663 0.663
## .q04 0.134 0.134 0.134
## .q05 0.128 0.128 0.128
## .q06 0.069 0.069 0.069
## .q07 0.158 0.158 0.158
## .q08 0.082 0.082 0.082
## .q09 0.094 0.094 0.094
## .q10 0.077 0.077 0.077
## .q11 0.024 0.024 0.024
## .q12 0.107 0.107 0.107
## .q13_rev 0.248 0.248 0.248
## .q14_rev 0.194 0.194 0.194
## realidade (ub) 1.270 1.000 1.000
## causas 0.866 0.025 34.789 0.000 1.000 1.000
## valencia 0.842 0.030 28.184 0.000 1.000 1.000
## espacial 0.923 0.012 77.084 0.000 1.000 1.000
## temporal 0.752 0.065 11.614 0.000 1.000 1.000
##
## R-Square:
## Estimate
## q01 NA
## q02_rev 0.365
## q03_rev 0.337
## q04 0.866
## q05 0.872
## q06 0.931
## q07 0.842
## q08 0.918
## q09 0.906
## q10 0.923
## q11 0.976
## q12 0.893
## q13_rev 0.752
## q14_rev 0.806
# Inspeção Univariada de Frequências (Efeito Teto/Chão)
library(tidyverse)
# Constrói uma tabela com o percentual de escolha para cada nota (1 a 7) por item
tabela_frequencias <- df_escala %>%
pivot_longer(cols = everything(), names_to = "Item", values_to = "Resposta") %>%
count(Item, Resposta) %>%
group_by(Item) %>%
mutate(Percentual = round(n / sum(n) * 100, 2)) %>%
select(-n) %>%
pivot_wider(names_from = Resposta, values_from = Percentual, values_fill = 0)
# Exibe a tabela no console
print(tabela_frequencias, n = Inf)
## # A tibble: 14 × 8
## # Groups: Item [14]
## Item `1` `2` `3` `4` `5` `6` `7`
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 q01 1.62 0.32 1.29 0.97 1.94 6.8 87.1
## 2 q02_rev 8.74 2.59 0.97 0.65 1.94 4.53 80.6
## 3 q03_rev 6.47 2.91 0.97 0.32 0.97 2.59 85.8
## 4 q04 0.97 0.97 2.59 3.88 11 13.3 67.3
## 5 q05 1.62 3.24 1.29 4.53 11 12.0 66.3
## 6 q06 1.62 2.27 1.29 4.53 11.3 14.2 64.7
## 7 q07 1.62 0.65 0.97 5.18 9.39 10.7 71.5
## 8 q08 1.94 0.65 0.97 4.21 7.77 10.0 74.4
## 9 q09 1.62 0.32 0.97 1.62 8.41 11.6 75.4
## 10 q10 1.62 1.62 3.56 10.4 20.1 14.2 48.5
## 11 q11 1.29 2.59 3.88 10.4 21.0 14.6 46.3
## 12 q12 1.62 2.91 4.85 11.6 20.1 13.6 45.3
## 13 q13_rev 5.18 4.53 6.47 14.6 11 15.9 42.4
## 14 q14_rev 4.85 1.94 5.18 6.47 9.71 14.9 57.0
# (Opcional) Visualização gráfica da distribuição de respostas para o fator Realidade
df_escala %>%
select(q01, q02_rev, q03_rev) %>%
pivot_longer(cols = everything(), names_to = "Item", values_to = "Resposta") %>%
ggplot(aes(x = as.factor(Resposta))) +
geom_bar(fill = "steelblue", color = "black") +
facet_wrap(~ Item, scales = "free_y") +
theme_minimal() +
labs(title = "Distribuição de Frequências: Fator Realidade",
x = "Opção de Resposta (1 a 7)",
y = "Frequência Absoluta")
# Especificação do Modelo Ajustado (Alinhado ao Estudo 3 do artigo original)
modelo_ajustado <- '
# Fator Realidade reduzido para 2 itens (remoção do q03_rev por redundância)
realidade =~ q01 + q02_rev
causas =~ q04 + q05 + q06
valencia =~ q07 + q08 + q09
espacial =~ q10 + q11 + q12
temporal =~ q13_rev + q14_rev
'
# Reestimação da CFA
fit_cfa_ajustado <- cfa(model = modelo_ajustado,
data = df_escala,
ordered = names(df_escala),
estimator = "WLSMV")
# Avaliação dos novos índices de ajuste
summary(fit_cfa_ajustado, fit.measures = TRUE, standardized = TRUE)
## lavaan 0.7-2 ended normally after 49 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of model parameters 101
##
## Number of observations 309
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 29.274 90.560
## Degrees of freedom 55 55
## P-value (Unknown) NA 0.002
## Scaling correction factor 0.422
## Shift parameter 21.263
## simple second-order correction
##
## Model Test Baseline Model:
##
## Test statistic 59230.255 18726.455
## Degrees of freedom 78 78
## P-value NA 0.000
## Scaling correction factor 3.172
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 0.998
## Tucker-Lewis Index (TLI) 1.001 0.997
##
## Robust Comparative Fit Index (CFI) 0.981
## Robust Tucker-Lewis Index (TLI) 0.972
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.000 0.046
## 90 Percent confidence interval - lower 0.000 0.028
## 90 Percent confidence interval - upper 0.000 0.062
## P-value H_0: RMSEA <= 0.050 1.000 0.641
## P-value H_0: RMSEA >= 0.080 0.000 0.000
##
## Robust RMSEA 0.076
## 90 Percent confidence interval - lower 0.034
## 90 Percent confidence interval - upper 0.111
## P-value H_0: Robust RMSEA <= 0.050 0.131
## P-value H_0: Robust RMSEA >= 0.080 0.449
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.033 0.033
##
## Goodness of Fit Index:
##
## Goodness of Fit Index (GFI) 1.000
## 90 Percent confidence interval - lower 1.000
## 90 Percent confidence interval - upper 1.000
##
## Robust GFI 0.953
## 90 Percent confidence interval - lower 0.906
## 90 Percent confidence interval - upper 0.990
##
## Parameter Estimates:
##
## Parameterization Delta
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade =~
## q01 1.000 1.122 1.122
## q02_rev 0.497 0.074 6.676 0.000 0.558 0.558
## causas =~
## q04 1.000 0.931 0.931
## q05 1.004 0.018 57.189 0.000 0.934 0.934
## q06 1.036 0.015 67.421 0.000 0.964 0.964
## valencia =~
## q07 1.000 0.918 0.918
## q08 1.043 0.020 51.241 0.000 0.957 0.957
## q09 1.037 0.023 45.263 0.000 0.952 0.952
## espacial =~
## q10 1.000 0.961 0.961
## q11 1.029 0.008 132.123 0.000 0.988 0.988
## q12 0.984 0.007 151.162 0.000 0.945 0.945
## temporal =~
## q13_rev 1.000 0.868 0.868
## q14_rev 1.032 0.078 13.278 0.000 0.896 0.896
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade ~~
## causas 0.687 0.048 14.298 0.000 0.658 0.658
## valencia 0.726 0.049 14.700 0.000 0.705 0.705
## espacial 0.587 0.058 10.076 0.000 0.545 0.545
## temporal 0.471 0.067 7.074 0.000 0.484 0.484
## causas ~~
## valencia 0.678 0.037 18.365 0.000 0.794 0.794
## espacial 0.569 0.040 14.286 0.000 0.636 0.636
## temporal 0.331 0.053 6.226 0.000 0.410 0.410
## valencia ~~
## espacial 0.621 0.041 15.228 0.000 0.704 0.704
## temporal 0.369 0.053 6.963 0.000 0.463 0.463
## espacial ~~
## temporal 0.411 0.045 9.198 0.000 0.493 0.493
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## q01|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q01|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q01|t3 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q01|t4 -1.727 0.127 -13.555 0.000 -1.727 -1.727
## q01|t5 -1.542 0.113 -13.683 0.000 -1.542 -1.542
## q01|t6 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q02_rev|t1 -1.357 0.101 -13.398 0.000 -1.357 -1.357
## q02_rev|t2 -1.209 0.094 -12.859 0.000 -1.209 -1.209
## q02_rev|t3 -1.160 0.092 -12.618 0.000 -1.160 -1.160
## q02_rev|t4 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q02_rev|t5 -1.041 0.087 -11.910 0.000 -1.041 -1.041
## q02_rev|t6 -0.863 0.082 -10.525 0.000 -0.863 -0.863
## q04|t1 -2.337 0.215 -10.866 0.000 -2.337 -2.337
## q04|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q04|t3 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q04|t4 -1.378 0.102 -13.451 0.000 -1.378 -1.378
## q04|t5 -0.863 0.082 -10.525 0.000 -0.863 -0.863
## q04|t6 -0.449 0.074 -6.055 0.000 -0.449 -0.449
## q05|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q05|t2 -1.659 0.122 -13.648 0.000 -1.659 -1.659
## q05|t3 -1.542 0.113 -13.683 0.000 -1.542 -1.542
## q05|t4 -1.244 0.096 -13.009 0.000 -1.244 -1.244
## q05|t5 -0.783 0.080 -9.791 0.000 -0.783 -0.783
## q05|t6 -0.422 0.074 -5.718 0.000 -0.422 -0.422
## q06|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q06|t2 -1.764 0.131 -13.483 0.000 -1.764 -1.764
## q06|t3 -1.628 0.119 -13.673 0.000 -1.628 -1.628
## q06|t4 -1.298 0.098 -13.217 0.000 -1.298 -1.298
## q06|t5 -0.805 0.080 -10.002 0.000 -0.805 -0.805
## q06|t6 -0.378 0.073 -5.156 0.000 -0.378 -0.378
## q07|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q07|t2 -2.002 0.158 -12.702 0.000 -2.002 -2.002
## q07|t3 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q07|t4 -1.378 0.102 -13.451 0.000 -1.378 -1.378
## q07|t5 -0.923 0.084 -11.035 0.000 -0.923 -0.923
## q07|t6 -0.569 0.076 -7.505 0.000 -0.569 -0.569
## q08|t1 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q08|t2 -1.945 0.150 -12.936 0.000 -1.945 -1.945
## q08|t3 -1.804 0.135 -13.390 0.000 -1.804 -1.804
## q08|t4 -1.421 0.105 -13.544 0.000 -1.421 -1.421
## q08|t5 -1.014 0.086 -11.721 0.000 -1.014 -1.014
## q08|t6 -0.657 0.077 -8.496 0.000 -0.657 -0.657
## q09|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q09|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q09|t3 -1.894 0.144 -13.122 0.000 -1.894 -1.894
## q09|t4 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q09|t5 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q09|t6 -0.687 0.078 -8.823 0.000 -0.687 -0.687
## q10|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q10|t2 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q10|t3 -1.491 0.109 -13.647 0.000 -1.491 -1.491
## q10|t4 -0.948 0.084 -11.234 0.000 -0.948 -0.948
## q10|t5 -0.326 0.073 -4.479 0.000 -0.326 -0.326
## q10|t6 0.037 0.071 0.511 0.609 0.037 0.037
## q11|t1 -2.228 0.193 -11.536 0.000 -2.228 -2.228
## q11|t2 -1.764 0.131 -13.483 0.000 -1.764 -1.764
## q11|t3 -1.421 0.105 -13.544 0.000 -1.421 -1.421
## q11|t4 -0.911 0.083 -10.934 0.000 -0.911 -0.911
## q11|t5 -0.275 0.072 -3.801 0.000 -0.275 -0.275
## q11|t6 0.093 0.072 1.306 0.192 0.093 0.093
## q12|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q12|t2 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q12|t3 -1.317 0.099 -13.280 0.000 -1.317 -1.317
## q12|t4 -0.805 0.080 -10.002 0.000 -0.805 -0.805
## q12|t5 -0.225 0.072 -3.121 0.002 -0.225 -0.225
## q12|t6 0.118 0.072 1.647 0.100 0.118 0.118
## q13_rev|t1 -1.628 0.119 -13.673 0.000 -1.628 -1.628
## q13_rev|t2 -1.298 0.098 -13.217 0.000 -1.298 -1.298
## q13_rev|t3 -0.987 0.086 -11.529 0.000 -0.987 -0.987
## q13_rev|t4 -0.503 0.075 -6.726 0.000 -0.503 -0.503
## q13_rev|t5 -0.208 0.072 -2.895 0.004 -0.208 -0.208
## q13_rev|t6 0.192 0.072 2.668 0.008 0.192 0.192
## q14_rev|t1 -1.659 0.122 -13.648 0.000 -1.659 -1.659
## q14_rev|t2 -1.491 0.109 -13.647 0.000 -1.491 -1.491
## q14_rev|t3 -1.176 0.093 -12.700 0.000 -1.176 -1.176
## q14_rev|t4 -0.898 0.083 -10.832 0.000 -0.898 -0.898
## q14_rev|t5 -0.578 0.076 -7.616 0.000 -0.578 -0.578
## q14_rev|t6 -0.175 0.072 -2.441 0.015 -0.175 -0.175
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .q01 -0.258 -0.258 -0.258
## .q02_rev 0.689 0.689 0.689
## .q04 0.134 0.134 0.134
## .q05 0.127 0.127 0.127
## .q06 0.070 0.070 0.070
## .q07 0.157 0.157 0.157
## .q08 0.083 0.083 0.083
## .q09 0.094 0.094 0.094
## .q10 0.077 0.077 0.077
## .q11 0.024 0.024 0.024
## .q12 0.107 0.107 0.107
## .q13_rev 0.246 0.246 0.246
## .q14_rev 0.196 0.196 0.196
## realidade 1.258 0.177 7.100 0.000 1.000 1.000
## causas 0.866 0.025 34.887 0.000 1.000 1.000
## valencia 0.843 0.030 28.340 0.000 1.000 1.000
## espacial 0.923 0.012 76.927 0.000 1.000 1.000
## temporal 0.754 0.066 11.372 0.000 1.000 1.000
#install.packages("blavaan")
library(blavaan)
# 2.4 Análise Fatorial Confirmatória Bayesiana (BCFA)
# Implementada como contingência caso o modelo frequentista apresente ajuste subótimo
# O estimador Bayesiano lida melhor com cross-loadings espúrios
fit_bcfa <- bcfa(model = modelo_penta,
data = df_escala, # Utilize o dataframe tratado
ordered = names(df_escala),
target = "stan", # Utilização do amostrador Stan (recomendado)
test = "standard", # Habilita o cômputo das estatísticas de teste
bcontrol = list(cores = 3)) # Otimização via processamento paralelo (opcional)
summary(fit_bcfa, standardized = TRUE)
## 0.548 0.816 2.970 0.473 0.473
## causas ~~
## valencia 3.646 0.730 2.365 5.237 0.759 0.759
## espacial 4.575 0.903 3.031 6.558 0.622 0.622
## temporal 1.581 0.464 0.836 2.600 0.392 0.392
## valencia ~~
## espacial 4.779 0.980 3.105 6.851 0.664 0.664
## temporal 1.661 0.460 0.899 2.687 0.421 0.421
## espacial ~~
## temporal 2.987 0.703 1.794 4.526 0.494 0.494
## Rhat Prior
##
## 1.019 lkj_corr(1)
## 1.029 lkj_corr(1)
## 1.024 lkj_corr(1)
## 1.016 lkj_corr(1)
##
## 1.018 lkj_corr(1)
## 1.010 lkj_corr(1)
## 1.006 lkj_corr(1)
##
## 1.008 lkj_corr(1)
## 1.013 lkj_corr(1)
##
## 1.002 lkj_corr(1)
##
## Intercepts:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .q01 0.000 0.000 0.000
## .q02_rev 0.000 0.000 0.000
## .q03_rev 0.000 0.000 0.000
## .q04 0.000 0.000 0.000
## .q05 0.000 0.000 0.000
## .q06 0.000 0.000 0.000
## .q07 0.000 0.000 0.000
## .q08 0.000 0.000 0.000
## .q09 0.000 0.000 0.000
## .q10 0.000 0.000 0.000
## .q11 0.000 0.000 0.000
## .q12 0.000 0.000 0.000
## .q13_rev 0.000 0.000 0.000
## .q14_rev 0.000 0.000 0.000
## realidade 0.000 0.000 0.000
## causas 0.000 0.000 0.000
## valencia 0.000 0.000 0.000
## espacial 0.000 0.000 0.000
## temporal 0.000 0.000 0.000
## Rhat Prior
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
##
## Thresholds:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## q01|t1 -4.473 0.676 -5.953 -3.276 -4.473 -1.983
## q01|t2 -4.256 0.653 -5.727 -3.076 -4.256 -1.887
## q01|t3 -3.816 0.596 -5.129 -2.759 -3.816 -1.692
## q01|t4 -3.521 0.558 -4.738 -2.535 -3.521 -1.561
## q01|t5 -3.097 0.498 -4.226 -2.231 -3.097 -1.373
## q01|t6 -2.187 0.367 -3.005 -1.549 -2.187 -0.970
## q02_rev|t1 -1.723 0.197 -2.157 -1.394 -1.723 -1.272
## q02_rev|t2 -1.550 0.186 -1.968 -1.230 -1.550 -1.143
## q02_rev|t3 -1.472 0.180 -1.864 -1.164 -1.472 -1.086
## q02_rev|t4 -1.411 0.175 -1.797 -1.113 -1.411 -1.041
## q02_rev|t5 -1.284 0.167 -1.653 -1.003 -1.284 -0.947
## q02_rev|t6 -1.031 0.147 -1.358 -0.784 -1.031 -0.761
## q03_rev|t1 -1.908 0.210 -2.430 -1.569 -1.908 -1.441
## q03_rev|t2 -1.680 0.195 -2.150 -1.362 -1.680 -1.268
## q03_rev|t3 -1.591 0.189 -2.035 -1.285 -1.591 -1.201
## q03_rev|t4 -1.540 0.186 -1.983 -1.244 -1.540 -1.163
## q03_rev|t5 -1.455 0.180 -1.881 -1.165 -1.455 -1.099
## q03_rev|t6 -1.280 0.167 -1.677 -1.005 -1.280 -0.966
## q04|t1 -5.128 0.534 -6.246 -4.209 -5.128 -2.110
## q04|t2 -4.450 0.454 -5.415 -3.647 -4.450 -1.831
## q04|t3 -3.549 0.360 -4.311 -2.907 -3.549 -1.460
## q04|t4 -2.795 0.292 -3.402 -2.258 -2.795 -1.150
## q04|t5 -1.603 0.218 -2.051 -1.202 -1.603 -0.660
## q04|t6 -0.647 0.182 -1.009 -0.304 -0.647 -0.266
## q05|t1 -5.243 0.534 -6.360 -4.297 -5.243 -1.756
## q05|t2 -4.163 0.436 -5.079 -3.379 -4.163 -1.394
## q05|t3 -3.829 0.408 -4.683 -3.073 -3.829 -1.282
## q05|t4 -3.035 0.348 -3.743 -2.398 -3.035 -1.016
## q05|t5 -1.774 0.270 -2.326 -1.285 -1.774 -0.594
## q05|t6 -0.718 0.223 -1.172 -0.299 -0.718 -0.240
## q06|t1 -6.009 0.648 -7.343 -4.815 -6.009 -1.798
## q06|t2 -4.877 0.531 -6.017 -3.931 -4.877 -1.459
## q06|t3 -4.406 0.490 -5.455 -3.556 -4.406 -1.318
## q06|t4 -3.500 0.411 -4.379 -2.748 -3.500 -1.047
## q06|t5 -2.045 0.302 -2.679 -1.504 -2.045 -0.612
## q06|t6 -0.641 0.237 -1.113 -0.197 -0.641 -0.192
## q07|t1 -4.393 0.435 -5.318 -3.610 -4.393 -1.840
## q07|t2 -4.131 0.415 -5.016 -3.383 -4.131 -1.731
## q07|t3 -3.807 0.390 -4.614 -3.093 -3.807 -1.595
## q07|t4 -2.842 0.316 -3.504 -2.271 -2.842 -1.191
## q07|t5 -1.803 0.251 -2.346 -1.345 -1.803 -0.755
## q07|t6 -0.902 0.198 -1.309 -0.537 -0.902 -0.378
## q08|t1 -5.666 0.660 -7.104 -4.505 -5.666 -1.708
## q08|t2 -5.379 0.639 -6.740 -4.275 -5.379 -1.621
## q08|t3 -5.013 0.610 -6.316 -3.951 -5.013 -1.511
## q08|t4 -4.002 0.513 -5.092 -3.099 -4.002 -1.206
## q08|t5 -2.751 0.396 -3.561 -2.062 -2.751 -0.829
## q08|t6 -1.517 0.295 -2.130 -0.986 -1.517 -0.457
## q09|t1 -5.324 0.580 -6.553 -4.260 -5.324 -1.807
## q09|t2 -5.101 0.564 -6.331 -4.067 -5.101 -1.732
## q09|t3 -4.712 0.538 -5.836 -3.729 -4.712 -1.600
## q09|t4 -4.209 0.491 -5.293 -3.317 -4.209 -1.429
## q09|t5 -2.740 0.359 -3.499 -2.108 -2.740 -0.930
## q09|t6 -1.458 0.274 -2.046 -0.970 -1.458 -0.495
## q10|t1 -6.183 0.591 -7.411 -5.063 -6.183 -1.783
## q10|t2 -5.330 0.524 -6.400 -4.364 -5.330 -1.537
## q10|t3 -4.195 0.429 -5.087 -3.402 -4.195 -1.210
## q10|t4 -2.512 0.309 -3.144 -1.940 -2.512 -0.725
## q10|t5 -0.527 0.238 -1.001 -0.060 -0.527 -0.152
## q10|t6 0.684 0.241 0.241 1.175 0.684 0.197
## q11|t1 -7.778 0.750 -9.315 -6.378 -7.778 -1.780
## q11|t2 -6.405 0.666 -7.767 -5.174 -6.405 -1.466
## q11|t3 -5.033 0.557 -6.185 -4.027 -5.033 -1.152
## q11|t4 -2.930 0.395 -3.780 -2.224 -2.930 -0.671
## q11|t5 -0.447 0.299 -1.034 0.138 -0.447 -0.102
## q11|t6 1.097 0.317 0.514 1.741 1.097 0.251
## q12|t1 -5.516 0.516 -6.569 -4.567 -5.516 -1.778
## q12|t2 -4.362 0.414 -5.229 -3.593 -4.362 -1.406
## q12|t3 -3.235 0.327 -3.929 -2.638 -3.235 -1.043
## q12|t4 -1.813 0.243 -2.312 -1.354 -1.813 -0.584
## q12|t5 -0.200 0.213 -0.612 0.219 -0.200 -0.064
## q12|t6 0.863 0.220 0.438 1.310 0.863 0.278
## q13_rev|t1 -2.821 0.337 -3.603 -2.278 -2.821 -1.359
## q13_rev|t2 -2.302 0.288 -2.959 -1.831 -2.302 -1.108
## q13_rev|t3 -1.807 0.248 -2.364 -1.398 -1.807 -0.870
## q13_rev|t4 -0.924 0.184 -1.312 -0.598 -0.924 -0.445
## q13_rev|t5 -0.300 0.156 -0.612 0.004 -0.300 -0.144
## q13_rev|t6 0.596 0.163 0.303 0.932 0.596 0.287
## q14_rev|t1 -3.749 0.621 -5.210 -2.785 -3.749 -1.378
## q14_rev|t2 -3.360 0.566 -4.695 -2.483 -3.360 -1.235
## q14_rev|t3 -2.661 0.467 -3.756 -1.940 -2.661 -0.978
## q14_rev|t4 -2.022 0.378 -2.886 -1.417 -2.022 -0.743
## q14_rev|t5 -1.249 0.273 -1.880 -0.797 -1.249 -0.459
## q14_rev|t6 -0.244 0.194 -0.658 0.122 -0.244 -0.090
## Rhat Prior
## 1.028 normal(0,1.5)
## 1.029 normal(0,1.5)
## 1.034 normal(0,1.5)
## 1.032 normal(0,1.5)
## 1.034 normal(0,1.5)
## 1.031 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.011 normal(0,1.5)
## 1.012 normal(0,1.5)
## 1.012 normal(0,1.5)
## 1.012 normal(0,1.5)
## 1.012 normal(0,1.5)
## 1.013 normal(0,1.5)
## 1.008 normal(0,1.5)
## 1.006 normal(0,1.5)
## 1.008 normal(0,1.5)
## 1.005 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.010 normal(0,1.5)
## 1.011 normal(0,1.5)
## 1.011 normal(0,1.5)
## 1.012 normal(0,1.5)
## 1.009 normal(0,1.5)
## 1.006 normal(0,1.5)
## 1.016 normal(0,1.5)
## 1.018 normal(0,1.5)
## 1.017 normal(0,1.5)
## 1.018 normal(0,1.5)
## 1.013 normal(0,1.5)
## 1.008 normal(0,1.5)
## 1.013 normal(0,1.5)
## 1.013 normal(0,1.5)
## 1.013 normal(0,1.5)
## 1.013 normal(0,1.5)
## 1.012 normal(0,1.5)
## 1.008 normal(0,1.5)
## 1.005 normal(0,1.5)
## 1.006 normal(0,1.5)
## 1.006 normal(0,1.5)
## 1.005 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.002 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.000 normal(0,1.5)
## 1.001 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.003 normal(0,1.5)
## 1.004 normal(0,1.5)
## 1.003 normal(0,1.5)
##
## Variances:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## .q01 1.000 1.000 0.197
## .q02_rev 1.000 1.000 0.544
## .q03_rev 1.000 1.000 0.570
## .q04 1.000 1.000 0.169
## .q05 1.000 1.000 0.112
## .q06 1.000 1.000 0.090
## .q07 1.000 1.000 0.176
## .q08 1.000 1.000 0.091
## .q09 1.000 1.000 0.115
## .q10 1.000 1.000 0.083
## .q11 1.000 1.000 0.052
## .q12 1.000 1.000 0.104
## .q13_rev 1.000 1.000 0.232
## .q14_rev 1.000 1.000 0.135
## realidade 4.087 1.677 1.606 7.967 1.000 1.000
## causas 4.908 1.161 3.079 7.628 1.000 1.000
## valencia 4.697 1.259 2.638 7.589 1.000 1.000
## espacial 11.023 2.353 7.122 16.260 1.000 1.000
## temporal 3.313 1.105 1.797 6.000 1.000 1.000
## Rhat Prior
##
##
##
##
##
##
##
##
##
##
##
##
##
##
## 1.035 gamma(1,.5)[sd]
## 1.011 gamma(1,.5)[sd]
## 1.024 gamma(1,.5)[sd]
## 1.008 gamma(1,.5)[sd]
## 1.003 gamma(1,.5)[sd]
##
## Scales y*:
## Estimate Post.SD pi.lower pi.upper Std.lv Std.all
## q01 0.443 0.443 1.000
## q02_rev 0.738 0.738 1.000
## q03_rev 0.755 0.755 1.000
## q04 0.411 0.411 1.000
## q05 0.335 0.335 1.000
## q06 0.299 0.299 1.000
## q07 0.419 0.419 1.000
## q08 0.301 0.301 1.000
## q09 0.339 0.339 1.000
## q10 0.288 0.288 1.000
## q11 0.229 0.229 1.000
## q12 0.322 0.322 1.000
## q13_rev 0.482 0.482 1.000
## q14_rev 0.368 0.368 1.000
## Rhat Prior
##
##
##
##
##
##
##
##
##
##
##
##
##
##
# Calcula os índices de ajuste específicos para modelos bayesianos (BRMSEA, BCFI, BTLI)
#ajuste_bayesiano <- blavFitIndices(fit_bcfa)
# Exibe o sumário dos índices
#summary(ajuste_bayesiano)
FIGURA AFC
# Instalação do pacote (se necessário, execute apenas uma vez no console)
#install.packages("semPlot")
library(semPlot)
# Geração do Diagrama de Caminhos da CFA
semPaths(fit_cfa,
what = "std", # Determina que as arestas representem os valores padronizados
whatLabels = "std", # Insere os valores das cargas padronizadas nos rótulos das setas
layout = "tree2", # Layout estruturado em árvore (ideal para modelos de medida)
rotation = 2, # Rotaciona a figura (1 = latentes embaixo, 2 = esquerda, etc.)
nCharNodes = 0, # Previne o truncamento e exibe o nome completo das variáveis
sizeMan = 7, # Ajusta o tamanho dos retângulos (itens observados)
sizeLat = 9, # Ajusta o tamanho das elipses (fatores latentes)
edge.label.cex = 0.9, # Ajusta o tamanho da fonte dos valores nas setas
fade = FALSE, # Desativa o efeito de desbotamento em cargas mais fracas
intercepts = FALSE, # Oculta interceptos para deixar o gráfico mais limpo
residuals = TRUE, # Exibe as setas de variância residual
curvePivot = TRUE, # Arredonda as setas de covariância entre os fatores
color = list(lat = "lightgrey", man = "white"), # Cores sóbrias para publicação científica
mar = c(3, 5, 3, 5)) # Ajuste das margens do gráfico (baixo, esquerda, cima, direita)
# Exportando a figura em alta resolução (PNG)
#png("cfa_diagrama.png", width = 3000, height = 2400, res = 300)
semPaths(fit_cfa,
what = "path", # Desativa a espessura variável das linhas
whatLabels = "std", # Mantém os valores numéricos padronizados
layout = "tree2", # Alinha os itens observados em uma coluna estrita
rotation = 2, # Fatores à esquerda, itens à direita
style = "lisrel", # Setas retilíneas
# Controle de Linhas e Cores (Substituição do Tracejado e Cores)
fixedStyle = 1, # Força linha contínua para o primeiro item (remove tracejado)
freeStyle = 1, # Força linha contínua para os demais
edge.color = "black", # Todas as setas estritamente pretas
# Otimização Numérica (Rótulos)
edge.label.cex = 0.8, # Escala da fonte adequada para leitura
edge.label.bg = "white", # Fundo branco sob os números
# Estrutura dos Nós
sizeMan = 5, # Tamanho moderado dos itens (quadrados)
sizeLat = 7, # Tamanho moderado dos fatores (elipses)
shapeLat = "ellipse",
shapeMan = "rectangle",
# Elementos Adicionais
residuals = TRUE, # Exibe setas de resíduos apontando para os itens
intercepts = FALSE, # Oculta triângulos de interceptos
fade = FALSE, # Desativa transparência baseada em magnitude
nCharNodes = 0, # Previne truncamento dos nomes
curvePivot = TRUE, # Arredonda setas de covariância à esquerda
mar = c(2, 6, 2, 6)) # Expande as margens laterais
#dev.off() # Encerra o dispositivo de plotagem e salva o arquivo no diretório
#FIGURA COM BASE NA ANÁLISE CONFIRMATÓRIA BAYESIANA
library(semPlot)
# Renderização do diagrama baseado no modelo Bayesiano (DPI = 300)
#png("cfa_diagrama_bayesiano.png", width = 2500, height = 3500, res = 300)
semPaths(fit_bcfa,
what = "path",
whatLabels = "std",
layout = "tree2",
rotation = 2,
style = "lisrel",
# Controle de Linhas e Cores
fixedStyle = 1,
freeStyle = 1,
edge.color = "black",
# Otimização Numérica e Limpeza de Artefatos
edge.label.cex = 0.8,
edge.label.bg = "white",
thresholds = FALSE, # Suprime as barras de limiares dentro dos itens
residScale = 1.5, # Alonga as setas de erro em 50% para afastar os números da borda
# Estrutura dos Nós
sizeMan = 5,
sizeLat = 7,
shapeLat = "ellipse",
shapeMan = "rectangle",
# Elementos Adicionais
residuals = TRUE,
intercepts = FALSE,
fade = FALSE,
nCharNodes = 0,
curvePivot = TRUE,
mar = c(2, 7, 2, 7)) # Margens laterais expandidas para acomodar os resíduos
#dev.off()
ANÁLISE DE INVARIÂNCIA
library(dplyr)
library(lavaan)
# 1. Agrupamento de categorias (Collapsing) para o item q01
df_invariancia <- bind_cols(df_escala, sexo = df$sexo) %>%
filter(sexo %in% c("Feminino", "Masculino")) %>%
mutate(across(-sexo, as.numeric)) %>%
mutate(
q01 = case_when(
q01 <= 3 ~ 3,
q01 >= 6 ~ 6,
TRUE ~ q01
),
q02_rev = case_when(
q02_rev >= 4 ~ 4,
TRUE ~ q02_rev
),
q03_rev = case_when(
q03_rev >= 3 ~ 3,
TRUE ~ q03_rev
),
q07 = case_when(
q07 <= 3 ~ 3,
TRUE ~ q07
),
q08 = case_when(
q08 <= 3 ~ 3, # Agrupa as categorias 6 e 7
TRUE ~ q08
),
q09 = case_when(
q09 <= 4 ~ 4, # Agrupa as categorias 1, 2, 3 e 4 para sanar as células nulas
TRUE ~ q09
)
)
# 2. Definição explícita do vetor de variáveis ordinais
variaveis_ordinais <- names(df_escala)
# 3. Estimação do Modelo Configuracional (Invariância de Configuração)
fit_config <- cfa(model = modelo_penta,
data = df_invariancia,
ordered = variaveis_ordinais,
group = "sexo",
estimator = "WLSMV",
bounds = TRUE) # Manutenção do controle de Heywood cases
# 4. Invariância Métrica/Escalar (Cargas e thresholds restritos)
# Nota metodológica: No estimador WLSMV com dados ordinais, a restrição simultânea
# de cargas e limiares (thresholds) testa a invariância forte diretamente.
fit_metric <- cfa(modelo_penta,
data = df_invariancia,
ordered = names(df_escala),
group = "sexo",
estimator = "WLSMV",
group.equal = c("loadings", "thresholds"),
bounds = TRUE)
# 5. Avaliação do Ajuste Configuracional
summary(fit_config, fit.measures = TRUE, standardized = TRUE)
## lavaan 0.7-2 ended normally after 78 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of model parameters 182
## Row rank of the constraints matrix 48
##
## Number of observations per group:
## Masculino 76
## Feminino 232
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 134.304 242.057
## Degrees of freedom 134 134
## P-value (Unknown) NA 0.000
## Scaling correction factor 0.771
## Shift parameter 67.874
## simple second-order correction
## Test statistic for each group:
## Masculino 75.710 75.710
## Feminino 166.347 166.347
##
## Model Test Baseline Model:
##
## Test statistic 68298.529 22752.382
## Degrees of freedom 182 182
## P-value NA 0.000
## Scaling correction factor 3.018
##
## User Model versus Baseline Model:
##
## Comparative Fit Index (CFI) 1.000 0.995
## Tucker-Lewis Index (TLI) 1.000 0.993
##
## Robust Comparative Fit Index (CFI) NA
## Robust Tucker-Lewis Index (TLI) NA
##
## Root Mean Square Error of Approximation:
##
## RMSEA 0.004 0.073
## 90 Percent confidence interval - lower 0.000 0.058
## 90 Percent confidence interval - upper 0.039 0.087
## P-value H_0: RMSEA <= 0.050 0.995 0.008
## P-value H_0: RMSEA >= 0.080 0.000 0.208
##
## Robust RMSEA NA
## 90 Percent confidence interval - lower NA
## 90 Percent confidence interval - upper NA
## P-value H_0: Robust RMSEA <= 0.050 NA
## P-value H_0: Robust RMSEA >= 0.080 NA
##
## Standardized Root Mean Square Residual:
##
## SRMR 0.084 0.084
##
## Goodness of Fit Index:
##
## Goodness of Fit Index (GFI) 1.000
## 90 Percent confidence interval - lower 0.985
## 90 Percent confidence interval - upper 1.000
##
## Robust GFI NA
## 90 Percent confidence interval - lower NA
## 90 Percent confidence interval - upper NA
##
## Parameter Estimates:
##
## Parameterization Delta
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
##
## Group 1 [Masculino]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade =~
## q01 1.000 1.127 1.127
## q02_rev 0.089 0.127 0.702 0.483 0.101 0.101
## q03_rev 0.349 0.096 3.622 0.000 0.394 0.394
## causas =~
## q04 1.000 0.927 0.927
## q05 1.000 0.038 26.562 0.000 0.926 0.926
## q06 1.082 0.033 33.291 0.000 1.003 1.003
## valencia =~
## q07 1.000 0.976 0.976
## q08 0.946 0.033 28.752 0.000 0.923 0.923
## q09 0.975 0.041 23.764 0.000 0.951 0.951
## espacial =~
## q10 1.000 0.965 0.965
## q11 1.044 0.016 63.864 0.000 1.008 1.008
## q12 0.999 0.010 100.391 0.000 0.965 0.965
## temporal =~
## q13_rev 1.000 0.961 0.961
## q14_rev 0.955 0.101 9.447 0.000 0.918 0.918
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade ~~
## causas 0.886 0.045 19.587 0.000 0.849 0.849
## valencia 0.959 0.064 15.098 0.000 0.872 0.872
## espacial 0.738 0.066 11.157 0.000 0.678 0.678
## temporal 0.301 0.177 1.703 0.089 0.278 0.278
## causas ~~
## valencia 0.721 0.068 10.552 0.000 0.798 0.798
## espacial 0.598 0.067 8.924 0.000 0.669 0.669
## temporal 0.358 0.086 4.169 0.000 0.401 0.401
## valencia ~~
## espacial 0.743 0.055 13.540 0.000 0.789 0.789
## temporal 0.445 0.102 4.374 0.000 0.475 0.475
## espacial ~~
## temporal 0.513 0.069 7.406 0.000 0.552 0.552
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## q01|t1 -1.620 0.239 -6.772 0.000 -1.620 -1.620
## q01|t2 -1.508 0.223 -6.764 0.000 -1.508 -1.508
## q01|t3 -1.412 0.211 -6.698 0.000 -1.412 -1.412
## q02_rev|t1 -1.412 0.211 -6.698 0.000 -1.412 -1.412
## q02_rev|t2 -1.183 0.188 -6.305 0.000 -1.183 -1.183
## q02_rev|t3 -1.119 0.182 -6.136 0.000 -1.119 -1.119
## q03_rev|t1 -1.938 0.302 -6.418 0.000 -1.938 -1.938
## q03_rev|t2 -1.412 0.211 -6.698 0.000 -1.412 -1.412
## q04|t1 -2.222 0.388 -5.730 0.000 -2.222 -2.222
## q04|t2 -1.938 0.302 -6.418 0.000 -1.938 -1.938
## q04|t3 -1.620 0.239 -6.772 0.000 -1.620 -1.620
## q04|t4 -1.119 0.182 -6.136 0.000 -1.119 -1.119
## q04|t5 -0.805 0.163 -4.950 0.000 -0.805 -0.805
## q04|t6 -0.443 0.149 -2.962 0.003 -0.443 -0.443
## q05|t1 -2.222 0.388 -5.730 0.000 -2.222 -2.222
## q05|t2 -1.412 0.211 -6.698 0.000 -1.412 -1.412
## q05|t3 -1.183 0.188 -6.305 0.000 -1.183 -1.183
## q05|t4 -0.851 0.165 -5.160 0.000 -0.851 -0.851
## q05|t5 -0.555 0.153 -3.636 0.000 -0.555 -0.555
## q05|t6 -0.267 0.146 -1.827 0.068 -0.267 -0.267
## q06|t1 -2.222 0.388 -5.730 0.000 -2.222 -2.222
## q06|t2 -1.508 0.223 -6.764 0.000 -1.508 -1.508
## q06|t3 -1.328 0.201 -6.592 0.000 -1.328 -1.328
## q06|t4 -1.119 0.182 -6.136 0.000 -1.119 -1.119
## q06|t5 -0.716 0.159 -4.520 0.000 -0.716 -0.716
## q06|t6 -0.301 0.147 -2.055 0.040 -0.301 -0.301
## q07|t1 -1.620 0.239 -6.772 0.000 -1.620 -1.620
## q07|t2 -1.003 0.174 -5.766 0.000 -1.003 -1.003
## q07|t3 -0.716 0.159 -4.520 0.000 -0.716 -0.716
## q07|t4 -0.443 0.149 -2.962 0.003 -0.443 -0.443
## q08|t1 -1.412 0.211 -6.698 0.000 -1.412 -1.412
## q08|t2 -1.003 0.174 -5.766 0.000 -1.003 -1.003
## q08|t3 -0.674 0.157 -4.301 0.000 -0.674 -0.674
## q08|t4 -0.480 0.150 -3.188 0.001 -0.480 -0.480
## q09|t1 -1.183 0.188 -6.305 0.000 -1.183 -1.183
## q09|t2 -0.760 0.160 -4.736 0.000 -0.760 -0.760
## q09|t3 -0.517 0.151 -3.412 0.001 -0.517 -0.517
## q10|t1 -1.938 0.302 -6.418 0.000 -1.938 -1.938
## q10|t2 -1.620 0.239 -6.772 0.000 -1.620 -1.620
## q10|t3 -1.119 0.182 -6.136 0.000 -1.119 -1.119
## q10|t4 -0.851 0.165 -5.160 0.000 -0.851 -0.851
## q10|t5 -0.233 0.146 -1.599 0.110 -0.233 -0.233
## q10|t6 0.166 0.145 1.143 0.253 0.166 0.166
## q11|t1 -2.222 0.388 -5.730 0.000 -2.222 -2.222
## q11|t2 -1.620 0.239 -6.772 0.000 -1.620 -1.620
## q11|t3 -1.183 0.188 -6.305 0.000 -1.183 -1.183
## q11|t4 -0.716 0.159 -4.520 0.000 -0.716 -0.716
## q11|t5 -0.132 0.145 -0.914 0.360 -0.132 -0.132
## q11|t6 0.199 0.145 1.371 0.170 0.199 0.199
## q12|t1 -2.222 0.388 -5.730 0.000 -2.222 -2.222
## q12|t2 -1.508 0.223 -6.764 0.000 -1.508 -1.508
## q12|t3 -1.183 0.188 -6.305 0.000 -1.183 -1.183
## q12|t4 -0.674 0.157 -4.301 0.000 -0.674 -0.674
## q12|t5 -0.166 0.145 -1.143 0.253 -0.166 -0.166
## q12|t6 0.199 0.145 1.371 0.170 0.199 0.199
## q13_rev|t1 -1.620 0.239 -6.772 0.000 -1.620 -1.620
## q13_rev|t2 -1.412 0.211 -6.698 0.000 -1.412 -1.412
## q13_rev|t3 -1.252 0.194 -6.458 0.000 -1.252 -1.252
## q13_rev|t4 -0.407 0.149 -2.736 0.006 -0.407 -0.407
## q13_rev|t5 0.033 0.144 0.229 0.819 0.033 0.033
## q13_rev|t6 0.480 0.150 3.188 0.001 0.480 0.480
## q14_rev|t1 -1.328 0.201 -6.592 0.000 -1.328 -1.328
## q14_rev|t2 -1.119 0.182 -6.136 0.000 -1.119 -1.119
## q14_rev|t3 -1.003 0.174 -5.766 0.000 -1.003 -1.003
## q14_rev|t4 -0.594 0.154 -3.859 0.000 -0.594 -0.594
## q14_rev|t5 -0.199 0.145 -1.371 0.170 -0.199 -0.199
## q14_rev|t6 0.233 0.146 1.599 0.110 0.233 0.233
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .q01 -0.270 -0.270 -0.270
## .q02_rev 0.990 0.990 0.990
## .q03_rev 0.845 0.845 0.845
## .q04 0.141 0.141 0.141
## .q05 0.142 0.142 0.142
## .q06 -0.006 -0.006 -0.006
## .q07 0.048 0.048 0.048
## .q08 0.147 0.147 0.147
## .q09 0.095 0.095 0.095
## .q10 0.068 0.068 0.068
## .q11 -0.016 -0.016 -0.016
## .q12 0.069 0.069 0.069
## .q13_rev 0.076 0.076 0.076
## .q14_rev 0.158 0.158 0.158
## realidade (ub) 1.270 1.000 1.000
## causas 0.859 0.050 17.238 0.000 1.000 1.000
## valencia 0.952 0.046 20.551 0.000 1.000 1.000
## espacial 0.932 0.021 44.514 0.000 1.000 1.000
## temporal 0.924 0.104 8.890 0.000 1.000 1.000
##
##
## Group 2 [Feminino]:
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade =~
## q01 1.000 1.127 1.127
## q02_rev 0.247 0.099 2.491 0.013 0.278 0.278
## q03_rev 0.132 0.118 1.123 0.262 0.149 0.149
## causas =~
## q04 1.000 0.939 0.939
## q05 0.999 0.019 51.937 0.000 0.938 0.938
## q06 1.023 0.016 64.406 0.000 0.961 0.961
## valencia =~
## q07 1.000 0.913 0.913
## q08 1.078 0.025 42.699 0.000 0.984 0.984
## q09 1.040 0.020 51.153 0.000 0.950 0.950
## espacial =~
## q10 1.000 0.960 0.960
## q11 1.020 0.010 106.273 0.000 0.980 0.980
## q12 0.978 0.010 98.521 0.000 0.939 0.939
## temporal =~
## q13_rev 1.000 0.854 0.854
## q14_rev 1.037 0.108 9.641 0.000 0.886 0.886
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade ~~
## causas 0.729 0.059 12.345 0.000 0.689 0.689
## valencia 0.724 0.071 10.150 0.000 0.704 0.704
## espacial 0.622 0.081 7.659 0.000 0.574 0.574
## temporal 0.428 0.118 3.625 0.000 0.445 0.445
## causas ~~
## valencia 0.675 0.045 15.017 0.000 0.788 0.788
## espacial 0.562 0.045 12.501 0.000 0.624 0.624
## temporal 0.316 0.062 5.111 0.000 0.395 0.395
## valencia ~~
## espacial 0.585 0.053 10.958 0.000 0.667 0.667
## temporal 0.343 0.065 5.267 0.000 0.440 0.440
## espacial ~~
## temporal 0.376 0.054 7.028 0.000 0.459 0.459
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## q01|t1 -1.945 0.174 -11.189 0.000 -1.945 -1.945
## q01|t2 -1.819 0.157 -11.550 0.000 -1.819 -1.819
## q01|t3 -1.589 0.134 -11.841 0.000 -1.589 -1.589
## q02_rev|t1 -1.338 0.116 -11.542 0.000 -1.338 -1.338
## q02_rev|t2 -1.216 0.109 -11.149 0.000 -1.216 -1.216
## q02_rev|t3 -1.172 0.107 -10.966 0.000 -1.172 -1.172
## q03_rev|t1 -1.452 0.123 -11.762 0.000 -1.452 -1.452
## q03_rev|t2 -1.312 0.114 -11.472 0.000 -1.312 -1.312
## q04|t1 -2.382 0.260 -9.154 0.000 -2.382 -2.382
## q04|t2 -2.114 0.201 -10.523 0.000 -2.114 -2.114
## q04|t3 -1.716 0.146 -11.743 0.000 -1.716 -1.716
## q04|t4 -1.484 0.126 -11.798 0.000 -1.484 -1.484
## q04|t5 -0.879 0.095 -9.229 0.000 -0.879 -0.879
## q04|t6 -0.447 0.086 -5.216 0.000 -0.447 -0.447
## q05|t1 -2.114 0.201 -10.523 0.000 -2.114 -2.114
## q05|t2 -1.765 0.151 -11.663 0.000 -1.765 -1.765
## q05|t3 -1.716 0.146 -11.743 0.000 -1.716 -1.716
## q05|t4 -1.421 0.121 -11.718 0.000 -1.421 -1.421
## q05|t5 -0.863 0.095 -9.110 0.000 -0.863 -0.863
## q05|t6 -0.471 0.086 -5.474 0.000 -0.471 -0.471
## q06|t1 -2.114 0.201 -10.523 0.000 -2.114 -2.114
## q06|t2 -1.878 0.165 -11.397 0.000 -1.878 -1.878
## q06|t3 -1.819 0.157 -11.550 0.000 -1.819 -1.819
## q06|t4 -1.392 0.119 -11.666 0.000 -1.392 -1.392
## q06|t5 -0.848 0.094 -8.991 0.000 -0.848 -0.848
## q06|t6 -0.411 0.085 -4.828 0.000 -0.411 -0.411
## q07|t1 -1.945 0.174 -11.189 0.000 -1.945 -1.945
## q07|t2 -1.552 0.131 -11.839 0.000 -1.552 -1.552
## q07|t3 -0.997 0.099 -10.034 0.000 -0.997 -0.997
## q07|t4 -0.608 0.088 -6.883 0.000 -0.608 -0.608
## q08|t1 -2.023 0.185 -10.908 0.000 -2.023 -2.023
## q08|t2 -1.628 0.138 -11.828 0.000 -1.628 -1.628
## q08|t3 -1.150 0.106 -10.871 0.000 -1.150 -1.150
## q08|t4 -0.716 0.091 -7.890 0.000 -0.716 -0.716
## q09|t1 -2.023 0.185 -10.908 0.000 -2.023 -2.023
## q09|t2 -1.286 0.113 -11.397 0.000 -1.286 -1.286
## q09|t3 -0.744 0.091 -8.138 0.000 -0.744 -0.744
## q10|t1 -2.228 0.223 -9.978 0.000 -2.228 -2.228
## q10|t2 -1.945 0.174 -11.189 0.000 -1.945 -1.945
## q10|t3 -1.670 0.142 -11.796 0.000 -1.670 -1.670
## q10|t4 -0.979 0.099 -9.922 0.000 -0.979 -0.979
## q10|t5 -0.353 0.084 -4.179 0.000 -0.353 -0.353
## q10|t6 0.000 0.083 0.000 1.000 0.000 0.000
## q11|t1 -2.228 0.223 -9.978 0.000 -2.228 -2.228
## q11|t2 -1.819 0.157 -11.550 0.000 -1.819 -1.819
## q11|t3 -1.517 0.128 -11.825 0.000 -1.517 -1.517
## q11|t4 -0.979 0.099 -9.922 0.000 -0.979 -0.979
## q11|t5 -0.319 0.084 -3.789 0.000 -0.319 -0.319
## q11|t6 0.065 0.083 0.785 0.432 0.065 0.065
## q12|t1 -2.114 0.201 -10.523 0.000 -2.114 -2.114
## q12|t2 -1.765 0.151 -11.663 0.000 -1.765 -1.765
## q12|t3 -1.364 0.118 -11.607 0.000 -1.364 -1.364
## q12|t4 -0.848 0.094 -8.991 0.000 -0.848 -0.848
## q12|t5 -0.240 0.083 -2.877 0.004 -0.240 -0.240
## q12|t6 0.097 0.083 1.178 0.239 0.097 0.097
## q13_rev|t1 -1.628 0.138 -11.828 0.000 -1.628 -1.628
## q13_rev|t2 -1.262 0.112 -11.318 0.000 -1.262 -1.262
## q13_rev|t3 -0.911 0.096 -9.464 0.000 -0.911 -0.911
## q13_rev|t4 -0.532 0.087 -6.118 0.000 -0.532 -0.532
## q13_rev|t5 -0.285 0.084 -3.398 0.001 -0.285 -0.285
## q13_rev|t6 0.097 0.083 1.178 0.239 0.097 0.097
## q14_rev|t1 -1.819 0.157 -11.550 0.000 -1.819 -1.819
## q14_rev|t2 -1.670 0.142 -11.796 0.000 -1.670 -1.670
## q14_rev|t3 -1.239 0.110 -11.235 0.000 -1.239 -1.239
## q14_rev|t4 -1.014 0.100 -10.144 0.000 -1.014 -1.014
## q14_rev|t5 -0.716 0.091 -7.890 0.000 -0.716 -0.716
## q14_rev|t6 -0.307 0.084 -3.659 0.000 -0.307 -0.307
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .q01 -0.270 -0.270 -0.270
## .q02_rev 0.923 0.923 0.923
## .q03_rev 0.978 0.978 0.978
## .q04 0.118 0.118 0.118
## .q05 0.120 0.120 0.120
## .q06 0.077 0.077 0.077
## .q07 0.166 0.166 0.166
## .q08 0.031 0.031 0.031
## .q09 0.097 0.097 0.097
## .q10 0.078 0.078 0.078
## .q11 0.040 0.040 0.040
## .q12 0.118 0.118 0.118
## .q13_rev 0.271 0.271 0.271
## .q14_rev 0.215 0.215 0.215
## realidade (ub) 1.270 1.000 1.000
## causas 0.882 0.027 32.830 0.000 1.000 1.000
## valencia 0.834 0.034 24.276 0.000 1.000 1.000
## espacial 0.922 0.015 61.074 0.000 1.000 1.000
## temporal 0.729 0.086 8.478 0.000 1.000 1.000
anova(fit_config, fit_metric)
##
## Scaled and Shifted Chi-Squared Difference Test (method = "satorra.2000")
##
## lavaan->lavTestLRT():
## lavaan NOTE: The "Chisq" column contains standard test statistics, not the
## robust test that should be reported per model. A robust difference test is
## a function of two standard (not robust) statistics.
##
## Df AIC BIC Chisq Chisq diff RMSEA Df diff Pr(>Chisq)
## fit_config 134 134.30
## fit_metric 182 152.45 50.866 0 48 0.3614
CONSISTÊNCIA INTERNA
# Extração da fidedignidade via pacote semTools
# Calcula automaticamente Alpha, Ômega (total e por subescala) e AVE (Variância Média Extraída)
fidedignidade_indices <- semTools::reliability(fit_cfa)
print(fidedignidade_indices)
## realidade causas valencia espacial temporal
## alpha 0.5125070 0.9278781 0.9060139 0.9582713 0.7947036
## alpha.ord 0.8274852 0.9591617 0.9593879 0.9751406 0.8753503
## omega 0.5571225 0.9321693 0.9235863 0.9590641 0.8290927
## omega2 0.5571225 0.9321693 0.9235863 0.9590641 0.8290927
## omega3 0.5141457 0.9339628 0.9237971 0.9602460 0.8290928
## avevar 0.6575405 0.8895994 0.8886113 0.9309023 0.7787943
ANÁLISE DE REDES
# 5.1 Estimação da Rede (Matriz Policórica automática via cor_auto)
library(qgraph)
matriz_cor <- cor_auto(df_escala)
rede_clima <- EBICglasso(matriz_cor, n = nrow(df_escala))
# 5.2 Plotagem do Grafo Psicométrico
qgraph(rede_clima,
layout = "spring",
groups = list(Realidade = 1:3, Causas = 4:6, Valencia = 7:9,
Espacial = 10:12, Temporal = 13:14),
theme = "colorblind",
vsize = 6,
title = "Rede Psicométrica de Percepção Climática")
# 5.3 Análise de Centralidade
centralidade <- centralityPlot(rede_clima, include = c("Strength", "Betweenness", "Closeness"))
VALIDADE EXTERNA
# 6.1 Ampliação do Modelo Estrutural (Exemplo com 'import_tema')
# Necessário que a variável 'import_tema' conste no banco e seja numérica/ordinal
modelo_estrutural <- '
# Modelo de Medida (CFA)
realidade =~ q01 + q02_rev + q03_rev
causas =~ q04 + q05 + q06
valencia =~ q07 + q08 + q09
espacial =~ q10 + q11 + q12
temporal =~ q13_rev + q14_rev
# Regressões Estruturais (Validade Preditiva)
# A percepção de valência e realidade predizem a importância atribuída ao tema?
import_tema ~ realidade + valencia + causas
'
# Estimação do Modelo Estrutural
# df_completo deve conter os itens da escala e a variável 'import_tema'
df_completo <- bind_cols(df_escala, import_tema = df$import_tema)
fit_sem <- sem(model = modelo_estrutural,
data = df_completo,
ordered = names(df_escala), # import_tema pode ser incluído se for ordinal
estimator = "WLSMV")
summary(fit_sem, standardized = TRUE, rsquare = TRUE)
## lavaan 0.7-2 ended normally after 57 iterations
##
## Estimator DWLS
## Optimization method NLMINB
## Number of model parameters 113
##
## Number of observations 309
##
## Model Test User Model:
## Standard Scaled
## Test Statistic 87.849 193.681
## Degrees of freedom 78 78
## P-value (Unknown) NA 0.000
## Scaling correction factor 0.556
## Shift parameter 35.770
## simple second-order correction
##
## Parameter Estimates:
##
## Parameterization Delta
## Standard errors Robust.sem
## Information Expected
## Information saturated (h1) model Unstructured
##
## Latent Variables:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade =~
## q01 1.000 1.115 1.115
## q02_rev 0.537 0.067 8.015 0.000 0.598 0.598
## q03_rev 0.511 0.064 7.979 0.000 0.570 0.570
## causas =~
## q04 1.000 0.932 0.932
## q05 1.002 0.018 56.380 0.000 0.933 0.933
## q06 1.035 0.015 67.087 0.000 0.964 0.964
## valencia =~
## q07 1.000 0.916 0.916
## q08 1.046 0.021 50.620 0.000 0.958 0.958
## q09 1.040 0.023 44.472 0.000 0.952 0.952
## espacial =~
## q10 1.000 0.961 0.961
## q11 1.028 0.008 132.297 0.000 0.988 0.988
## q12 0.984 0.007 151.211 0.000 0.945 0.945
## temporal =~
## q13_rev 1.000 0.865 0.865
## q14_rev 1.040 0.074 14.003 0.000 0.900 0.900
##
## Regressions:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## import_tema ~
## realidade 0.379 0.102 3.704 0.000 0.422 0.413
## valencia 0.116 0.102 1.140 0.254 0.106 0.104
## causas 0.105 0.099 1.058 0.290 0.098 0.096
##
## Covariances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## realidade ~~
## causas 0.664 0.050 13.388 0.000 0.640 0.640
## valencia 0.707 0.051 13.933 0.000 0.693 0.693
## espacial 0.576 0.055 10.536 0.000 0.538 0.538
## temporal 0.524 0.062 8.431 0.000 0.543 0.543
## causas ~~
## valencia 0.676 0.037 18.237 0.000 0.792 0.792
## espacial 0.572 0.040 14.414 0.000 0.638 0.638
## temporal 0.333 0.053 6.292 0.000 0.413 0.413
## valencia ~~
## espacial 0.622 0.041 15.298 0.000 0.707 0.707
## temporal 0.370 0.053 7.033 0.000 0.467 0.467
## espacial ~~
## temporal 0.410 0.045 9.182 0.000 0.493 0.493
##
## Intercepts:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .import_tema 4.405 0.110 40.122 0.000 4.405 4.312
##
## Thresholds:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## q01|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q01|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q01|t3 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q01|t4 -1.727 0.127 -13.555 0.000 -1.727 -1.727
## q01|t5 -1.542 0.113 -13.683 0.000 -1.542 -1.542
## q01|t6 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q02_rev|t1 -1.357 0.101 -13.398 0.000 -1.357 -1.357
## q02_rev|t2 -1.209 0.094 -12.859 0.000 -1.209 -1.209
## q02_rev|t3 -1.160 0.092 -12.618 0.000 -1.160 -1.160
## q02_rev|t4 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q02_rev|t5 -1.041 0.087 -11.910 0.000 -1.041 -1.041
## q02_rev|t6 -0.863 0.082 -10.525 0.000 -0.863 -0.863
## q03_rev|t1 -1.516 0.111 -13.668 0.000 -1.516 -1.516
## q03_rev|t2 -1.317 0.099 -13.280 0.000 -1.317 -1.317
## q03_rev|t3 -1.262 0.096 -13.081 0.000 -1.262 -1.262
## q03_rev|t4 -1.244 0.096 -13.009 0.000 -1.244 -1.244
## q03_rev|t5 -1.193 0.093 -12.781 0.000 -1.193 -1.193
## q03_rev|t6 -1.070 0.088 -12.095 0.000 -1.070 -1.070
## q04|t1 -2.337 0.215 -10.866 0.000 -2.337 -2.337
## q04|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q04|t3 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q04|t4 -1.378 0.102 -13.451 0.000 -1.378 -1.378
## q04|t5 -0.863 0.082 -10.525 0.000 -0.863 -0.863
## q04|t6 -0.449 0.074 -6.055 0.000 -0.449 -0.449
## q05|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q05|t2 -1.659 0.122 -13.648 0.000 -1.659 -1.659
## q05|t3 -1.542 0.113 -13.683 0.000 -1.542 -1.542
## q05|t4 -1.244 0.096 -13.009 0.000 -1.244 -1.244
## q05|t5 -0.783 0.080 -9.791 0.000 -0.783 -0.783
## q05|t6 -0.422 0.074 -5.718 0.000 -0.422 -0.422
## q06|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q06|t2 -1.764 0.131 -13.483 0.000 -1.764 -1.764
## q06|t3 -1.628 0.119 -13.673 0.000 -1.628 -1.628
## q06|t4 -1.298 0.098 -13.217 0.000 -1.298 -1.298
## q06|t5 -0.805 0.080 -10.002 0.000 -0.805 -0.805
## q06|t6 -0.378 0.073 -5.156 0.000 -0.378 -0.378
## q07|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q07|t2 -2.002 0.158 -12.702 0.000 -2.002 -2.002
## q07|t3 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q07|t4 -1.378 0.102 -13.451 0.000 -1.378 -1.378
## q07|t5 -0.923 0.084 -11.035 0.000 -0.923 -0.923
## q07|t6 -0.569 0.076 -7.505 0.000 -0.569 -0.569
## q08|t1 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q08|t2 -1.945 0.150 -12.936 0.000 -1.945 -1.945
## q08|t3 -1.804 0.135 -13.390 0.000 -1.804 -1.804
## q08|t4 -1.421 0.105 -13.544 0.000 -1.421 -1.421
## q08|t5 -1.014 0.086 -11.721 0.000 -1.014 -1.014
## q08|t6 -0.657 0.077 -8.496 0.000 -0.657 -0.657
## q09|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q09|t2 -2.066 0.167 -12.407 0.000 -2.066 -2.066
## q09|t3 -1.894 0.144 -13.122 0.000 -1.894 -1.894
## q09|t4 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q09|t5 -1.129 0.091 -12.449 0.000 -1.129 -1.129
## q09|t6 -0.687 0.078 -8.823 0.000 -0.687 -0.687
## q10|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q10|t2 -1.847 0.139 -13.271 0.000 -1.847 -1.847
## q10|t3 -1.491 0.109 -13.647 0.000 -1.491 -1.491
## q10|t4 -0.948 0.084 -11.234 0.000 -0.948 -0.948
## q10|t5 -0.326 0.073 -4.479 0.000 -0.326 -0.326
## q10|t6 0.037 0.071 0.511 0.609 0.037 0.037
## q11|t1 -2.228 0.193 -11.536 0.000 -2.228 -2.228
## q11|t2 -1.764 0.131 -13.483 0.000 -1.764 -1.764
## q11|t3 -1.421 0.105 -13.544 0.000 -1.421 -1.421
## q11|t4 -0.911 0.083 -10.934 0.000 -0.911 -0.911
## q11|t5 -0.275 0.072 -3.801 0.000 -0.275 -0.275
## q11|t6 0.093 0.072 1.306 0.192 0.093 0.093
## q12|t1 -2.140 0.178 -12.030 0.000 -2.140 -2.140
## q12|t2 -1.692 0.124 -13.609 0.000 -1.692 -1.692
## q12|t3 -1.317 0.099 -13.280 0.000 -1.317 -1.317
## q12|t4 -0.805 0.080 -10.002 0.000 -0.805 -0.805
## q12|t5 -0.225 0.072 -3.121 0.002 -0.225 -0.225
## q12|t6 0.118 0.072 1.647 0.100 0.118 0.118
## q13_rev|t1 -1.628 0.119 -13.673 0.000 -1.628 -1.628
## q13_rev|t2 -1.298 0.098 -13.217 0.000 -1.298 -1.298
## q13_rev|t3 -0.987 0.086 -11.529 0.000 -0.987 -0.987
## q13_rev|t4 -0.503 0.075 -6.726 0.000 -0.503 -0.503
## q13_rev|t5 -0.208 0.072 -2.895 0.004 -0.208 -0.208
## q13_rev|t6 0.192 0.072 2.668 0.008 0.192 0.192
## q14_rev|t1 -1.659 0.122 -13.648 0.000 -1.659 -1.659
## q14_rev|t2 -1.491 0.109 -13.647 0.000 -1.491 -1.491
## q14_rev|t3 -1.176 0.093 -12.700 0.000 -1.176 -1.176
## q14_rev|t4 -0.898 0.083 -10.832 0.000 -0.898 -0.898
## q14_rev|t5 -0.578 0.076 -7.616 0.000 -0.578 -0.578
## q14_rev|t6 -0.175 0.072 -2.441 0.015 -0.175 -0.175
##
## Variances:
## Estimate Std.Err z-value P(>|z|) Std.lv Std.all
## .q01 -0.242 -0.242 -0.242
## .q02_rev 0.642 0.642 0.642
## .q03_rev 0.675 0.675 0.675
## .q04 0.132 0.132 0.132
## .q05 0.129 0.129 0.129
## .q06 0.070 0.070 0.070
## .q07 0.161 0.161 0.161
## .q08 0.082 0.082 0.082
## .q09 0.094 0.094 0.094
## .q10 0.076 0.076 0.076
## .q11 0.024 0.024 0.024
## .q12 0.106 0.106 0.106
## .q13_rev 0.252 0.252 0.252
## .q14_rev 0.190 0.190 0.190
## .import_tema 0.713 0.061 11.744 0.000 0.713 0.683
## realidade 1.242 0.134 9.280 0.000 1.000 1.000
## causas 0.868 0.025 34.822 0.000 1.000 1.000
## valencia 0.839 0.030 27.849 0.000 1.000 1.000
## espacial 0.924 0.012 77.279 0.000 1.000 1.000
## temporal 0.748 0.064 11.778 0.000 1.000 1.000
##
## R-Square:
## Estimate
## q01 NA
## q02_rev 0.358
## q03_rev 0.325
## q04 0.868
## q05 0.871
## q06 0.930
## q07 0.839
## q08 0.918
## q09 0.906
## q10 0.924
## q11 0.976
## q12 0.894
## q13_rev 0.748
## q14_rev 0.810
## import_tema 0.317