Worked Example: Survey Data Analysis from Raw Data to Results
Follow a complete small analysis: clean the data, check scale reliability, compare two groups and write up the result. Every number below was calculated from the dataset you can download and try yourself.
The scenario
A training organisation asks 60 participants to rate a course on five statements (Q1 to Q5) from 1 (strongly disagree) to 5 (strongly agree). Thirty took the course online and thirty in person. Research question: do in-person participants report higher satisfaction than online participants?
Please note: these are simulated demonstration data, built to include typical data problems. They are not from a real survey. Download the dataset (Excel) and repeat the steps yourself.
Step 1: Look for problems in the raw data
Before any analysis, check each variable for missing values and impossible values. In the raw file we found:
- 4 blank cells: Q3 for R008, Q2 for R022, Q5 for R041 and Age for R051.
- 1 impossible rating: Q4 for R014 is 55, almost certainly a typing slip for 5.
- 1 impossible age: R034 has age 250.
In Excel, filter each column or use =COUNTBLANK(D2:H61) for blanks and =COUNTIF(D2:H61,">5") for values above the scale maximum. Our cleaning checklist lists these checks in order.
Step 2: Decide and document what to do
- We cannot be sure that 55 means 5, so we treat it as missing instead of guessing. The age of 250 is also set to missing.
- We keep the original file untouched and record each change in a cleaning log: 2 values set to missing.
- For the satisfaction score we require all five items, so respondents with any missing item (R008, R014, R022, R041) are left out of that score. That leaves 56 of 60 respondents: 27 online and 29 in person.
This is a simple choice that suits 7% missing. With more missing data, look into the pattern before dropping cases. See our missing data and outlier handling page.
Step 3: Describe the sample
Age was available for 58 respondents: mean 35.3 years, SD 10.1, median 34, range 19 to 53. Group sizes were equal in the raw data (30 and 30).
Step 4: Check that the five items form a reliable scale
Cronbach’s alpha for the five items (56 complete cases) is 0.91, which indicates high internal consistency, so averaging the items into one score is reasonable. You can reproduce this with our Cronbach’s alpha calculator. An alpha this high can also mean items are very similar, so read the items before assuming the scale is good.
Step 5: Compute the satisfaction score and describe each group
The score is the mean of Q1 to Q5. In Excel, with items in D to H: =IF(COUNT(D2:H2)=5,AVERAGE(D2:H2),"").
| Group | n | Mean | SD |
|---|---|---|---|
| Online | 27 | 3.21 | 0.76 |
| In person | 29 | 4.07 | 0.80 |
Step 6: Choose and run the test
We compare the means of two independent groups on a score that is approximately continuous, so an independent-samples t-test fits. Because group variances and sizes differ slightly, we use Welch’s t-test, which does not assume equal variances. A normality check (Shapiro-Wilk) was fine for the online group (p = .56) but not for the in-person group (p = .003), because many scores sit near the maximum of 5. So we also run a Mann-Whitney U test as a robustness check. See how to choose a statistical test.
| Result | Value |
|---|---|
| Difference in means (in person minus online) | 0.85 points |
| Welch’s t | t(54.0) = 4.09, p < .001 |
| 95% CI of the difference | 0.44 to 1.27 |
| Cohen’s d (pooled SD) | 1.09 (large) |
| Mann-Whitney U | U = 607, p < .001 |
Both tests agree, which makes the conclusion more convincing. You can check the t-test with our free t-test tools.
Step 7: Write up the result
Satisfaction scores (mean of five items, 1 to 5; Cronbach’s α = .91) were higher among in-person participants (M = 4.07, SD = 0.80, n = 29) than online participants (M = 3.21, SD = 0.76, n = 27). The difference of 0.85 points was statistically significant, Welch’s t(54.0) = 4.09, p < .001, 95% CI [0.44, 1.27], with a large effect size (Cohen’s d = 1.09). A Mann-Whitney test gave the same conclusion (U = 607, p < .001). Four of 60 respondents were excluded because of missing item responses.
Step 8: State what the result does and does not show
- It shows that, in this sample, in-person participants rated the course about 0.85 points higher.
- It does not show that in-person delivery caused higher satisfaction. If people chose their format, differences between those who chose each could explain the gap.
- A large effect on simulated data does not predict what a real survey would find.
- Report the confidence interval as well as the p-value, because it shows how precise the estimate is.
What to take from this example
- Check and document data problems before analysing.
- Check scale reliability before combining items.
- Pick the test to fit the data and the design, and run a robustness check when assumptions are doubtful.
- Report effect size and confidence interval, not only p.
- Be clear about what the design allows you to conclude.
If you want this kind of cleaning, analysis and write-up done for your own survey, see survey data analysis and Likert scale analysis.
Frequently asked questions
Can I use this dataset for teaching?
Yes. It is simulated, free to use and includes deliberate errors so learners can practise cleaning.
Why use Welch’s t-test instead of the standard t-test?
Welch’s test does not assume equal variances and performs well when group sizes differ, so it is a safe default.
Should I average Likert items into a score?
It is common when the items measure one concept and have good reliability. Some researchers prefer non-parametric tests for single Likert items.
What if I have more than two groups?
Use ANOVA or Kruskal-Wallis, and run post-hoc tests only if the overall test is significant.
Related guides, tools and services
Want an expert to check or run your analysis?
Send us your question and data description. We reply with a clear plan and a quote.
Discuss your project on WhatsAppAlso related: AI prompts for statistical analysis · Data cleaning and validation
