Returns the theory and hypotheses sections of a preregistration as a
deterministic Markdown string and, if path is given, writes it to that
file (LF, single trailing newline).
Arguments
- theory
A theory object (named list), such as one from
tf_read().- path
Optional destination path. When it is given, the Markdown is written with LF line endings.
- cycles
How a causal graph with a feedback loop is read, passed to
tf_check(),tf_entailments()andtf_implications()."refuse"(the default) derives no independencies and leaves unread the claims that name a construct on a loop or downstream of one, and"sigma"reads the graph by sigma-separation, which assumes that each loop settles to a unique equilibrium.
Details
The header gives the theory id, the version when it has an id (with its
parent, when one is named), the schema version, the maturity, the formal
model when one is declared and the status of the checklist's
derivation_chain item, read with the document's cycles. That line
states what the item checks, that the derivation references resolve and
that the causal graph entails every claim a prediction states and
contradicts no claim a phenomenon states, and answers yes,
no, not checked (feedback loop; use cycles = "sigma") when the
item warns because a feedback loop leaves claims unread, or
not applicable (no predictions). When the causal graph has a feedback
loop, the header ends with a line saying how the document reads it:
Feedback loops: refused (a claim that names a construct on a loop or
downstream of one is not read) under the default, and
Feedback loops: read by sigma-separation (each loop is assumed to
settle to a unique equilibrium) with cycles = "sigma". A graph
without a loop gets no such line. A fixed line in italics then says that the
document was generated from the theory file, that the study design, the
analysis plan, the inference criteria and whatever the sampling plan leaves
out must be added before registration, and that the content hash identifies
the file and is not a time stamp.
A theory section follows, so that the document can be read without the theory file: each construct with its label, definition, measures and boundary conditions, each proposition with its relation and mechanism, and, when the theory has them, the phenomena it sets out to explain with what the causal graph says of their claims, the auxiliary assumptions, the rival accounts and the scope.
The hypotheses section opens, when the document states any claim, with one
sentence naming the assumptions the verdicts on the claims rest on: the
graph is the causal structure, with no omitted common cause of two of its
constructs, each directed relation acts in its stated direction whatever
the other inputs, effects do not cancel exactly where a claim line ends
unless effects cancel exactly (faithfulness), and under
cycles = "sigma" each feedback loop settles to a unique equilibrium,
also once the intervened construct is held fixed. Each hypothesis is then
listed in file order with its claim type, statement,
prediction id and derivation, followed by the region its bounds allow, its
claim and what the causal graph says of it, what an observational test of an
effect claim must adjust for, the auxiliary assumptions that protect it
(core or added for <id>), the registered rivals it is declared to
discriminate, with how each rival's own propositions read the claim, and its
test record. A hypothesis that a recorded outcome has already tested reads
already tested: passed (<date>, registered <where>), one entry per outcome,
and any other reads untested.
When at least one prediction states a sampling plan in its test
block, a section headed Sampling plan (author-recorded; not scored)
follows, with one line per prediction in file order. A line gives what is
recorded of the planned sample, alpha and sidedness, smallest effect of
interest, power or decision probability, design analysis and justification.
A prediction without a plan reads no sampling plan stated. Nothing scores
the plan. The stated power raises no score, since more power weakens the
corroboration a directional prediction earns (Meehl, 1967), though it decides
how informative a failed test is (Lakens, 2022). A theory without a plan has
no such section.
A section then lists the conditional independencies that
tf_implications() derives from the causal graph, or says why there are
none. They are consequences of the graph as encoded, which reads every pair
of constructs that no proposition joins as having no direct effect and no
unexplained association, so they are the theory's commitments only if its
authors meant those omissions, and a line in italics above them says so.
cycles is passed to it, to tf_check() and to tf_entailments():
under the default, a graph with a feedback loop gives no independencies and
leaves unread the claims that name a construct on a loop or downstream of
one, and with "sigma" it is read by sigma-separation. The claim-form
severity rubric closes the document. Values are written on one line, ids and
dates included, so a line break inside a statement cannot end the list item
it belongs to or start a line of its own.
The document is the part of a preregistration that the theory file holds. It is to be completed with the study design, the analysis plan, the inference criteria and whatever the sampling plan leaves out, the sections that a template such as PRP-QUANT asks for (Bosnjak et al., 2022).
It stops, as tf_check() does, when a test outcome's passed is
present and not TRUE or FALSE, or when a prediction's
severity is not a finite number from 0 to 1, and then writes nothing.
References
Bosnjak, M., Fiebach, C. J., Mellor, D., Mueller, S., O'Connor, D. B., Oswald, F. L., & Sokol, R. I. (2022). A template for preregistration of quantitative research in psychology: Report of the joint psychological societies preregistration task force. American Psychologist, 77(4), 602-615. doi:10.1037/amp0000879
Lakens, D. (2022). Sample size justification. Collabra: Psychology, 8(1), Article 33267. doi:10.1525/collabra.33267
Meehl, P. E. (1967). Theory-testing in psychology and physics: A methodological paradox. Philosophy of Science, 34(2), 103-115. doi:10.1086/288135
Examples
theory <- tf_theory("demo-1", "A demonstration theory") |>
tf_add_prediction("h1", "The effect is 0.30, within 0.05.", "point",
bounds = list(lower = 0.25, upper = 0.35))
cat(tf_preregister(theory))
#> # Preregistration: A demonstration theory
#>
#> - Theory ID: demo-1
#> - Schema version: 1.1
#> - Content hash: sha256:fbbd1801c770d5251cf362ea81c9e69bc73137964f3a2786754e3ea09fc79492
#> - Maturity: building
#> - Derivation references resolve, the causal graph entails every claim a prediction states and contradicts no claim a phenomenon states: no
#>
#> _Generated by theoryforge from the theory file. It holds the theory and hypotheses sections of a preregistration, with any sampling plan the file records. The study design, the analysis plan, the inference criteria and whatever the sampling plan leaves out must be added before registration. The content hash identifies the file and is not a time stamp._
#>
#> ## Theory
#>
#> ### Constructs
#> _No constructs specified._
#>
#> ### Propositions
#> _No propositions specified._
#>
#> ## Hypotheses
#> 1. [point] The effect is 0.30, within 0.05. (h1; derives from: —)
#> - Region the claim allows: [0.25, 0.35]
#> - Test record: untested
#>
#> ## Implied conditional independencies (derived from the causal graph, not predictions)
#> _None: the theory states no directed relation between constructs._
#>
#> ## Severity (pre-data rubric of claim form)
#> - h1: severity 0.9, risk 0.9