Plan your analysis before you collect data
Turn research questions into hypotheses, identify variables and their measurement levels, choose tests and work out the sample size you need.
Most problems in a results chapter start long before the analysis. A vague research question leads to a questionnaire that measures the wrong things, a sample that is too small to detect anything, and a supervisor asking “why did you use this test?”. Ten minutes of planning saves weeks later. In this lesson you plan the analysis for the study that runs through the whole course.
The course study
Imagine a master’s student studying wellbeing and academic performance at a university with 12,000 students. She surveys 240 students and records gender, age, faculty (Arts, Business, Engineering or Science), weekly study hours, average nightly sleep, a four-item stress scale (ST1 to ST4), a four-item social support scale (SS1 to SS4), whether the student has used the counselling service, and the student’s midterm and final exam scores. Her five research questions are:
- Do female and male students differ in perceived stress?
- Does stress differ between faculties?
- Is gender associated with using the counselling service?
- Which factors predict final exam performance?
- Does social support improve performance by reducing stress?
From question to hypothesis
A hypothesis is a testable statement about the population. Each one names the variables, the expected direction and, implicitly, the test. For question 1: H1: Female students report higher perceived stress than male students. The statistical null hypothesis is the opposite, “there is no difference in mean stress between female and male students”, and the test tells you how surprising your data would be if the null were true. Write one hypothesis per question; it makes the choice of test almost automatic.
Know your variables
The test you need depends on the measurement level of each variable and on its role (predictor or outcome).
| Level | What it means | Examples in the course data |
|---|---|---|
| Nominal | Categories without order | Gender, Faculty, Counselling, Passed |
| Ordinal | Ordered categories, unequal or unknown spacing | A single Likert item such as ST1 (1–5) |
| Interval or ratio (scale) | Numbers with equal spacing | Age, StudyHours, SleepHours, exam scores, the mean of several Likert items |
The mean of several Likert items, such as the stress score, is conventionally treated as a continuous scale variable. A single Likert item is better treated as ordinal.
Choosing the test
With the variables classified, match each hypothesis to a test. The table below covers the questions in this course and most thesis designs. The “Which test?” finder on the homepage asks the same questions interactively.
| Question type | Outcome | Predictor or groups | Test (non-parametric alternative) |
|---|---|---|---|
| Compare two independent groups | Continuous | 2 groups | Independent t-test (Mann-Whitney U) |
| Compare two measurements of the same people | Continuous | 2 time points | Paired t-test (Wilcoxon signed-rank) |
| Compare three or more groups | Continuous | 3+ groups | One-way ANOVA (Kruskal-Wallis) |
| Association between categories | Categorical | Categorical | Chi-square test of independence (Fisher’s exact) |
| Relationship between two numbers | Continuous | Continuous | Pearson correlation (Spearman) |
| Several predictors of one outcome | Continuous | Any | Multiple regression |
| Predict a yes/no outcome | Binary | Any | Binary logistic regression |
| Does X work through M? | Continuous | X and mediator M | Mediation analysis (PROCESS model 4) |
So the plan is: an independent t-test for RQ1, a one-way ANOVA for RQ2, a chi-square test for RQ3, multiple regression for RQ4 and a mediation model for RQ5. Write this plan into your methods chapter before you see the data; it protects you from the temptation to try test after test until something is significant.
How many participants do you need?
A study that is too small has low statistical power: even if the effect exists, the test will probably miss it. A power analysis asks four linked quantities: the expected effect size, the significance level α (usually .05), the desired power (usually .80) and the sample size. Fix three and you get the fourth. For a t-test, a “medium” effect is Cohen’s d = 0.5. Base the expected effect on earlier studies whenever you can; Cohen’s small, medium and large labels are a last resort.
Run an a priori power analysis
- The link opens the tool set to an independent t-test with d = 0.5, α = .05 and 80% power.
- Read the required sample size: 64 per group, 128 in total.
- Change the power to 0.90 and note how the total rises to 172.
- Switch the test to correlation or regression and try your own expected effect.
For a medium difference between two groups you need 128 students, 64 per group. For the ANOVA with four faculties and a medium effect (f = 0.25), the same tool gives 180 in total, and for a regression with four predictors and f² = 0.15 it gives 85. The study’s 240 students cover all of these. If you expect small effects (d = 0.2), you would need almost 800 students, which is why it is worth checking before you start.
Sample size for describing a population
If your aim is to estimate a percentage, such as the share of students who use counselling, the question is how precise the estimate must be. The survey sample size calculator uses the margin of error instead of an effect size.
Find the survey sample size for a population of 12,000 students
- Population size 12,000, margin of error ±5%, 95% confidence, expected proportion 50%.
- The tool returns 373 completed responses.
- Set the expected response rate to 30% to see how many invitations to send.
With a population of 12,000 and a ±5% margin of error at 95% confidence, you need 373 completed responses. Our student has 240, which gives a margin of error of about ±6.3%, perfectly adequate for testing relationships but worth mentioning as a limitation if she reports percentages.
Key takeaways
- Write one hypothesis per research question, with a direction where theory supports one.
- Classify every variable as nominal, ordinal or scale, and as predictor or outcome; the test follows.
- Run an a priori power analysis and report it: “An a priori power analysis indicated that 128 participants were required to detect d = 0.5 with 80% power at α = .05.”
- Plan the analyses before seeing the data.
Check your understanding
Answer each question to see the explanation. Finishing the quiz marks this lesson as complete.