Hypothesis tests, statistical

Statistic al tests play two essential roles:

  1. To find patterns in data that are too faint to see
  2. To discourage us from accepting patterns that seem obvious to our monkey minds, but which are not supported by the data

When we hope to get good data from our tests we take on two component

  1. some mathematical machinery to make all this precise and quantifiable and as objective as possible
  2. a bunch of promises to use tests in a particular way which matches the assumption of the tests

Usually the wheels fall off at #2.


When do we want to teach testing and why?

Daniel Lakens is running an A/B test on teaching A/B tests.

What kind of hypothesis testing do we want? I guess we need to design some kind of tests so we can get real numbers.

In general we are worried about the abuse of this particular tool in experimental practice, which is notoriously fraught. How many degrees of freedom to you give yourself by accident with bad data hygiene?

As for which tests to teach… Wilcoxon Mann-Whitney and Kruskal-Wallis tests are neat. Are they simpler than t-testing?

As decision tool

It is possibly the least sexy method in statistics and as such, usually taught by the least interesting professor in the department, or at least one who couldn’t find an interesting enough excuse to get out of it, which is a strong correlate. Said professor will then teach it to you as if you were in turn the least interesting student in the school, and they will teach it as a mathematical object without connecting it to the process of decision making.

In the classical framing, you think about designing and running experiments and deciding if the data is strong enough to influence your actions. In many statistical courses the tests are taught in spooky isolation from actions (certainly they were in my hypothesis testing class, although I am indebted to Sara van de Geer for correcting that.)

For some introductions to the purpose of statistics dest which does not forget to consider tests in light of what actions they will inform, see the following essays by Cassie Kozyrkov who explains them better than I will.

Quote which gives a concrete example of the decision theory/action context:

If you’re interested in analytics (and not statistics), p-values can be a useful way to summarize your data and iterate on your search. Please don’t interpret them as a statistician would. They don’t mean anything except there’s a pattern in these data. Statisticians and analysts may come to blows if they don’t realize that analytics is about what’s in the data (only!) while statistics is about what’s beyond the data.

Mechanics of null-hypothesis tests

There are many different hypothesis tests and framings for them. Let us consider classical null tests for now, since they are very common.

There are many elaborations of this approach in the modern world. For example, we examine large numbers of hypotheses at once under multiple testing. It can be considered as part of model selection question, or maybe even made particularly nifty using sparse model selection. Probably the most interesting family of tests are tests of conditional independence, especially multiple version of those.

tl;dr classic statistical tests are linear models where your goal decide if a coefficient should be regarded as non-zero or not. Jonas Kristoffer Lindeløv explains this perspective: Common statistical tests are linear models. FWIW I found that perspective to be a real 💡 moment. Alternate/ generalized (?) take: Most statistical tests are canonical correlation analysis (Knapp 1978).

Daniel Lakens asks Do You Really Want to Test a Hypothesis?:

The lecture “Do You Really Want to Test a Hypothesis?” aims to explain which question a hypothesis tests asks, and discusses when a hypothesis tests answers a question you are interested in. It is very easy to say what not to do, or to point out what is wrong with statistical tools. Statistical tools are very limited, even under ideal circumstances. It’s more difficult to say what you can do. If you follow my work, you know that this latter question is what I spend my time on. Instead of telling you optional stopping can’t be done because it is p-hacking, I explain how you can do it correctly through sequential analysis. Instead of telling you it is wrong to conclude the absence of an effect from p > 0.05, I explain how to use equivalence testing. Instead of telling you p-values are the devil, I explain how they answer a question you might be interested in when used well. Instead of saying preregistration is redundant, I explain from which philosophy of science preregistration has value. And instead of saying we should abandon hypothesis tests, I try to explain in this video how to use them wisely. This is all part of my ongoing #JustifyEverything educational tour. I think it is a reasonable expectation that researchers should be able to answer at least a simple ‘why’ question if you ask why they use a specific tool, or use a tool in a specific manner.

Is that all too measured? Want more invective? See Everything Wrong with P-Values Under One Roof (Briggs 2019). AFAICT this is more about cargo-cult usage of P-Values.

Lucile Lu, Robert Chang and Dmitriy Ryaboy of Twitter have a practical guide to risky testing at scale: Power, minimal detectable effect, and bucket size estimation in A/B tests.

Bob Sturm recommends, Bailey (2008) for discussion of hypothesis testing in terms of linear subspaces.

(side note: the proportional odds model generalises K-W/WMW. Huh.)


Everything so far has been in a frequentist framing. The entire question of hypothesis testing is more likely to be vacuous in Bayesian settings (although Bayes model selection is a thing). See also Thomas Lumley on a Bayesian t-test which ends up being a kind of bootstrap in an interesting way. Also, actionable, see Yanir Seroussi on Making Bayesian A/B testing more accessible. Will Kurt /Count Bayesie, Bayesian A/B Testing: A Hypothesis Test that Makes Sense


I cannot decide if tea-lang is a passive-aggressive joke or not. It is a compiler for statistical tests.

Tea is a domain specific programming language that automates statistical test selection and execution… Users provide 5 pieces of information:

  • the dataset of interest,
  • the variables in the dataset they want to analyze,
  • the study design (e.g., independent, dependent variables),
  • the assumptions they make about the data based on domain knowledge(e.g., a variable is normally distributed), and
  • a hypothesis.

