IBM SPSS Statistics is a widely used program for statistical analysis, that helps people quickly and easily find new insights in their data. As of 2017, all the statistical procedures that are provided by the SPSS Statistics are the classical standard statistics. Bayesian statistics, one of the methods of the Statistical inference, was announced as the first important new function provided in the IBM SPSS Statistics Version 25 in Aug. 2017.
There is another method of the Statistical inference that is called the Classical statistics. The two methods belong to two prominent schools of thought, but with different approaches to estimate the parameter of interest.
Bayesian Statistics and Classical Statistics
The Classical statistics combines the observed data and the conventional type of statistics like estimation, regression, hypothesis testing, confidence intervals, p-value to draw statistical inference.
By contrast, Bayesian statistics looks quite different. In this method, a prior probability distribution for the parameter is specified first, the observe data is then obtained and combined through an application of Bayes’s theorem to provide a posterior probability distribution for that parameter. Instead of using a p-value to test a null hypothesis in Classical statistics, Bayesian places an uncertainty on parameters. It captures all relevant information from the observed data, thus the estimation of that parameter is the posterior distribution, not a single value.
Due to its complicated calculation and the limitation of the machine hardware, Bayesian inference wasn’t particularly popular at first. In recent years, with the rapid development of computer hardware and the growing popularity of machine learning, Bayesian inference, which is the common algorithm underlying machine learning, is increasingly popular
.
IBM SPSS Bayesian Statistics
In the IBM SPSS Statistics, the Bayesian procedures are as easy to run as our classical standard statistical tests. You can run Linear Regression, ANOVA, One-Sample, Pair-Sample, Independent-Sample T-tests, Binomial Proportion Inference, Poisson Distribution Analysis, Pairwise Pearson Correlation, and Loglinear models to test the independence of two categorical variables.
In 2018, an advanced Bayesian procedure was released along with the IBM Statistics Subscription to run the One-way Repeated Measures ANOVA model, which is used to provide the measures on the mean of the responses over multiple time points or conditions for the subjects.
In this session, an example is provided to show how the Bayesian one-way repeated measures ANOVA works in the IBM Statistics Subscription to solve the issues.
User Story
A consultancy received a request from a high school principle. The principle wanted the consultancy to help him choose one of four memory approaches that produces the best student performance. He wants the chosen approach to be used throughout the school. Jack, the experienced senior consultant was assigned to this task. He decided to use the experiments to get the data and analyze the data to draw some conclusions.
He recruited 20 volunteers, asked them to use each of the four memory approaches, and recorded their test scores for each approach. The test scores were used to measure the performances of the approaches. The assumptions were that the higher the score, the better the performance and the same score, the same performance. Finally, a set of data was obtained.
According to the data, Jack wanted to know the following information:
- Whether the performances of the four approaches were the same?
- Which approach might have the best performance to be recommended to the principle?
Based on Jack's previous experience, he thought the data should follow the normal distribution.
Listed below is the test score data:
Participants
|
TScore1
|
TScore2
|
TScore3
|
TScore4
|
1
|
8
|
7
|
6
|
7
|
2
|
5
|
8
|
5
|
6
|
3
|
6
|
5
|
3
|
4
|
4
|
6
|
6
|
7
|
3
|
5
|
8
|
10
|
8
|
6
|
6
|
6
|
5
|
6
|
3
|
7
|
6
|
5
|
2
|
3
|
8
|
9
|
9
|
9
|
6
|
9
|
5
|
4
|
3
|
7
|
10
|
7
|
6
|
6
|
5
|
11
|
8
|
7
|
6
|
7
|
12
|
5
|
8
|
5
|
6
|
13
|
6
|
5
|
3
|
4
|
14
|
6
|
6
|
7
|
3
|
15
|
9
|
10
|
8
|
6
|
16
|
6
|
5
|
6
|
3
|
17
|
6
|
5
|
2
|
3
|
18
|
9
|
9
|
9
|
6
|
19
|
5
|
4
|
3
|
7
|
20
|
7
|
6
|
6
|
5
|
We can see that there are five variables in the data, the first one is the participant ID, and the next four variables are the test scores after using the memory approach 1, 2, 3 and 4, named TScore1, TScore2, TScore3, and TScore4. There were 20 candidates who attended the test and got the test score.
Let’s do some analysis on the two questions then. Since the average (mean) of scores reflect the overall performance level, we compare the performances of four approaches based on the average (mean). According to the assumption above, the higher mean indicates that the approach has the better performance, the same mean indicates that the approaches have the same performances. So the highest mean should have the best performance. Then, we can measure the performance by testing the mean, and translate the two questions into the following:
- Whether the four approaches have the similar means?
- Which approach has the highest mean?
Also, from the data, we can see that for the same participant, the four memory approaches are all measured on him or her. In the field of statistics, the participant is considered the subject, and the four approaches are measured on the same subject. Per the concept of the repeated measures, all the measures on the same subject are considered as the repeated measures. So the four approaches can be considered as the repeated measures. The first question above can then be changed to:
- Whether the four repeated measures have the similar means?
The repeated measures ANOVA can test if two or more variables have similar means, and both the Classical and Bayesian have the procedures to test the equality of multiple group means. Considering we have the prior distribution of data. We select the Bayesian one-way repeated measures ANOVA to solve the questions.
IBM SPSS Statistics Bayesian One-Way Repeated Measures ANOVA Procedure
We can use the Bayes Factor to test whether the four approaches have similar means in this procedure. It can get a confirmed result based on the value of the Bayes Factor. Then, we can estimate and plot the posterior distribution of each group mean, the basic characteristic of the Bayesian to tell which one might have the highest mean.
The data above has already been entered in the IBM SPSS Statistics Subscription below:

