Using Tisane

Welcome to Tisane, a data analysis tool that focuses on supporting conceptual statistical relationships in study designs. After providing a study design specification in the Tisane domain-specific language (DSL)

import tisane as ts
import pandas as pd

df = pd.read_csv("pigs.csv")

week = ts.SetUp("Time", order=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], cardinality=12)
pig = ts.Unit("Pig", cardinality=72)  # 72 pigs
litter = ts.Unit("Litter", cardinality=21)  # 21 litters
vitamin_e = pig.ordinal(
    "Evit", order=["Evit000", "Evit100", "Evit200"], number_of_instances=1
copper = pig.ordinal("Cu", order=["Cu000", "Cu035", "Cu175"], number_of_instances=1)
weight = pig.numeric("Weight", number_of_instances=week)
feed = pig.numeric("Feed consumption", number_of_instances=week)


design = ts.Design(dv=weight, ivs=[week]).assign_data(df)


the Tisane GUI guides you through the process of generating an appropriate model.

The Tisane GUI

The resulting model is written in Python, and you can run it to get results that answer your research questions.

Authoring a Model

There are five steps to authoring your model:

  1. Specify your variables of interest and their relationships.
  2. Create a study design tisane.Design with your variables.
  3. Ask Tisane to help you author a statistical model by calling tisane.infer_statistical_model_from_design on your study design. Tisane will then examine your variables and variable relationships, look for additional variables that may be conceptually relevant to add, and ask you specific questions about them and the data through a GUI.
  4. After you these additional choices, the GUI will generate a model script written in Python.
  5. After running the script, the results of the model will be output so that you can examine them.

There are two different workflows for using Tisane: using Tisane in a Jupyter notebook, and using Tisane with the editor of your choice and the command line.

Additional Resources

You might want to check out the documentation for more information, in addition to the examples below.


Examples can be found in the examples directory. There are three main examples, each of which has both a Python script version and a Jupyter notebook version.

Now that you’ve installed Tisane, you should be able to run the examples!

The notebook versions include extra explanations and information that you may find useful as an introduction to Tisane.