Find a course

Module 4: Mixed Methods, Secondary Data and AnalysisLesson 12 of 1412 min

Matching the Analysis to Your Data

Identify levels of measurement, clean and screen data, and choose a fitting statistical test or qualitative analysis for a given research question.

Step 1 of 13Learn

The average region

A student coded participants' home regions as 1 = North, 2 = South, 3 = East, 4 = West, and then reported that the "average region was 2.6." The software calculated it without complaint, but the number means nothing. Region is a category; the numbers are just labels.

The first question in choosing any analysis is: what kind of variable is this? The classic scheme has four levels of measurement:

  • Nominal: categories with no order (region, blood type, political party). You can count and compare frequencies.
  • Ordinal: ordered categories with unequal or unknown gaps (education level, a ranking, "never / sometimes / often"). You can say more or less, but not how much more.
  • Interval: equal gaps but no true zero (temperature in Celsius, calendar years). Differences make sense; ratios do not: 20°C is not "twice as hot" as 10°C.
  • Ratio: equal gaps and a true zero (income, weight, reaction time, number of children). All arithmetic makes sense.

Interval and ratio variables are often grouped as continuous or scale variables. Likert-type items are technically ordinal, though sums of several items are commonly treated as approximately continuous. When in doubt, report the choice and its justification.

Step 2 of 13Practice · Sort into groups

Sort each variable by its level of measurement.

Tap an item, then tap its group (or drag it there).

Step 3 of 13Practice · Diagram

Levels of measurement

Each level adds one property to the one below. Tap a level.

At which level does it first make sense to say one value is twice another?

Tap the shape that answers the question, then press Check.

Levels of measurementPyramid diagram: Nominal: names, Ordinal: order, Interval: equal gaps, Ratio: true zero.Nominal: namesOrdinal: orderInterval: equal gapsRatio:true zero
Nominal: names

Blood type, home region. Count them; never average codes.

Ordinal: order

Satisfaction from low to high. Gaps between steps are not equal.

Interval: equal gaps

Temperature in °C. Differences make sense, but 0 is not 'none'.

Ratio: true zero

Weight in kg, minutes online. 'Twice as much' makes sense.

Step 4 of 13Learn

Before analysis: clean and screen

Real datasets are messy. Before testing anything, experienced researchers spend a surprising share of their time cleaning and screening:

  1. Check ranges and codes. Frequency tables reveal impossible values: an age of 211, a 6 on a 5-point scale, missing-value codes such as 99.
  2. Handle missing data deliberately. Find out how much is missing and whether it is random. Dropping every case with any missing value (listwise deletion) can shrink and bias the sample if, say, lower-income people skipped the income question. Methods such as multiple imputation exist for serious cases. Always report how much was missing and what you did.
  3. Look at distributions. Histograms and box plots show skew and outliers. An outlier may be an error (fix it) or a real, important case (keep it and perhaps check results with and without it). Do not delete inconvenient points silently.
  4. Recode and compute. Reverse-score negatively worded items, combine scale items into totals, group categories with very few cases.
  5. Document everything in a syntax file or script, not by editing cells by hand. Then anyone, including you in six months, can reproduce the dataset from the raw file.

This stage also protects against the temptation to try many analyses and report only the one that "works."

Step 5 of 13Diagram

A cleaning pass before any test

A cleaning pass before any testProcess diagram: Check ranges and codes → Study the missing data → Look at distributions → Recode and compute → Document every change.Check ranges andcodesStudy the missingdataLook atdistributionsRecode and computeDocument everychange

Tap a shape with to see more.

Check ranges and codes

Frequency tables expose ages of 211 and 99 codes.

Study the missing data

How much, and is it random? Who skipped the question?

Look at distributions

Histograms and box plots show skew and outliers.

Recode and compute

Reverse-score items, build scale totals.

Document every change

In a script, so anyone can rerun it.

Step 6 of 13Practice · What would you do?

What would you do?

Cleaning a survey of 600 employees, Kofi finds that 35% left the salary question blank, mostly in the lowest job grades. His software, by default, drops anyone with missing data from every analysis. What should he do?

Step 7 of 13Learn

Choosing a statistical test

Once you know your question and variable types, the choice of test follows a short decision path. Ask: am I describing, comparing groups or looking at relationships? What type is the outcome? How many groups?

QuestionOutcome typeCommon test
Are two categorical variables related?NominalChi-square test of independence
Do two independent groups differ in mean?ContinuousIndependent-samples t-test
Did the same people change from before to after?ContinuousPaired-samples t-test
Do three or more groups differ in mean?ContinuousOne-way ANOVA
Are two continuous variables linearly related?ContinuousPearson correlation
Do several predictors explain a continuous outcome?ContinuousMultiple linear regression
Do predictors explain a yes/no outcome?BinaryLogistic regression

When data are ordinal or badly skewed with small samples, non-parametric alternatives exist: Mann-Whitney U instead of the independent t-test, Wilcoxon signed-rank instead of the paired t-test, Kruskal-Wallis instead of one-way ANOVA, Spearman's rho instead of Pearson's r.

Whatever test you use, report an effect size and confidence interval alongside any p-value. A statistically significant difference can be too small to matter in practice.

Step 8 of 13Practice · Match the pairs

Match each research question to the most suitable test.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. Is gender related to preferred news source (TV, web, print)?
  2. Do students' anxiety scores drop from the first to the last week of a course?
  3. Do average yields differ among four fertilizer types?
  4. Do age, income and education predict whether someone voted (yes/no)?
  5. Is hours of sleep linearly related to reaction time?

Step 9 of 13Practice · Choose one

A researcher compares median household income between two neighborhoods using small samples (15 households each). Income is strongly skewed by a few very wealthy households. Which test is the most defensible choice?

Step 10 of 13Diagram

A quick test-picking tree

Start with your goal, then the outcome type. Tap a leaf.

A quick test-picking treeHierarchy diagram: What is the goal?, Compare groups, Relate variables, 2 groups, numeric: t-test, 3+ groups, numeric: ANOVA, Skewed or ordinal: Mann-Whitney, Two numeric: correlation, Two categorical: chi-square, Yes/no outcome: logistic regression.What is the goal?Compare groups2 groups, numeric: t-test3+ groups, numeric: ANOVASkewed or ordinal: Mann-WhitneyRelate variablesTwo numeric: correlationTwo categorical: chi-squareYes/no outcome: logistic regression

Tap a shape with to see more.

What is the goal?
Compare groups
Relate variables
2 groups, numeric: t-test

Independent or paired, depending on whether the groups are the same people.

3+ groups, numeric: ANOVA
Skewed or ordinal: Mann-Whitney

Non-parametric options compare ranks instead of means.

Two numeric: correlation
Two categorical: chi-square
Yes/no outcome: logistic regression

Step 11 of 13Note

Step 12 of 13Practice · Fill in the blanks

Fill in the blanks

Ranking five job priorities from most to least important produces data. Annual income in euros, which has a true zero, is measured at the level.

Step 13 of 13Practice · What would you do?

What would you do?

A study of 40,000 people finds that a workplace wellness program is associated with a statistically significant reduction in sick days (p < 0.001). The reduction is 0.2 days per year. The company asks whether to roll the program out. What is the best interpretation?