Your first cross-sectional study: SPSS from data entry to analysis

Pages/Insights

Scholars' Guild

Your first cross-sectional study: SPSS from data entry to analysisMethods

Your first cross-sectional study: SPSS from data entry to analysis

9 min read

A cross-sectional study is the right first study for most medical students. It is one point in time, one sample, one instrument, and it answers questions of the form: how common is this, and what travels with it? It will not establish causation and you should never claim that it does — but it is a real study design, it is publishable, and it will teach you more about statistics in ten weeks than a year of lectures.

What follows is the workflow we teach in the Methods track, in the order you will actually do it.

Build the codebook before you touch SPSS

The single highest-return hour in the whole project is the one you spend writing a codebook in a spreadsheet before any data exists. One row per variable, with five columns: variable name, what the question actually asked, the type (nominal, ordinal, scale), the permitted values with their labels, and the missing-value code.

Do this and everything downstream gets easier. Skip it and you will be sitting in front of a variable called q7_2 in November with no memory of whether 1 meant yes or no. Reviewers ask for instruments and coding schemes; the codebook is half of your response letter already written.

Two rules that save the most pain. Name variables so they sort meaningfully and read as English — age_years, bmi, smoker_current, phq9_total — never q1 through q40. And choose a missing code that cannot be a real value, conventionally 99 or 999, and declare it in SPSS as a discrete missing value rather than leaving cells empty.

Variable View is not optional

SPSS has two panes, and students spend all their time in the wrong one. Data View is where numbers sit. Variable View is where the dataset becomes intelligible, and every minute there pays back tenfold.

For each variable set the Name, set the Label to the full question text, set Values to the full label set for every code, set Missing to your missing code, and — this is the one everyone skips — set Measure correctly to Nominal, Ordinal or Scale. SPSS uses Measure to decide which analyses and charts it will offer you. Leave a five-point Likert item marked as Scale and the software will happily compute its mean without complaint. Mark it Ordinal and it will steer you toward the right test.

Set the Type for identifiers to String and everything else to Numeric. Dates entered as text are the second most common reason a dataset has to be rebuilt from scratch.

Enter data once, check it twice

Enter directly into SPSS or into a flat spreadsheet with one row per participant and one column per variable, then import. Never merge, colour, or leave blank rows in a data sheet — every one of those breaks the import.

Before you analyse anything, clean. Run Frequencies on every categorical variable and read the output for impossible codes: a 3 in a variable that only has 1 and 2, a sex code you never defined. Run Descriptives on every continuous variable and read the minimum and maximum: an age of 210, a weight of 7, a systolic pressure of 12. These are typing errors, not findings, and they are trivially findable at this stage and catastrophic later.

Then quantify missingness per variable and decide, in writing, what you will do about it. Complete-case analysis is acceptable in a student cross-sectional study if you state the number excluded and why. Silently dropping cases is not.

The four tests a cross-sectional paper usually needs

Table 1, the description. Frequencies with percentages for categorical variables; mean with standard deviation for continuous variables that are approximately normal; median with interquartile range for those that are not. Judge normality on a histogram and the skewness value, not on a Shapiro-Wilk p-value alone — in a sample of four hundred that test rejects normality for distributions that are perfectly fine to summarise with a mean.

Categorical against categorical: chi-square test of independence, via Analyze, Descriptive Statistics, Crosstabs, with the chi-square statistic requested and the expected-count assumption checked. If more than twenty per cent of cells have an expected count below five, use Fisher's exact test instead. Report the cell percentages in the direction that answers your question, and say which direction that is.

Continuous against a two-level group: independent-samples t-test if the distribution supports it, Mann-Whitney U if it does not. Read Levene's test in the SPSS output and take the corresponding row — the equal-variances-not-assumed line exists for a reason.

Continuous against continuous: Pearson correlation for linear relationships between normally distributed variables, Spearman otherwise. Always plot the scatter before you trust the coefficient.

Beyond those four, binary logistic regression is where a cross-sectional paper becomes genuinely interesting, because it lets you report an association adjusted for confounders. Report adjusted odds ratios with 95% confidence intervals, state every variable in the model, and say how you chose them.

From output to manuscript

SPSS output is not a results section. Nobody wants to see a pasted SPSS table, and most journals will reject one on sight. Rebuild every table by hand in your word processor, in the journal's format, with the decimal places you intend and nothing you do not intend.

Report effect sizes, not only p-values. A p-value tells a reader whether you can distinguish your finding from noise; a proportion, a mean difference or an odds ratio with its confidence interval tells them whether it matters. Give exact p-values to three decimals, and write p < 0.001 only below that threshold.

Write results in the past tense with no interpretation, and keep every interpretive sentence for the discussion. And be honest about design: a cross-sectional study shows association. The words caused, led to, and resulted in do not belong anywhere in your manuscript.

Finally, save the .sav file, the syntax, and the codebook together, and keep the syntax. Every point-and-click action in SPSS can be pasted as syntax instead of run, and a saved syntax file is what lets you re-run the entire analysis in ninety seconds when a reviewer asks you to exclude a subgroup. Students who keep syntax revise in a day. Students who do not revise in a fortnight.