Preparing SPSS Data for CFA and SEM in JASP, a Free AMOS Alternative
Check value ranges, count missing data, run Little’s MCAR test, choose FIML and open a clean .sav file in free JASP
Key takeaways
Most errors in a first CFA or SEM run come from the data file: out-of-range values, reverse-worded items that were never recoded, wrong variable types or clashing names.
In the sample data, 254 of the 267 respondents answered all 20 items, and the 21 missing cells are only 0.39% of the data.
Little's MCAR test (chi-square = 223.26, df = 239, p = 0.760) gives no evidence that the data are missing in a systematic way.
FIML, listwise deletion and mean substitution give almost identical results here, but FIML stays the default and mean substitution should not be used.
Declare the items as Scale in SPSS so that JASP estimates with ML, and use Sync Data in JASP when the
.savfile changes.
In Post 20, "Your First Model in JASP", the first model ran after changing the variable types in JASP and choosing FIML. In practice, most errors in a first CFA or SEM run do not come from the model but from the data file: variable names that clash with latent variables, reverse-worded items that were never recoded, variable types that make the software use the wrong estimator or blank cells handled by a default you did not intend. This post shows how to prepare a clean data file for CFA and SEM, decide how to handle missing data and then open and sync that file in JASP.
Sample data and scripts. The data files and scripts for this post are in the research-data-analysis repository on GitHub (folder
data/andscripts/). Download the whole repository with Code > Download ZIP.
About the figures and numbers. The data preparation part uses PSPP 2.1.2 (Free Software Foundation, 2026) with real output from the syntax file
prepare_sem_data.sps(in thescripts/folder of the repository; Figures 2 and 3 come fromfigure_tables.sps, which runs the same commands with short labels so the tables stay narrow). The missing-data analysis uses R and the lavaan package (Rosseel, 2012), filecompare_missing_data.R. The JASP screenshots were taken in JASP 0.99.0 on macOS (JASP Team, 2026).
1. Six steps to prepare the data file
Step 1. Keep the valid responses
Use only the responses that passed the cleaning in Post 8, "Data Cleaning in PSPP (SPSS)": drop those that failed the screening question or the attention check, or gave the same answer to every item. The file marketplace_x_analysis.sav keeps 267 responses.
Step 2. Check the value range
Every Likert item must lie between 1 and 5. A single value of 55 that slips through (like the error in item SAT2 found in Post 8) distorts the whole covariance matrix, and SEM software gives no warning about it.
DESCRIPTIVES VARIABLES=CONF1 CONF2 CONF3 CONF4 PV1 PV2 PV3 PV4
SAT1 SAT2 SAT3 SAT4 TRU1 TRU2 TRU3 TRU4R RI1 RI2 RI3 RI4
/STATISTICS=MEAN STDDEV MIN MAX.
The N column tells you how many respondents answered each item: from 264 (CONF3, RI1) to 267. Note the two rows at the bottom of the table in PSPP 2.1.2: Valid N (listwise) shows 267 and Missing N (listwise) shows 13. The 267 does not match the number of respondents who answered all 20 items (only 254, see Step 4), while 13 equals the number of respondents with at least one blank item. To get an exact count, this post uses the COUNT command.
(In prepare_sem_data.sps the items keep their full labels and value labels, so PSPP 2.1.2 prints the item wording as row names and shows Minimum and Maximum as the labels "Strongly disagree" and "Strongly agree"; the numbers are the same as in Figure 2.)
Step 3. Reverse-code the reverse-worded item
Item TRU4 ("I worry that marketplace X does not keep its promises") runs in the opposite direction from the other Trust items. Use TRU4R (reverse-coded in Post 10, "Recoding Variables and Computing Composite Scores in PSPP (SPSS)") in the model, not TRU4. If TRU4 goes into the model by mistake, its loading will be negative and the reliability of the scale drops sharply, as seen with Cronbach's alpha in Post 11, "Cronbach's Alpha in PSPP (SPSS)".
Step 4. Count the missing data
COUNT N_MISSING = CONF1 CONF2 CONF3 CONF4 PV1 PV2 PV3 PV4
SAT1 SAT2 SAT3 SAT4 TRU1 TRU2 TRU3 TRU4R RI1 RI2 RI3 RI4 (MISSING).
FREQUENCIES N_MISSING.
254 respondents (95.1%) answered all 20 items.
5 respondents left 1 item blank, 8 respondents left 2 items blank.
In total there are 21 missing cells out of 5,340 (267 x 20), that is 0.39%.
Step 5. Use names that do not clash
The file marketplace_x_analysis.sav contains the columns CONF, PV, SAT, TRU and RI (the mean scores created in Post 10). The latent variables in this series are named CONFIRM, VALUE, SATISF, TRUST and INTENT, so there is no clash; but if you keep mean-score columns, you must not give those names to factors, because lavaan (inside JASP) reports a name clash (Post 20). The simplest fix is to drop the mean-score columns from the file used for CFA and SEM. Also:
Use plain names without spaces or special characters (CONF1, TRU4R), at most a few dozen characters long.
Convert user-defined missing codes (for example 9 or 99 meaning "no answer") into blank cells (system-missing). The sample file has no such codes, but this is a common mistake when data are entered in Excel.
Step 6. Save a lean file for CFA and SEM
SAVE OUTFILE='../data/marketplace_x_sem.sav'
/KEEP=ID GENDER OCCUP INCOME AGEGROUP
CONF1 CONF2 CONF3 CONF4 PV1 PV2 PV3 PV4 SAT1 SAT2 SAT3 SAT4
TRU1 TRU2 TRU3 TRU4R RI1 RI2 RI3 RI4 N_MISSING.The syntax file prepare_sem_data.sps creates the three files in Table 1; all three are in the data folder of the repository.
The grouping variables (GENDER, OCCUP, INCOME, AGEGROUP) are kept for the multigroup analysis in Post 29, "Multigroup Analysis and Moderation with JASP". The syntax file also declares the 20 items as quantitative variables (VARIABLE LEVEL ... (SCALE)). This step matters for JASP: JASP reads the variable type from the .sav file, and if the items are Ordinal, JASP estimates with DWLS instead of ML (Post 20). Declaring the type in SPSS saves you from changing it by hand in JASP.
2. Are the data missing at random?
How to handle missing data depends on the mechanism behind it (Enders, 2022):
MCAR (missing completely at random): missingness is unrelated to any variable. For example, a respondent skips a line by accident.
MAR (missing at random): missingness is related to variables that are in the data. For example, older respondents skip questions about the mobile app more often.
MNAR (missing not at random): missingness is related to the missing value itself. For example, very dissatisfied respondents deliberately skip the satisfaction questions.
Little's MCAR test (Little, 1988) compares the means of groups of respondents who share the same missing-data pattern. The null hypothesis H0 is that the data are missing completely at random. JASP, AMOS and PSPP do not offer this test; SPSS has it in the Missing Value Analysis module. The file compare_missing_data.R computes it directly from Little's formula:
Chi-square = 223.26; df = 239; p = 0.760.
p is larger than 0.05, so we do not reject the MCAR hypothesis: there is no evidence that the data are missing in any systematic way. Note that this test can only detect departures from MCAR; it cannot prove that the data are MCAR, and it cannot tell MAR from MNAR.
3. Choose how to handle missing data