Tea then “compiles” these into logical constraints to select valid statistical tests. Tests are considered valid if and only if all the assumptions they make about the data (e.g., normal distribution, equal variance between groups, etc.) hold. Tea then finally executes the valid tests.

But in general, this is all baked into R.

Goodness-of-fit tests

Also a useful thing to have; the hypothesis here is kind-of more interesting, along the lines of it-is-unlikely-that-the-model-you-propose-contains-this-data.


Bailey, R. A. 2008. Design of Comparative Experiments. 1 edition. Cambridge series on statistical and probabilistic mathematics. Cambridge; New York: Cambridge University Press.
Briggs, William M. 2019. Everything Wrong with P-Values Under One Roof.” In Beyond Traditional Probabilistic Methods in Economics, edited by Vladik Kreinovich, Nguyen Ngoc Thach, Nguyen Duc Trung, and Dang Van Thanh. Vol. 809. Studies in Computational Intelligence. Cham: Springer International Publishing.
Colbourn, Charles J., and Jeffrey H. Dinitz. 2010. Handbook of Combinatorial Designs, Second Edition. CRC Press.
Efron, Bradley. 2008. Simultaneous Inference: When Should Hypothesis Testing Problems Be Combined? The Annals of Applied Statistics 2 (1): 197–223.
Geer, Sara van de. 2016. Estimation and Testing Under Sparsity. Vol. 2159. Lecture Notes in Mathematics. Cham: Springer International Publishing.
Gelman, Andrew. 2018. The Failure of Null Hypothesis Significance Testing When Studying Incremental Changes, and What to Do About It.” Personality and Social Psychology Bulletin 44 (1): 16–23.
Good, Phillip I., and Philip Good. 1999. Resampling Methods: A Practical Guide to Data Analysis. Birkhäuser Basel.
Greenland, Sander. 1995a. Dose-Response and Trend Analysis in Epidemiology: Alternatives to Categorical Analysis.” Epidemiology 6 (4): 356–65.
———. 1995b. Problems in the Average-Risk Interpretation of Categorical Dose-Response Analyses.” Epidemiology 6 (5): 563–65.
Knapp, Thomas R. 1978. Canonical Correlation Analysis: A General Parametric Significance-Testing System. Psychological Bulletin 85 (2): 410.
Kohavi, Ron, Roger Longbotham, Dan Sommerfield, and Randal M. Henne. 2009. Controlled Experiments on the Web: Survey and Practical Guide.” Data Mining and Knowledge Discovery 18 (1): 140–81.
Korattikara, Anoop, Yutian Chen, and Max Welling. 2015. Sequential Tests for Large-Scale Learning.” Neural Computation 28 (1): 45–70.
Kreinovich, Vladik, Nguyen Ngoc Thach, Nguyen Duc Trung, and Dang Van Thanh, eds. 2019. Beyond Traditional Probabilistic Methods in Economics. Vol. 809. Studies in Computational Intelligence. Cham: Springer International Publishing.
Lavergne, Pascal, Samuel Maistre, and Valentin Patilea. 2015. A Significance Test for Covariates in Nonparametric Regression.” Electronic Journal of Statistics 9: 643–78.
Lehmann, Erich L., and Joseph P. Romano. 2010. Testing statistical hypotheses. 3. ed. Springer texts in statistics. New York, NY: Springer.
Lumley, Thomas, Paula Diehr, Scott Emerson, and Lu Chen. 2002. The Importance of the Normality Assumption in Large Public Health Data Sets.” Annual Review of Public Health 23 (1): 151–69.
Maesono, Yoshihiko, Taku Moriyama, and Mengxin Lu. 2016. Smoothed Nonparametric Tests and Their Properties.” arXiv:1610.02145 [Math, Stat], October.
Malevergne, Yannick, and Didier Sornette. 2003. Testing the Gaussian Copula Hypothesis for Financial Assets Dependences.” Quantitative Finance 3 (4): 231–50.
McShane, Blakeley B., David Gal, Andrew Gelman, Christian Robert, and Jennifer L. Tackett. 2019. Abandon Statistical Significance.” The American Statistician 73 (sup1): 235–45.
Msaouel, Pavlos. 2022. The Big Data Paradox in Clinical Practice.” Cancer Investigation 40 (7): 1–10.
Na, Seongryong. 2009. Goodness-of-Fit Test Using Residuals in Infinite-Order Autoregressive Models.” Journal of the Korean Statistical Society 38 (3): 287–95.
Ormerod, John T., Michael Stewart, Weichang Yu, and Sarah E. Romanes. 2017. Bayesian Hypothesis Tests with Diffuse Priors: Can We Have Our Cake and Eat It Too? arXiv:1710.09146 [Math, Stat], October.
Paparoditis, Efstathios, and Theofanis Sapatinas. 2014. Bootstrap-Based Testing for Functional Data.” arXiv:1409.4317 [Math, Stat], September.
Sejdinovic, Dino, Bharath Sriperumbudur, Arthur Gretton, and Kenji Fukumizu. 2012. Equivalence of Distance-Based and RKHS-Based Statistics in Hypothesis Testing.” The Annals of Statistics 41 (5): 2263–91.
Tang, Minh, Avanti Athreya, Daniel L. Sussman, Vince Lyzinski, and Carey E. Priebe. 2014. A Nonparametric Two-Sample Hypothesis Testing Problem for Random Dot Product Graphs.” arXiv:1409.2344 [Math, Stat], September.

No comments yet. Why not leave one?

GitHub-flavored Markdown & a sane subset of HTML is supported.