## 3.0. When to write it

Remember to work in the right order (see section 1.2 above). So the first advice I would like to give you is: write the theory section first, before you have collected or analyzed your data. Identify the theories that are most relevant for your research, and narrow down broad concepts to variables that you can measure. Write down the hypotheses that you will test before you have seen the data, for instance as part of a preregistration (also see section 4.0 below). You can preregister your study at several platforms, such as aspredicted.org or the Center for Open Science.

Writing your theory section before you have analyzed, seen or even collected the data avoids HARKING: Hypothesizing After Results are Known (Kerr, 1989). It is all too easy to paint a target after you have fired your guns and then claim you were 100% accurate. Your hypotheses are ex ante predictions based on theories, not post hoc interpretations of your data. Preregistration of your research questions and hypotheses proves that you have not been harking.

This forces you to think hard about your predictions. About which ones are you really confident? These are the predictions that belong in your theory section as hypotheses. You will probably be interested in many more relations in the data, without having a clear idea about their sign or strength. These are analyses that you can plan as exploratory analyses, without specifying a hypothesis about them.

The goal of formulating a hypothesis is not to maximize the chance that the analysis will confirm it, but to maximize the implications of testing it. By only formulating a hypothesis when there is a strong theoretical foundation for it, a rejection of the hypothesis by an empirical test is more informative. When the foundation for a hypothesis is shaky to begin with, we do not learn much from a rejection.