Interactive hypothesis testing for anti-anxiety medicine with atoti

Python and atoti: experimentation in data analytics

  • define your own complex metrics in python — as an example, I’ve implemented a measure computing “H0 Rejected” and “Can’t Reject H0” for a paired-t-test
  • re-define metrics as you go
  • experiment by uploading alternative data sets
  • experiment by running simulations on measures

Hypothesis testing on memory recall performance

The experiment is inspired by research showing that sad memories might improve memory recall abilities for evolutionary purposes. At the same time, Benzodiazepines are known to have adverse effects on memory performance. Would priming with good or bad memories compensate for the obstructive impact of these anti-anxiety drugs?

  • Participants were primed with happy and sad memories ten minutes before the memory test — see column “Happy_Sad_group” — as it is believed that a person’s mood may impact memory recall.
  • Memory scores represent response time, i.e. how long it takes to finish the memory test. Higher Memory scores mean the ability actually reduces

Launching the atoti app

As a first step, I’m importing atoti and creating a session.

injecting data
creating a cube

Extending the data model

At any point I can enrich the data model by adding more attributes into datastores. For example, in the following cell I’m joining the observations with “age groups”:

Defining reusable measures

So far, we have loaded the data and were able to explore it using the default aggregation functions. Now, let’s see how to create custom measures in atoti. Every time we define a new measure — it is published into the app, and can be used by anyone in the team to analyze data in the atoti app.

measures for the basic statistics

More complex aggregations

As the possibilities to create analytical measures in atoti are practically endless, we want to define a measure that will apply a paired t-test and simply display: “H0 Rejected” or “Can’t Reject H0” for any scope of data that we select.

slice-and-dice the test result
  • H1: on average, the memory score after the treatment is larger (response time longer) than before,
  • H1: mean difference of memory scores between after and before measurements is above 0, mu>0.
creating the t-critical measure

Applying the test interactively

Having defined the measures, we can apply them to any groups of data and apply the test interactively. The metrics are computed on-the-fly from the input data and can follow any sophisticated rules that we have defined.

  • when we break down the Drug Alprazolam observations by dosage — we notice that only the dosages 2 and 3 result in statistically significant increase in the response time

Alternative data sets

Let’s imagine that we obtained memory scores data using an alternative methodology, and want to compare the test results side-by-side with the original approach.

Instead of conclusion

I invite you to test-drive atoti and reach out to me, I’ll be happy to walk you through using atoti for your own project.

Anastasia is a quantitative financial analyst and risk management practitioner experienced in modern data analysis tools and frameworks.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store