There are three common methods:
FIML (full information maximum likelihood). Estimates the model from all the information available for each respondent, without dropping anyone. This is the recommended method when data are MCAR or MAR (Enders, 2022). In JASP: check that Missing data handling in the Advanced section of the analysis is set to FIML.
Listwise deletion. Drops every respondent with at least one blank cell. Simple and unbiased when data are MCAR, but it loses sample size.
Mean substitution. Fills each blank cell with the mean of that item. This shrinks variances and correlations, so it should not be used (Enders, 2022).
Comparing the three methods on the sample data
The file compare_missing_data.R fits the five-factor measurement model (20 items, analyzed in detail in Post 22, "Confirmatory Factor Analysis (CFA) in JASP") in each of the three ways (Table 2).
With only 0.39% missing cells and MCAR data, the three methods give almost identical results: the standardized loadings differ by at most 0.014 between listwise deletion and FIML. This conclusion does not carry over to a high missing rate (usually 5% or more) or to data that are not missing at random: then a poor choice can bias the coefficients and standard errors noticeably.
A note on AMOS
AMOS uses FIML when you tick Estimate means and intercepts, but when the data have blank cells AMOS does not provide modification indices, bootstrapping or some indices such as GFI and AGFI (Byrne, 2016). AMOS users must then run the model on the complete-case file (marketplace_x_sem_complete.sav) or impute the data with Analyze > Data Imputation, which offers Regression imputation, Stochastic regression imputation and Bayesian imputation (prefer the last two, because they keep the natural variability of the data). JASP (through lavaan) computes modification indices with FIML, so the JASP series uses FIML with the 267-respondent file throughout. The 254-respondent file is still useful to check the robustness of the results.
When you write your thesis, state which method you chose and why.
4. Open and sync the data in JASP
Open the prepared file
Click the three-line menu icon, choose Open > Computer > Browse and select
marketplace_x_sem.sav(as in Post 20).Check the type icon at the top of the item columns: it must be the ruler (Scale), thanks to the
VARIABLE LEVELdeclaration in Step 6 (Figure 5, box 1). There is no need to change the variable type by hand as in Post 20.Check the blank cells: JASP shows a missing value as a dot (Figure 5, box 2).

