Skip to contents

Core IO

Read, validate and write theory objects, give the content hash that identifies a version, and read a causal diagram written for DAGitty.

tf_read()
Read a theory object from a YAML or JSON file
tf_validate()
Validate a theory object
tf_write()
Write a theory object to YAML or JSON
tf_content_hash()
Compute the content hash of a theory
tf_read_dagitty()
Read a causal diagram written for DAGitty

Packaged examples

Example theories and literature corpora included in the package, so that nothing has to be downloaded to follow the documentation. The Python twin provides the same files through example_names() and example_path().

tf_example_names()
Names of the packaged example files
tf_example_path()
Path to a packaged example file

Building

Build a theory step by step, each step recorded in its provenance.

tf_theory()
Start a new, empty theory object
tf_add_construct()
Add a construct to a theory
tf_add_proposition()
Add a proposition to a theory
tf_add_prediction()
Add a prediction to a theory
tf_add_phenomenon()
Add a phenomenon the theory sets out to explain
tf_add_alternative()
Add an alternative theory
tf_add_assumption()
Add an auxiliary assumption
tf_add_evidence()
Record published evidence on a prediction
tf_add_test_outcome()
Record the outcome of a test of a prediction
tf_set_formal_model()
Set the formal model

Checklist and severity

Run the versioned checklist on a theory file. Grade the form of each prediction’s claim before any data, and report how severely each bounded prediction passed its test.

tf_check()
Check a theory file against the checklist
tf_report()
Render the checklist report as a string
tf_severity()
Per-prediction claim-form riskiness
tf_post_data_severity()
Post-data severity of each bounded prediction

Redundancy

The deterministic lexical redundancy screen and an opt-in embedding screen.

tf_tokens()
Tokenise a string into a set of content tokens
tf_jaccard()
Jaccard similarity of two token sets
tf_redundancy_check()
Pairwise lexical similarity of construct definitions
tf_embedding_redundancy()
Embedding-based pairwise construct-redundancy screen

Diagram

Byte-identical diagram intermediate representations, and native rendering.

tf_diagram()
Render a diagram intermediate representation
tf_lit_diagram()
Render a literature-layer diagram intermediate representation
tf_render_diagram()
Render a diagram in the viewer or as SVG

Developing

Appraise an amendment against the version it replaces.

tf_appraise_amendment()
Appraise an amendment as progressive, degenerating or neutral

The causal reading

What the causal graph a theory states implies and entails, the directions no test of conditional independence can settle, and what would tell the theory from a rival.

tf_implications()
Derive a theory's implied conditional independencies
tf_entailments()
Read each claim of a theory against its causal graph
tf_equivalent_models()
Report which causal directions no test of conditional independence can settle
tf_discriminate()
Compare a theory with a rival account of the same constructs

Testing and review

Preregistration, SEM compilation and the dossier.

tf_preregister()
Render the theory and hypotheses sections of a preregistration
tf_compile_sem()
Compile a theory to lavaan model syntax
tf_dossier()
Render the dossier of a theory file (Markdown)

Simulation

Integrate the construct network as a dynamical system.

tf_simulate()
Simulate a theory's construct network as a linear dynamical system

Reporting and deposit

Render a report and deposit it.

tf_render_report()
Write a Quarto report for a theory
tf_osf_push()
Deposit a theory's dossier to OSF storage

Literature layer

Bibliometric mapping of a literature corpus.

tf_read_corpus()
Read a literature corpus from a YAML or JSON file
tf_litmap()
Bibliometric map of a literature corpus (deterministic)
tf_landscape()
Match a theory and its alternatives against a literature's themes (deterministic)
tf_fetch_corpus()
Build a corpus from the OpenAlex API (network call)
tf_new_evidence_dois()
DOIs not already cited by a theory (deterministic)