FreeStatisticalTools.com
Lesson 1 of 11 · 15 min

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:

  1. Do female and male students differ in perceived stress?
  2. Does stress differ between faculties?
  3. Is gender associated with using the counselling service?
  4. Which factors predict final exam performance?
  5. 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).

LevelWhat it meansExamples in the course data
NominalCategories without orderGender, Faculty, Counselling, Passed
OrdinalOrdered categories, unequal or unknown spacingA single Likert item such as ST1 (1–5)
Interval or ratio (scale)Numbers with equal spacingAge, 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 typeOutcomePredictor or groupsTest (non-parametric alternative)
Compare two independent groupsContinuous2 groupsIndependent t-test (Mann-Whitney U)
Compare two measurements of the same peopleContinuous2 time pointsPaired t-test (Wilcoxon signed-rank)
Compare three or more groupsContinuous3+ groupsOne-way ANOVA (Kruskal-Wallis)
Association between categoriesCategoricalCategoricalChi-square test of independence (Fisher’s exact)
Relationship between two numbersContinuousContinuousPearson correlation (Spearman)
Several predictors of one outcomeContinuousAnyMultiple regression
Predict a yes/no outcomeBinaryAnyBinary logistic regression
Does X work through M?ContinuousX and mediator MMediation 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.

Try it in the tool

Run an a priori power analysis

  1. The link opens the tool set to an independent t-test with d = 0.5, α = .05 and 80% power.
  2. Read the required sample size: 64 per group, 128 in total.
  3. Change the power to 0.90 and note how the total rises to 172.
  4. 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.

Try it in the tool

Find the survey sample size for a population of 12,000 students

  1. Population size 12,000, margin of error ±5%, 95% confidence, expected proportion 50%.
  2. The tool returns 373 completed responses.
  3. 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.

Q1A researcher wants to know whether stress differs between four faculties. Which test fits?
Q2What is the measurement level of “Faculty” (Arts, Business, Engineering, Science)?
Q3In a power analysis, increasing the desired power from .80 to .90 while keeping d and α the same will…
Q4Why should you plan the analyses before seeing the data?