I ran the same SEM model in sem and lavaan. I got the same parameters and, generally, very close test values, with the exception of AIC and BIC which were immensely different between the two packages.
The following is the resulting AIC and BIC from sem:
AIC = 2913.849
BIC = -1777.617
The following is the resulting AIC and BIC from lavaan:
Akaike (AIC) 37780.878
Bayesian (BIC) 38178.999
Why is there such a huge difference in these values? Are they calculated differently in each package?
edit:
Here are pieces of code on how I got such values.
In the case of package sem, I used the following line:
options(fit.indices = c("GFI", "AGFI", "RMSEA", "NFI", "NNFI", "CFI", "RNI", "IFI", "SRMR", "AIC", "AICc", "BIC", "CAIC"))
fit = sem(mymodel, cov(mydata), nrow(mydata), data = mydata)
summary(fit)
As for the package lavaan, the following line was used instead:
fit = sem(mymodel, data = mydata, estimator = "ML")
summary(fit,fit.measures=TRUE)
I am using R version 3.0.3 (2014-03-06) "Warm Puppy" (x64 version), sem package version 3.1-3 and lavaan package version 0.5-16 .