To perform the one-way repeated measures ANOVA procedure
- Click Analyze and from the list of procedures, select Bayesian Statistics, and all its procedures displayed on the right.
- Select One-way Repeated Measures ANOVA and open it.

Specifying UI Settings and Perform the Procedure
Before specifying your settings, remember that in the one-way repeated measures ANOVA, the parameters of interest are the means of the repeated measures variables. In this case, we have four repeated measures variables representing four approaches, and then the four means of them are the ones that we are interested in. All of the later tests are conducted around them.
Below is the UI Setting page, where you can specify your settings and analysis:

To specify your settings and perform the procedure
- From the Variable tab, select the four variables (TScore1, TScore2, TScore3, TScore4) that are repeated measures.
- Under Bayesian Analysis, select Use Both Methods. Selecting that option indicates that we want to get the posterior distribution for the four means, and we also want to compute the value of the Bayes Factor.

- Keep the default settings in the Criteria tab.
- In the Bayes Factor tab, there are two available methods. The prior of the ‘BIC’ method is a multivariate normal distribution. The Rouder’s mixed design is a multivariate Cauchy distribution. In this case, we select the BIC method, which is also a default setting. The prior information of BIC is set under the algorithm and is not exposed to the user. This information is described in the user guide of the Bayesian procedure.
- From the Plot tab, select all the repeated measure variables to show their mean plots.
- Click Run Analysis and select Paste to Syntax to copy the generated syntax to another page named ‘unnamed-Syntax’ as shown below:

- On the ‘unnamed-Syntax’’ page, select this syntax and run it. The output is generated and displayed on the ‘Output’ page.
- The Output screen lists items that were generated and provides navigation to view each of those items.

- Select Bayes Factor and test of Sphericity and the content is displayed on the right. From the table, the value of the Bayes Factor is 280611.415 and with the BIC method, it is much greater than 1. This indicates that we have extremely strong evidence in favor of the alternative hypothesis that the means of test scores among the four memory approaches are not the same. In short, it is highly likely that the means of the four approaches are not the same based on the observed data. This answers the first. The content of the 'Bayes Factor and Test of Sphericity' is shown below:

Let's focus on the posterior distribution for the four means of the four approaches. The next two items ‘Bayes Estimates of Group Means’ and the ‘Posterior Distribution of Group Means’ both display the posterior distribution information by using the different forms of expression. The former uses a table while the latter uses a chart.
The table ’Bayesian Estimates of Group Means’ is shown as below. In this table, the posterior statistics is provided, including means, median, and variances to characterize the wanted posterior distributions.

Posterior distribution was estimated based on the Bayesian Central Limit Theorem. From the table, these are the following findings:
- For all the means, the variance values of the posterior distribution are the same. The value is 0.149, which shows that the spread out of the posterior distributions of the four approaches is similar.
- The 95% Credible Interval item shows that for each group, the posterior mean has the 95% probability within the area that the smallest value is the Lower Bound and the biggest value is the Upper Bound.
The TScore1 represents approach1 and let’s use it as the example. For the TScore1, the Lower Bound is 6.5438 and the Upper Bound is 8.0562, which indicates that the posterior mean of approach1 has the 95% probability within the area that smallest value is 6.5438 and the largest value is 8.0562.
The means for approach2, 3 and 4 have the 95% probability to range from 5.7438 to 7.2562, 4.7438 to 6.2562, and 4.2438 to 5.7562.
Next, let’s look at the chart ‘Posterior Distribution of Group Means.’ It is shown below:

The plot chart helps in visualizing the differences among the four means. There are four curves in the chart and each one shows the posterior distribution for one mean.
In the chart, the x-axis shows the different means and the y-axis represents the likelihood of the means we are interested in. The larger the Y value, the more information was captured and provided in the observed data and shows where the means are likely to fall.
From the chart we can get the following information:
- The four curves are clearly separated, which indicates that they have large differences.
- It is obvious that the center or the mean of the pink curve is the smallest and the one in the light green curve is the biggest, the pink, and the light green curves represent the approach 4 and 1, so we learn that the mean for approach 1 is the biggest and that approach 4 is the smallest.
- Approach 1 has the biggest mean, the biggest score, and thus the highest performance.
Conclusions
- The four approaches don’t have the same performance.
- Approach 1 will produce the best performance by the students and should be recommended to the principle.
Finally, I would like to sincerely thank my colleagues Ying Da Jiang and Si Er Han who helped me much in revising and polishing this article.
#GlobalAIandDataScience#GlobalDataScience