The data is not normal given the hz test statistic () Since the p-value is less than 0.05, we will reject the null hypothesis. This suggests that the dataset does NOT follow a multivariate normal distribution.
# Install and load the MVN package#install.packages("MVN")library(MVN)# Henze-Zirkler's multivariate normality testhz_test <-mvn(data = project2data, mvnTest ="hz")# Display the resultshz_test
$multivariateNormality
Test HZ p value MVN
1 Henze-Zirkler 33.94104 0 NO
$univariateNormality
Test Variable Statistic p value Normality
1 Anderson-Darling mse1 34.1727 <0.001 NO
2 Anderson-Darling mse2 29.6210 <0.001 NO
3 Anderson-Darling mse3 39.0862 <0.001 NO
4 Anderson-Darling mse4 40.5581 <0.001 NO
$Descriptives
n Mean Std.Dev Median Min Max 25th 75th Skew Kurtosis
mse1 450 3.000000 0.7461855 3 1 4 3 4 -0.3530132 -0.26181042
mse2 450 2.820000 0.7958971 3 1 4 2 3 -0.2503107 -0.41732108
mse3 450 3.024444 0.7043155 3 1 4 3 3 -0.3774284 0.03432538
mse4 450 3.120000 0.6992201 3 1 4 3 4 -0.5187700 0.28405032
Model Specification
# Install and load the lavaan package#install.packages("lavaan")library(lavaan)
This is lavaan 0.6-18
lavaan is FREE software! Please report any bugs.
Attaching package: 'lavaan'
The following object is masked from 'package:psych':
cor2cov
cfa(model, data = project2data, estimator ="MLR", bootstrap =1000)
lavaan 0.6-18 ended normally after 22 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 8
Number of observations 450
Model Test User Model:
Standard Scaled
Test Statistic 19.471 14.946
Degrees of freedom 2 2
P-value (Chi-square) 0.000 0.001
Scaling correction factor 1.303
Yuan-Bentler correction (Mplus variant)
lavaan 0.6-18 ended normally after 22 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 8
Number of observations 450
Model Test User Model:
Standard Scaled
Test Statistic 19.471 14.946
Degrees of freedom 2 2
P-value (Chi-square) 0.000 0.001
Scaling correction factor 1.303
Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 1036.086 636.985
Degrees of freedom 6 6
P-value 0.000 0.000
Scaling correction factor 1.627
User Model versus Baseline Model:
Comparative Fit Index (CFI) 0.983 0.979
Tucker-Lewis Index (TLI) 0.949 0.938
Robust Comparative Fit Index (CFI) 0.984
Robust Tucker-Lewis Index (TLI) 0.951
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -1490.557 -1490.557
Scaling correction factor 1.375
for the MLR correction
Loglikelihood unrestricted model (H1) -1480.821 -1480.821
Scaling correction factor 1.360
for the MLR correction
Akaike (AIC) 2997.113 2997.113
Bayesian (BIC) 3029.987 3029.987
Sample-size adjusted Bayesian (SABIC) 3004.598 3004.598
Root Mean Square Error of Approximation:
RMSEA 0.139 0.120
90 Percent confidence interval - lower 0.087 0.074
90 Percent confidence interval - upper 0.199 0.172
P-value H_0: RMSEA <= 0.050 0.003 0.008
P-value H_0: RMSEA >= 0.080 0.968 0.925
Robust RMSEA 0.137
90 Percent confidence interval - lower 0.078
90 Percent confidence interval - upper 0.205
P-value H_0: Robust RMSEA <= 0.050 0.010
P-value H_0: Robust RMSEA >= 0.080 0.944
Standardized Root Mean Square Residual:
SRMR 0.022 0.022
Parameter Estimates:
Standard errors Sandwich
Information bread Observed
Observed information based on Hessian
Latent Variables:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
mse =~
mse1 1.000 0.635 0.852
mse2 0.999 0.042 23.537 0.000 0.634 0.797
mse3 0.899 0.046 19.454 0.000 0.571 0.811
mse4 0.904 0.043 21.093 0.000 0.574 0.822
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.mse1 0.153 0.022 6.805 0.000 0.153 0.275
.mse2 0.230 0.022 10.359 0.000 0.230 0.364
.mse3 0.169 0.018 9.434 0.000 0.169 0.342
.mse4 0.158 0.024 6.725 0.000 0.158 0.325
mse 0.403 0.037 10.745 0.000 1.000 1.000
The model demonstrates a good fit, with the following factor loadings and fit indices: χ²(2) , CFI = 0.983, TLI = 0.949, RMSEA = 0.139, and SRMR = 0.022. Of the fit indixces. However, the chi-square index ( χ²(2) = 19.41, p < 0.05) did not demonstrate a good fit as the p-value was < 0.05. The standardized factor loadings for mse factor were 0.852 for mse1, 0.797 for mse2, 0.811 for mse3, and 0.822 for mse4. These results indicate that the observed variables can be explained by the mse factor, and the model provides a good fit to the data.
CFA Visualization before modification
# Install and load the semPlot package#install.packages("semPlot")library("semPlot")# Create a visual diagram of the CFA or SEM model.semPaths(onefactor_fit, whatLabels="std", sizeMan=10, edge.label.cex=1) # "std"=> displaying standardized values; change sizeMan and edge.label.cex to adjust the font size
Modification with added mse3 and mse4 correlation based on modificaiton indices results. The is followed by fitting the model again. The chi-square p-value has improved as a result (p>.05).
model2 <-'mse =~ mse1 + mse2 + mse3 + mse4 mse3~~mse4'# Fit the model againonefactor_fit2<-cfa(model2, data=project2data, estimator ="MLR", bootstrap =1000)# Summarize the modified modelsummary(onefactor_fit2, fit.measures=TRUE, standardized=TRUE)
lavaan 0.6-18 ended normally after 22 iterations
Estimator ML
Optimization method NLMINB
Number of model parameters 9
Number of observations 450
Model Test User Model:
Standard Scaled
Test Statistic 0.412 0.310
Degrees of freedom 1 1
P-value (Chi-square) 0.521 0.578
Scaling correction factor 1.330
Yuan-Bentler correction (Mplus variant)
Model Test Baseline Model:
Test statistic 1036.086 636.985
Degrees of freedom 6 6
P-value 0.000 0.000
Scaling correction factor 1.627
User Model versus Baseline Model:
Comparative Fit Index (CFI) 1.000 1.000
Tucker-Lewis Index (TLI) 1.003 1.007
Robust Comparative Fit Index (CFI) 1.000
Robust Tucker-Lewis Index (TLI) 1.005
Loglikelihood and Information Criteria:
Loglikelihood user model (H0) -1481.027 -1481.027
Scaling correction factor 1.364
for the MLR correction
Loglikelihood unrestricted model (H1) -1480.821 -1480.821
Scaling correction factor 1.360
for the MLR correction
Akaike (AIC) 2980.054 2980.054
Bayesian (BIC) 3017.037 3017.037
Sample-size adjusted Bayesian (SABIC) 2988.475 2988.475
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.107 0.086
P-value H_0: RMSEA <= 0.050 0.707 0.815
P-value H_0: RMSEA >= 0.080 0.136 0.065
Robust RMSEA 0.000
90 Percent confidence interval - lower 0.000
90 Percent confidence interval - upper 0.118
P-value H_0: Robust RMSEA <= 0.050 0.712
P-value H_0: Robust RMSEA >= 0.080 0.159
Standardized Root Mean Square Residual:
SRMR 0.003 0.003
Parameter Estimates:
Standard errors Sandwich
Information bread Observed
Observed information based on Hessian
Latent Variables:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
mse =~
mse1 1.000 0.656 0.880
mse2 0.986 0.046 21.283 0.000 0.647 0.814
mse3 0.820 0.041 19.779 0.000 0.538 0.765
mse4 0.827 0.041 20.304 0.000 0.543 0.777
Covariances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.mse3 ~~
.mse4 0.056 0.017 3.369 0.001 0.056 0.282
Variances:
Estimate Std.Err z-value P(>|z|) Std.lv Std.all
.mse1 0.125 0.020 6.166 0.000 0.125 0.225
.mse2 0.214 0.024 8.990 0.000 0.214 0.338
.mse3 0.206 0.020 10.476 0.000 0.206 0.416
.mse4 0.193 0.027 7.073 0.000 0.193 0.396
mse 0.431 0.037 11.521 0.000 1.000 1.000
The model demonstrates a strong fit to the data, with excellent factor loadings and fit indices: χ²(1) = 0.412, p = 0.521; CFI = 1.000, TLI = 1.003; RMSEA = 0.000; and SRMR = 0.003. The standardized factor loadings for mse factor were 0.880 for mse1, 0.814 for mse2, 0.765 for mse3, and 0.777 for mse4. Additionally, the mse3 and mse4 items showed a weak positive correlation (r = 0.282). These results indicate that the observed variables are well-explained by their respective factors, and the model provides a good fit to the data.
CFA Visualization after modification (Model 2)
# Create a visual diagram of the modified CFA model.semPaths(onefactor_fit2, whatLabels="std", sizeMan=10, edge.label.cex=1) # "std"=> displaying standardized values; change sizeMan and edge.label.cex to adjust the font size
Model2 Modification
Modification indices between correlations are equal, based on results.
# Compute the factor scoresfactorscores <-lavPredict(onefactor_fit2) # lavPredict(): This function computes the factor scores for the latent variables (e.g., verbal and math) based on the fitted CFA model (twofactor_fit).factorscores <-as.data.frame(factorscores) # Convert matrix to dataframe# Descriptive Statistics for Factor Scores:library("psych")describe(factorscores$mse)
vars n mean sd median trimmed mad min max range skew kurtosis se
X1 1 450 0 0.62 0.02 0.02 0.56 -1.87 0.96 2.83 -0.27 0.15 0.03
#describe(factorscores$math)# Column-binds two datasetsnewdata <-cbind(project2data, factorscores) # column-bind two data setshead(newdata) # Display the first six rows of newdata.
Composite Reliability (McDonald’s Omega) calculates the ratio of the variance explained by the latent factor to the total variance (true + error), making it a more flexible and accurate reliability measure than Cronbach’s Alpha, especially when factor loadings vary across items.
Coefficient Omega (McDonald’s Omega): A measure of internal consistency reliability, particularly useful when items load on multiple factors or when factor loadings are unequal. It is often considered a more robust alternative to Cronbach’s alpha.
Cronbach’s Alpha: A traditional measure of internal consistency, which assumes that all items are equally reliable and load on a single factor. It can underestimate reliability in some cases, which is why omega is preferred in more complex models.
# Install and load the semTools package#install.packages("semTools")library("semTools")
Alpha (Cronbach’s Alpha) for mse =0.890 which is approximately 0.90
Cronbach’s alpha is a traditional measure of internal consistency. The value indicates excellent reliability, as values above 0.90 are considered very strong. Alpha assumes that all items have equal factor loadings, which can sometimes underestimate the true reliability in more complex models.
Omega (McDonald’s Omega) for mse = 0.869
Omega is generally regarded as a more robust measure of reliability, especially when factor loadings differ across items or when the construct is multidimensional. The omega value is slightly below 0.90, indicating close to excellent internal consistency.