# Four New Corrected Statistics for SEM (R)

This file contains an R program to obtain the test statistics proposed in paper “Four New Corrected Statistics for SEM With Small Samples and Nonnormally Distributed Data”.

Jiang, G., & Yuan, K.-H. (2017). Four New Corrected Statistics for SEM With Small Samples and Nonnormally Distributed Data. Structural Equation Modeling: A Multidisciplinary Journal, 24, 479-494. doi: 10.1080/10705511.2016.1277726

```Authors: Ge Jiang and Ke-Hai Yuan
```

##=======================================================================================##
## This program requires the input of 1) likelihood ratio statistic, 2) Satorra-Bentler’s mean rescaled statistic,
## 3) Satorra-Bentler’s mean and variance adjusted statistic, and 4) their degrees of freedom
## from standard output from any major statistic packages (Mplus, SAS, EQS, R:lavaan)
##=======================================================================================##

# The likelihood ratio statistic:
T_ml;
# Satorra-Bentler’s mean rescaled statistic:
T_rml;
# Degrees of freedom:
df;
# Satorra-Bentler’s mean and variance adjusted statistic:
T_aml; df_aml;

# Scaling factor in T_rml:
r_1 = T_ml/T_rml
# trace of the UGamma matrix:
tr = r_1*df
# rank of the UGamma matrix:
rk = min(df, n-1)

# First Corrected Statistic
const1 = tr/rk
T_cor1 = T_ml/const1
p_cor1 = 1-pchisq(T_cor1, df)
# Second Corrected Statistic
const2 = (r_1+const1)/2
T_cor2 = T_ml/const2
p_cor2 = 1-pchisq(T_cor2, df)
# Third Corrected Statistic
T_cor3 = (T_rml+T_cor1)/2
p_cor3 = 1-pchisq(T_cor3, df)
# Fourth Corrected Statistic
p_rml = 1-pchisq(T_rml, df)
p_aml = 1-pchisq(T_aml, df_aml)
p_cor4 = (p_rml+p_aml)/2