As part of the parents involvement in my youngest son school, last Friday was the “parents teaching” day, where parents presented various topics that may interest the students. I chose to try the reproduce Fisher’slady tasting tea experiment, but with a twist.
I started the class with general discussion on designing experiments, and presented the story of the lady and the tea. Then I asked them how they would test if the lady can actually tell whether the tea or the milk was added first to a cup. After a short discussion, the 11 years old students reached the design that Fisher used. Of course, I did not expect them to get into the statistical inference details.
Once we got a design, I pooled two bottles of iced tea out of my bag. In Israel there are two leading brands of iced tea, lets call them A and B. A few more minutes were needed to get to the design of an experiment for testing whether the kids can distinguish between the tastes of the two brands.
We used the following design:
A flip of a coin determined if we will pour the same brand of iced tea into two cups, or pour one brand in one cup and the other brand into the other cup.
In case the same brand should be poured into the two cups, another coin flip determined if it should be brand A or brand B.
Then, one of the students who was, of course, blinded to the process of filling the cups, tasted the tea in both cups and announced if she can distinguish between the tastes of the tea in each cup, and her answer was recorded.
The final results are [*]:
Was the taster right?
AA or BB
I think we can conclude that there is no evidence for rejecting the hypothesis that the students can distinguish between the tastes of the two brands (you are welcome to do your own statistical analysis).
On a personal note: from my point of view it was a great success, since my son, who refused tasting brand B was convinced to taste it, and admitted that he likes its taste.
[*] I know I should have recorded the outcomes of the re-randomization, so that the table will have 3 rows and not only two. You will have to forgive me. My only excuse is that was a fun demonstration for fifth graders.
I found this picture on twitter, thanks to Kareem Carr who took a screenshot before the person who uploaded it deleted his tweet. I googled and found it in a website named Data Science Central (No link. Sorry). Can you tell what is wrong in this picture?
Well, almost everything is wrong in this picture.
Let’s start with the flowchart on the top.
The null hypothesis is that the average number of pizza slices is 4 and the alternative hypothesis is much higher than 4. What does “much higher” mean? Normally the hypotheses would be Ho:µ<=4 and H1:µ>4, or maybe Ho:µ=4, H1:µ>4, if you are looking for one sided hypothesis. I understand “much higher” as µ>>4, or µ>4+Δ. Now the hypotheses are not exhaustive: there is a gap of Δ. If you studied a course on statistical inference and are familiar with the Neyman-Pearson Lemma, it should not be a problem. You can construct a likelihood ratio test. But then you do not need this picture. The way the hypotheses are stated, standard tests as z-test or t-test are not valid.
Collect your data: there is not much information on how to collect the data except for mentioning to make sure that the observations are random. I suppose that the author assumes that the readers are familiar with standard sampling methods. Or maybe there is a “Data Collection Explained in One Picture” somewhere. I am too afraid to google it.
The author states that in this example the average is 5.6. What about the standard deviation and the sample size?
Next in the flowchart: test the result. The author requires setting the significance level, which is good. However, a good statistician will set the significance level before collecting the data. He will also set the desired power and collect the sample size.
Then you should run the test, e.g. chi-square, t-test or z-test. Again, this should be decided before collecting the data.
Next you need to decide if the result is significant. The author suggests four levels of significance according the value of the p-value. This is totally wrong. The result is either significant or not significant. Statistical significance is not a quantitative property. The author suggests using the p-value not just for determining significance but also as a measure for the strength of evidence.
Oh, and one more thing: if p<=.01 it is also <=.05 and <=0.10.
Now let’s look at the nice graph with the bell shape curve, which is almost certainly the Normal Distribution density curve. But look at the Y-axis label: “probability of X number of slices eaten”.
No, it is not probability, it is density, under the assumption that the null hypothesis is true (and this assumption is not stated anywhere).
And it is not the density of the number of slices eaten per visit as the X-axis label says, but the density of the sample mean. Again, one should state that this distribution is derived assuming the null hypothesis is true.
And even if it was a probability, the maximal value of the curve would be much lower than 100%. In fact, the probability of a customer eating less than one slice is zero (otherwise, why would he pay for the pizza in the first place?), and as far as the restaurant concerns, if the customer ate 1.5 slices, it counts as two slices – there is no recycling. In any case, the sample mean cannot be lower than 1. This brings me back to the statistical test. The variable under consideration is a count variable, therefore there are better alternatives to test the hypotheses, even though a normal approximation should work if the sample size is sufficiently large.
Next is the p-value calculation. The calculated p-value is 0.49. This means that if the mean under the null is 4, and the sample mean is 5.6, then we can back calculate and find that the standard error is 0.967 and the 95% significance threshold is 5.591. That’s fine.
Finally, the explanation of what is actually the p-value is clumsy. The term “Probability value (Observed)” may lead someone to think that this is the probability of the observed sample mean. However, the author states correctly that the p-value is the area (under the normal curve) right to the observed result.
So what we got here? Poor example, negligent descriptions of the statistical process and concepts (to say the least), somewhat reasonable explanation of the p-value calculation, no explanation of what the p-value actually is and what it means, and finally abusing the p-value and its interpretation.
And personal note: why would I care? Someone is wrong on the internet. So what?
I care because I care about statistics. There are similar pictures, blog posts and YouTube videos all over the internet. And they cause bad statistics and bad science. P-values and other statistical concepts are abused on a daily basis, even in leading journals such as JAMA. And bad statistics lead to loss of money if we are lucky and to loss of lives if we are not so lucky. So I care. And you should care too.
During this week, the 2019 Nobel Prize winners are announced. We can be sure that nobody will win the Nobel Prize for mathematics. The reason is simple. There is no Nobel Prize for Mathematics.
There are many urban legends regarding this. Most of them relate to an alleged love affair that Ms. Nobel had with a prominent mathematician. These stories conclude that Alfred Nobel did not want to award a prize for mathematics, since his wife’s lover is a leading candidate to win the prize. The most famous of this stories relates Ms. Nobel to the French mathematician Augustine Cauchy. Nice story, but Alfred Nobel was not married.
There is no Nobel Prize for Mathematics, but the Nobel Prize was awarded to mathematicians many times. Some of the most prominent winners were mathematicians John Nash, Robert Aumann and Kenneth Arrow, who all won the Nobel Prize of Economics. However, some will argue that the Nobel Prize in Economics is not a real Nobel Prize but a Nobel Prize. Oh well.
In addition, many mathematicians won the Nobel Prize in Physics, because in fact one cannot engage in high-level physics without proper mathematical education, and engaging in theoretical physics for themselves need to develop innovative mathematical tools.
My research has shown that four mathematicians have won Nobel Prizes that are not in Economics or Physics. Two won the Literature Prize, and two others won the Chemistry Prize. In this post I will review them and their work.
Four mathematicians who won the Nobel Prize. From left to right: Jose Echegaray (Literature, 1904), Bertrand Russell (Literature, 1950), Herbert Hauptman (Chemistry, 1985), John Pople (Chemistry, 1998).
The first mathematician to win the Nobel Prize was the Spanish Jose Echegaray. Echegaray was born in Madrid in 1832. He demonstrated his mathematical talent at a very young age, and was appointed professor of mathematics at the University of Madrid at the age of 21. In addition to his work in mathematics, he devoted his time to research in economics and worked to promote Spain’s international trade. With the abolition of the Spanish monarchy in the revolution of 1868, he retired from his academic position and was appointed Minister of Finance and Education of the Spanish Government. With the restoration of the monarchy in 1874, he retired from political life and began a new career as a writer, producing a series of successful satirical plays presented throughout Europe at the end of the 19th century. These plays earned him the Nobel Prize for Literature, awarded to him in 1904. Had Echegaray’s mathematical skills been useful to him in his literary career? Maybe. Literature scholars praise the meticulous structure of his plays. More likely, he was a very talented man who succeeded in everything he has done.
Another mathematician won the Nobel Prize for Literature 46 years later. The prize was awarded to Bertrand Russell in 1950. The prize committee noted it was awarded to him for his writings, which are “a victory for human ideals and freedom of thought”. Among these writings are the Foundations of Geometry (1897), A Critical Review of Leibniz’s Philosophy (1900), The Foundations of Mathematics — the monumental work he wrote with Whitehead between 1910 and 1913, and Introduction to Mathematical Philosophy (1919). All these books dealt with logic, along with his many other writings in many other fields. Bertrand Russell undoubtedly won the Nobel Prize for his mathematical work.
In 1985 another mathematician met with the King of Sweden. Herbert A. Hauptman , a mathematician who worked at the Institute for Medical Research in Buffalo, New York, shared the Nobel Prize with his fellow chemist Jerome Karl. Hauptman developed an algorithm that combined geometric and probabilistic methods to determine the molecular structure of materials using x-rays. This method, when applied in the 1980s by a computer, shortened the amount of time needed to determine the molecular structure of simple biological molecules from two years to two days, making it possible to determine the three-dimensional molecular structure of vitamins, hormones and antibiotic materials easily, to be used in the development of new drugs.
In 1998 another mathematician won the Nobel Prize in Chemistry: John A. Pople . He won the Nobel Prize for the development of new computational methods in the field of quantum chemistry. Pople sought and found methods for solving Schrodinger equations, the fundamental equations of quantum theory. These equations were previously considered insoluble, except for a few simple special cases. The software he developed for the implementation of his methods bears the name “Gaussian”, and is now used as the basic work tool of any chemist.
Executive summary: p-values make a false impression that statistical significance is a continuous concept, but it is not. It is dichotomous.
You are welcome to read on.
I will not get into a lengthy discussion on the difference between Fisher‘s significance testing and Neyman and Pearson‘s hypothesis testing. In short: Fisher had a null hypothesis, a test statistic and a p-value. The decision whether or not to reject the null hypothesis based on the p-value was flexible. Indeed, in one place Fisher suggested to use the 5% threshold for deciding significance, but in other places he used different thresholds.
Neyman and Pearson’s approach is totally different. In their framework there are two hypotheses: the null hypothesis and the alternative hypothesis. The Neyman-Pearson lemma provides as a tool to construct decision rule. Given data, you evaluate the likelihood of these data in two cases: once assuming that the null hypothesis is true, and then assuming that the alternative hypothesis is true. You reject the null hypothesis in favor of the alternative if the ratio of the two likelihoods exceeds a pre-defined threshold. This threshold is determined by the significance level: an acceptable probability of falsely rejecting the null hypothesis (in a frequentist manner), that meets your scientific standards.
When I was a young under-graduate student, we did not have easy access to computers in my university (yes, I am that old). So we calculated the test statistic (Z, t, F, chi-square) and looked in a table similar to this one to see if our test statistic exceeds the threshold.
Fisher was a genius, and so was Karl Pearson. They developed statistical tests such as F and Chi-square based on geometrical considerations. But when you try to construct a test for equality of means as is in ANOVA or a test for independence of two categorical variables by using the NP lemma, you get the same tests. This opened a computational shortcut: The NP decision rule is equivalent to a p-value decision rule. You can decide to reject the null by comparing your test statistic to the value you look up in a table, or by comparing the p-value to your pre-determined significance level. You will get the same result either way. But still, you either reject the null hypothesis or you don’t. The size of the test statistic or the p-value does not matter. There is are such things as “nearly significant”, “almost significant”, “borderline significant” or “very significant”. IF your pre-determined significance level is 0.05, and your p-value is 0.051, that’s really depressing. But if you declare that your result is “almost significant”, it means that you changed your decision rule after the fact.
Someone robbed a convenience store in the middle of nowhere. The police caught him and brought him to court. There were three eye witnesses, and a video from the security camera. The jury found him guilty and he was sentenced to serve 6 months in jail. In statistical jargon, the null hypothesis states that the defendant is not guilty, and the jury rejected the null hypothesis.
Let’s look at another robber. This man robbed a convenience store in New York City, next to Yankee Stadium. The robbery occurred when the game just ended, the Yankees won, 47000 happy fans witnessed the robbery, and they all came to testify in court, because the poor robber was a Red Sox fan. The jury found him guilty.
Is the second robber guiltier than the first robber? Is the first robber “almost not guilty” or “borderline guilty”? Is the second robber “very guilty”? What would be the right punishment to the second robber? 10 years? Life imprisonment? Death sentence? Do you think now that if you were in the jury of the first robber you would acquit him?
Here is what we need to do if we really want to improve science: when publishing results, one should provide all the necessary information, such as data, summary statistics, test statistics and more. And then state: “we reject the null hypothesis at the 5% significance level”, or maybe “we do not reject the null hypothesis at the 5% significance level” (or any other reasonable and justified significance level. No p-values. And if someone wants to know if the null hypothesis will be rejected at the 5.01% significance level, they can go and calculate their own p value. P values should be abandoned.
The call to ban statistical significance is not new. Several researchers, the most notable of them is Andrew Gellman from Columbia University, are promoting this idea in the last few years. What is new is the recent article in the prestigious journal Nature, that brought up the issue again. Actually, it is a petition signed by about 800 researchers, some of them are statisticians (and yes, Gellman signed this petition too). Gellman and Blake McShane from Northwestern University, who is one of the lead authors of the current petition, also expressed this idea in another provocative article at Nature titled “Five ways to fix statistics” published in November 2017.
I think that it is not a good idea. It is not throwing the baby out with the bathwater. It is attempting to take the baby and throw it out of the sixth-floor window.
Let me make it clear: I do not oppose taking into account prior knowledge, plausibility of mechanism, study design and data quality, real-world costs and benefits, and other factors (I actually quoted here what Gellman and McShane wrote in the 2017 article). I think that when editors are considering a paper that was submitted to publication, they must take all of this into account, provided that the results are statistically significant.
“Abandoning statistical significance” are just nice words for abandoning the Neyman-Pearson Lemma. The lemma guarantees that likelihood ratio tests control the rate of the false positive results at the acceptable significance level, which is currently equal to 5%. The rate is guaranteed in a frequentist manner. I do not know how many studies are published every year. Maybe tens of thousands, maybe even more. If all the researchers are applying the Neyman-Pearson theory with a significance level of 5%, then the proportion of the false positive results approaches 0.05. No wonder that Gellman, who is a Bayesian statistician, opposes this.
Once statistical significance is abandoned, bad things will happen. First, the rate of false positive published results will rise. On the other hand, there is no guarantee that the rate of false negative results (that are not published anyway) will fall. The Neyman-Pearson Lemma provides protection against the false negative rates as well. Granted, you need to have an appropriate sample size to control it. But if you don’t care for statistical significance anymore, you will not care for controlling the false negative rate. Researchers will get an incentive for performing many small sample studies. Such studies are less expensive, and have higher variation. The chance of getting a nice and publishable effect is larger. This phenomenon is known as “The law of small numbers“. What about external validity and reproducibility? In a world of “publish or perish”, nobody seems to care.
And this brings us to the question how one would determine if an effect is publishable. I can think of two possible mechanisms. One possibility is to calculate a p-value and apply a “soft” threshold. P is 0.06? that’s fine. What about 0.1? it depends. 0.7? no way (I hope). A second possibility is the creation of arbitrary rules of thumbs that have no theoretical basis. In this paper, for example, the researchers expressed the effects in terms of Hedges’ g, and considered an effect as meaningful if g>1.3. Why 1.3? They did not provide any justification.
I worked many years in the pharmaceutical industry, and now I work in a research institute affiliated with a large healthcare organization. False positive results, as well as false negative results, can lead to serious consequences. Forget about the money involved. It can be a matter of life and death. Therefore, I care for the error rates, and strongly support hypothesis testing and insisting on statistical significance. And you should care too.
I came across this story in ESPN: Which of baseball’s most unbreakable records might actually get broken in 2019?
You can pass the story, unless you are really baseball statistics nerds, or don’t have something better to do, like me. But there is an interesting probability question there.
The longest winning streak in MLB history was 26 wins in a row, and this record was set by the Giants in 1916. What is the probability that this record will be broken?
The author, Sam Miller, argues that the chance is about 1 in 250. His reasoning goes along these lines: First he assumes that the best team will win about 100-110 games out of the season’s 162 games. The next assumption is that the probability of winning is the same for each game, therefore this probability ranges in 0.62 to 0.68. He does not state the third assumption explicitly, but you can’t do the math without it: games are independent.
All these assumptions translate to a series of 162 Bernoulli trial, with success probability of about 0.65 (plus/minus 0.03). So, what is the probability of getting a streak of at least 27 successes? Can you do the calculations?
If you need to generate a randomization list for a clinical trial, do some simulations or perhaps perform a huge bootstrap analysis, you need a way to draw random numbers. Putting many pieces of paper in a hat and drawing them is possible in theory, but you will probably be using a computer for doing this. The computer, however, does not generate random numbers. It generates pseudo random numbers. They look and feel almost like real random numbers, but they are not random. Each number in the sequence is calculated from its predecessor, so the sequence has to begin somewhere; it begins in the seed – the first number in the sequence.
Knowing the seed is a good idea. It enables reproducing the analysis, the simulation or the randomization list. If you run a clinical trial, reproducibility is crucial. You must know at the end of the trial which patient was randomized to each treatment; otherwise you will throw all your data to the garbage. During the years I worked at Teva Pharmaceuticals, we took every possible safety measure: We burnt the randomization lists, the randomization SAS code and the randomization seed on a CD and kept it in a fire-proof safe. We also kept all this information in analog media. Yes, we printed the lists, the SAS code and the seed on paper, and these were also kept in the safe.
Using the same seed every time is not a good idea. If you use the same seed every time, you get the same sequence of pseudo-random numbers every time, and therefore your numbers are not pseudo-random anymore. Selecting a different seed every time is good practice.
How do you select the seed? Taking a number out of your head is still not a good idea. Our heads are biased. Like passwords, people tend to use some seeds more often than other possible seeds. Don’t be surprised if you see codes with seeds like 123, 999 or 31415.
The best practice is to choose a random seed, but this creates a magic circle. You can still turn to your old hat and some pieces of paper, but there is a simple alternative: generate the seed from the computer clock.
This is how you do it in R by using the Sys.time() function: Get the system time, convert it to an integer, and you’re done. In practice, I take only the last 5 digits of that integer. And off course, I keep the chosen seed on record. I also save the Sys.time value and its integer value, just in case. Finally, I hardcode the seed I get. This is the R code:
> # set the initial seed as the computer time
> print (initial_seed)
 "2019-03-16 10:56:37 IST"
> # convert the time into a numeric variable
> print (initial_seed)
> # take the last five digits f the initial seed
> the_seed=initial_seed %% 100000
> print(the_seed) #
> # do your simulation
 -0.4759375 -1.9624872 -0.1601236
> # reproduce your simulation
 -0.4759375 -1.9624872 -0.1601236