Session 13: Before the session

How many independent things are actually being measured?

Thierry Warin, PhD

HEC Montréal

Outline · Before class

  1. What to do, and how long it takes
  2. Read the paper
  3. Get BOTH datasets
  4. The course data
  5. Self-check, and what the session will ask of you
  6. Before you run anything

What session 13 is for

The mathematics

  • Explain why PCA requires standardised inputs, and what happens if you forget
  • Read a scree plot and defend the number of components retained
  • Distinguish a loading from a score
  • Say why a factor is identified only up to rotation

The Python

  • Compute components from the correlation matrix, and check against a library
  • Plot the scree and the loadings, and label the axes with variance explained
  • Rotate a factor solution and watch the fit stay identical

The international business

  • Build an index — competitiveness, openness, capability — from correlated indicators
  • Defend the name you gave a component to a sceptical reader
  • Say what a composite indicator hides as well as what it summarises

Before the session

How many independent things are actually being measured?

What to do, and how long it takes

1 Read the paper 45–60 min
2 Get both datasets — the paper’s, and your own angle 10 min
3 Attempt the self-check 15 min

The lecture assumes all three are done. The practice assumes the data is already cached on your machine.

1 · Read the paper

Gygli, Haelg, Potrafke & Sturm (2019), The KOF Globalisation Index — revisited, Review of International Organizations 14(3)

Read for the argument, not for coverage. Annotate four things:

1 The research question, in one sentence
2 The method or design, and why they chose it
3 The strongest single piece of evidence
4 One limitation you would raise as a referee

2 · Get BOTH datasets

The practice uses two: the paper’s data, to reproduce one of its results, and your own angle, to apply the method. Have both before you arrive.

a) The paper’s data — published, and fetched for you

qmib.load("kof")

The paper has no replication deposit, but it rests on a database its publisher puts online for anyone. The course loader downloads it once and caches it as parquet, so run this before you arrive and the practice works with the wifi off:

import qmib

data = qmib.load("kof")
print(data.shape)

Run it before class. It is a single download, and a room of thirty people fetching it at once is not a download.

2b · The course data

import qmib

core = qmib.load("core")                # the spine, shared by every group
mine = qmib.load("angle_c_country")     # REPLACE with your own angle

print(core.shape, mine.shape)

Run this before you arrive. It downloads once and caches as parquet, so the practice works whatever the room’s wifi is doing.

angle_c_country is an example, not your angle. Yours is named in RESEARCH-MANDATES.md.

The KOF Globalisation Index — 180 countries, 1970–2023, six sub-dimensions each split into de facto and de jure · everything available: qmib.catalog()

3 · Self-check, and what the session will ask of you

Answer these on paper. If you cannot, that is what the lecture is for.

  1. In one sentence: what does this session’s method let you claim that the previous one did not?
  2. What must be true of your data for it to apply?
  3. Which claim in the paper rests on this method — and how hard does it lean on it?

By the end of the session you should be able to:

  • Explain why PCA requires standardised inputs, and what happens if you forget
  • Read a scree plot and defend the number of components you retained
  • Distinguish a loading from a score, and say what each is for
  • State the difference between PCA and factor analysis, and when each applies
  • Say why a factor is identified only up to rotation

Arrive with: the paper read and annotated · the replication package unzipped · qmib.load() run at least once · your self-check answers on paper.

Before you run anything

Everything runs in the VS Codium terminal, from the repository root, with the project environment active. Activate it in every new terminal, not only the first:

source .venv/bin/activate        # macOS and Linux
.venv\Scripts\activate           # Windows (PowerShell)

Your prompt must begin with (.venv). Without it python and pip are your system’s, and nothing the course installed is visible to them.

ModuleNotFoundError means the packages went somewhere else, or were never installed. Check the prompt first, then pip install -r requirements.txt — from the repository root, with the environment active. Building the environment from scratch is Session 01, step 1.4.

Session 13: README.md · the lecture: 01-lecture/