Check the missing data with Descriptives
Choose Descriptives > Descriptive Statistics, move CONF1 to RI4 into the Variables box and tick Transpose descriptives table so that each item is on its own row.

The Missing column shows that CONF3 and RI1 have the most blank cells (3 each); the total is 21, the same as in PSPP. The Valid column (264 to 267) equals the N column of PSPP, and the means agree after rounding (for example CONF1: 3.875 in JASP, 3.88 in PSPP).
Sync when the data change
JASP keeps a copy of the data inside the .jasp file. If you later change the .sav file in SPSS (add responses, fix data-entry errors), JASP can sync the data and rerun every analysis:
Click the three-line menu icon and choose Sync Data (Figure 7, box 1).
Click the name of the source file under Current File (Figure 7, box 2), or press Cmd+Y (Ctrl+Y on Windows).
If you rename a variable in SPSS, that variable disappears from the analyses that use it in JASP; you have to add the renamed variable again.
If you use AMOS
In AMOS, open the prepared file with File > Data Files (Ctrl+D): click File Name, choose marketplace_x_sem.sav, check that the N column shows 267/267 and click OK. If the file is open in SPSS Statistics, Analyze > IBM SPSS Amos opens AMOS and connects it to the saved file on disk. View > Variables in Dataset (Ctrl+Shift+D) should list CONF1 to RI4 (with TRU4R instead of TRU4) and no longer list CONF, PV, SAT, TRU and RI. AMOS reads the .sav file every time it runs, so after a change you only save the file in SPSS and run the model again; a renamed variable must also be renamed in the AMOS diagram.
Save a .jasp file
After opening and checking the data, save your work with Cmd+S (Ctrl+S on Windows), for example as post21-data.jasp. You can open this file in the next posts to run CFA (Post 22) and SEM (Post 26, "Structural Equation Model (SEM) in JASP"), or start again from marketplace_x_sem.sav in the data folder.
5. Five common mistakes when connecting data
Keeping a mean-score column with the same name as a factor. lavaan in JASP reports a name clash.
Using an item that was not reverse-coded. The loading is negative and reliability drops.
Leaving the items as Ordinal. JASP estimates with DWLS instead of ML, and the results do not match AMOS or the posts that use ML.
Using 9 or 99 for blank cells without converting them to system-missing. These values are counted as real answers.
Leaving Missing data handling at Listwise deletion. JASP then drops the 13 respondents with blank cells without telling you; choose FIML in the Advanced section of each analysis.
Frequently asked questions
Should I just delete respondents with blank cells to keep things simple?
With a very low missing rate and MCAR data, as in this sample, listwise deletion gives almost the same results as FIML. FIML is still the better default because it keeps the sample size and stays unbiased when data are MAR. Use the complete-case file to check the robustness of your results.
How much missing data is too much?
There is no absolute threshold. Many authors consider less than 5% low. The mechanism matters more than the rate: 3% missing under MNAR can cause more bias than 10% missing completely at random.
Do I need to standardize the data (convert to z-scores) before using JASP?
No. JASP works with the raw data and computes standardized coefficients when you choose Standardization = All.
Does JASP read value labels (Agree, Disagree, ...)?
Yes, JASP shows the labels next to the numeric values in the data view. Labels do not affect CFA or SEM results when the variables are Scale.
Can JASP read Excel files?
JASP reads .csv, .txt, .sav, .dta, .ods and some other formats. For Excel, save the sheet as .csv first. The file marketplace_x_sem.csv in the repository is ready to use.
References
Byrne, B. M. (2016). Structural equation modeling with AMOS: Basic concepts, applications, and programming (3rd ed.). Routledge.
Enders, C. K. (2022). Applied missing data analysis (2nd ed.). Guilford Press.
Free Software Foundation. (2026). GNU PSPP (Version 2.1.2) [Computer software]. https://www.gnu.org/software/pspp/
JASP Team. (2026). JASP (Version 0.99.0) [Computer software]. https://jasp-stats.org/
Little, R. J. A. (1988). A test of missing completely at random for multivariate data with missing values. Journal of the American Statistical Association, 83(404), 1198–1202. https://doi.org/10.1080/01621459.1988.10478722
Rosseel, Y. (2012). lavaan: An R package for structural equation modeling. Journal of Statistical Software, 48(2), 1–36. https://doi.org/10.18637/jss.v048.i02




Discussion about this post