P. Hustinx posted on Thursday, April 12, 2012 - 9:01 am
I'm still trying to find out why Mplus sometimes gives different results than SPSS for, for instance a simple regression.
I recently discovered that Mplus also sometimes gives different means compared to SPSS. But this concerned variables with a lot of decimals, where SPSS calculates using all the decimals, even if they are not all made visible.
But what happens if you copy the data to a .dat-file for MPlus use, from an SPSS-file in which no decimals have been made visible. In the .dat-file you see data then without decimals behind the dot. But what data does Mplus read then. I found out that it is not just reading the data without decimals and it's also not calculating with an endless string of decimals. As far as I could find out that in agreement with the use of three decimals in the output, it's 'seeing' three decimals behind the dot. If I cut the SPSS data after three decimals, the SPSS results are quite the same as the MPlus results.
Am I right that MPlus calculates with three decimals, also when they are not visible? And how does MPlus see these decimals then?
But still the problem remains that MPlus sometimes also gives slightly different results in regressions in cases without ambiguity about the number of decimals, even if there are no decimals at all in all variables. I still don't have the explanation for that.
Mplus reads the data as they are given, for example, if five values are given after the decimal point, Mplus reads five. Mplus does the analysis using double precision. This means it has 7 digits of precision whether before or after the decimal. Mplus prints 3 decimals.
If you have the same data, same sample, and same estimator, you will obtain the same results in Mplus and SPSS. SPSS computes sample statistics using all available information for each variable. Mplus uses the sample size for each variable that is used in model estimation.
P. Hustinx posted on Wednesday, April 18, 2012 - 8:57 am
Thanks, Mrs. Muthén, for your quick answer. The problem with the different means has been solved.
There still see to be some differences in results of regressions, but let me first try to solve it myself.
Excuse me, by the way, that I may have posted this under the wrong topic.
I have the same problem. I get different results in spss and mplus for regression. My input for mplus is: DATA: FILE IS 2013.dat; VARIABLE: NAMES ARE WE Job; USEVARIABLES ARE WE Job; MISSING ARE ALL (-9); MODEL: WE ON Job; [Job] OUTPUT : SAMPSTAT STDYX TECH1;
The syntax in spss is: REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT WE /METHOD=ENTER Job.
I think that the problem is that MPlus does not read my variables correctly. Correlations look fine in spss so there is nothing wrong with the dataset.
The thing is that I use different inputs for different variables and I always get the same results in mplus. I get the same value, the same significance and the same R square for every single model. (I got the same values/results for about 30 different inputs). Please note that I ran the tests in my computer and in my supervisor's computers and it is always the same.Here 2 of the inputs I used with different variables and I got the same results.
DATA: FILE IS All data_clean first for mplus_4.12.2013.dat; VARIABLE: NAMES ARE WEng JobSat; USEVARIABLES ARE WEng JobSat; MISSING ARE ALL (-9); MODEL: WEng ON JobSat; [JobSat] OUTPUT : SAMPSTAT STDYX TECH1;
DATA: FILE IS All data_clean first for mplus_4.12.2013.dat; VARIABLE: NAMES ARE EmoDiss EPO; USEVARIABLES ARE EmoDiss EPO; MISSING ARE ALL (-9); MODEL: EmoDiss ON EPO; [EPO] OUTPUT : SAMPSTAT STDYX TECH1;
As you can see I am using totally different variables and I get the same results for both.
Let's say you have four columns in your data set. Each column represents a different variable. The variable names in the NAMES statement should specify the name that is appropriate for the column, for example,
NAMES ARE gender ses math english;
You can't say
NAMES ARE ses gender english math;
if that is not the order of the columns in the data set.