| Literature DB >> 34846675 |
David Issa Mattos1, Érika Martins Silva Ramos2.
Abstract
This article introduces the bpcs R package (Bayesian Paired Comparison in Stan) and the statistical models implemented in the package. This package aims to facilitate the use of Bayesian models for paired comparison data in behavioral research. Bayesian analysis of paired comparison data allows parameter estimation even in conditions where the maximum likelihood does not exist, allows easy extension of paired comparison models, provides straightforward interpretation of the results with credible intervals, has better control of type I error, has more robust evidence towards the null hypothesis, allows propagation of uncertainties, includes prior information, and performs well when handling models with many parameters and latent variables. The bpcs package provides a consistent interface for R users and several functions to evaluate the posterior distribution of all parameters to estimate the posterior distribution of any contest between items and to obtain the posterior distribution of the ranks. Three reanalyses of recent studies that used the frequentist Bradley-Terry model are presented. These reanalyses are conducted with the Bayesian models of the bpcs package, and all the code used to fit the models, generate the figures, and the tables are available in the online appendix.Entities:
Keywords: Bayesian paired comparison; Bradley-Terry; Davidson
Mesh:
Year: 2021 PMID: 34846675 PMCID: PMC9374650 DOI: 10.3758/s13428-021-01714-2
Source DB: PubMed Journal: Behav Res Methods ISSN: 1554-351X
Fig. 1Example of traceplots for the parameters of the pizza model. Note that the traceplots do not contain any apparent pattern (are stationary) and all chains are overlapping in a caterpillar format
Parameters estimates for the simple Bradley–Terry model
| Parameter | Mean | Median | HPD lower | HPD upper | N. Eff. Samples |
|---|---|---|---|---|---|
| image1 | − 4.577 | − 4.554 | − 6.533 | − 2.489 | 598 |
| image2 | − 2.465 | − 2.436 | − 4.503 | − 0.461 | 596 |
| image3 | − 0.154 | − 0.120 | − 2.221 | 1.830 | 596 |
| image4 | 0.038 | 0.069 | − 2.065 | 1.977 | 596 |
| image5 | 0.197 | 0.227 | − 1.874 | 2.175 | 595 |
| image6 | 1.742 | 1.770 | − 0.349 | 3.668 | 594 |
| image7 | 1.917 | 1.947 | − 0.188 | 3.842 | 594 |
| image8 | 2.930 | 2.967 | 0.879 | 4.920 | 597 |
Fig. 2Worth values of the images, in terms of moisture content, and their respective 95% HPD interval in the simple Bradley–Terry model
Rank of the images based on moisture content
| Parameter | Median Rank | Mean Rank | Std.Rank |
|---|---|---|---|
| image8 | 1 | 1.00 | 0.00 |
| image7 | 2 | 2.00 | 0.05 |
| image6 | 3 | 3.00 | 0.05 |
| image5 | 4 | 4.01 | 0.08 |
| image4 | 5 | 5.00 | 0.08 |
| image3 | 6 | 6.00 | 0.03 |
| image2 | 7 | 7.00 | 0.00 |
| image1 | 8 | 8.00 | 0.00 |
Comparison of the WAIC of the Bradley–Terry model and the Bradley–Terry model with random effects on the subjects for each species
| WAIC | ||
|---|---|---|
| Specie | Bradley–Terry | Bradley–Terry with random effects |
| Macaques | 7101.5 | 6712.6 |
| Chimpanzees | 7199.4 | 6720.0 |
| Gorillas | 9767.2 | 8792.9 |
Parameters of the random effects model with 95% HPD and the number of effective samples
| Parameter | Mean | Median | HPD lower | HPD upper | N. Eff. Samples |
|---|---|---|---|---|---|
| Macaque | |||||
| Carrot | 0.12 | 0.12 | − 0.74 | 1.04 | 9934 |
| Celery | − 2.28 | − 2.29 | − 3.17 | − 1.39 | 9712 |
| Jungle Pellet | 1.23 | 1.23 | 0.36 | 2.15 | 9778 |
| Oats | − 0.90 | − 0.90 | − 1.77 | 0.05 | 9886 |
| Peanuts | 2.01 | 2.00 | 1.14 | 2.92 | 10195 |
| Green Beans | − 0.17 | − 0.17 | − 1.05 | 0.76 | 10176 |
| Chimpanzees | |||||
| U1_std | 0.58 | 0.57 | 0.42 | 0.75 | 4277 |
| Apple | 0.03 | 0.03 | − 0.97 | 1.08 | 10200 |
| Tomato | 0.32 | 0.32 | − 0.70 | 1.34 | 9880 |
| Carrot | − 0.21 | − 0.21 | − 1.25 | 0.77 | 9435 |
| Grape | 0.62 | 0.62 | − 0.38 | 1.69 | 10186 |
| Cucumber | − 0.32 | − 0.33 | − 1.36 | 0.67 | 9911 |
| Turnip | − 0.43 | − 0.43 | − 1.43 | 0.59 | 9342 |
| Gorilla | |||||
| U1_std | 0.72 | 0.70 | 0.49 | 1.01 | 4675 |
| Apple | 0.03 | 0.03 | − 0.95 | 0.99 | 13186 |
| Carrot | − 0.11 | − 0.11 | − 1.10 | 0.84 | 12365 |
| Grape | 0.86 | 0.87 | − 0.13 | 1.81 | 13237 |
| Tomato | 0.85 | 0.86 | − 0.12 | 1.85 | 13031 |
| Cucumber | − 0.70 | − 0.70 | − 1.67 | 0.27 | 12674 |
| Turnip | − 0.94 | − 0.94 | − 1.93 | 0.04 | 12944 |
| U1_std | 0.78 | 0.77 | 0.57 | 1.02 | 4883 |
Fig. 3The estimated abilities of each food type for each species in both models. Food items that do not have an estimated ability were not fed to that particular species
Ranking of the food preferences per species for the random effects model
| Food | Median Rank | Mean Rank | Std. Rank |
|---|---|---|---|
| Macaque | |||
| Peanuts | 1 | 1.01 | 0.09 |
| Jungle Pellet | 2 | 1.99 | 0.09 |
| Carrot | 3 | 3.17 | 0.37 |
| Green Beans | 4 | 3.84 | 0.39 |
| Oats | 5 | 4.99 | 0.08 |
| Celery | 6 | 6.00 | 0.00 |
| Chimpanzees | |||
| Grape | 1 | 1.50 | 0.86 |
| Tomato | 2 | 2.24 | 1.10 |
| Apple | 3 | 3.36 | 1.25 |
| Carrot | 4 | 4.26 | 1.25 |
| Cucumber | 5 | 4.62 | 1.24 |
| Turnip | 5 | 5.01 | 1.10 |
| Gorilla | |||
| Tomato | 1 | 1.54 | 0.60 |
| Grape | 2 | 1.57 | 0.61 |
| Apple | 3 | 3.37 | 0.68 |
| Carrot | 4 | 3.69 | 0.70 |
| Cucumber | 5 | 5.19 | 0.65 |
| Turnip | 6 | 5.65 | 0.57 |
Posterior probabilities of the novel stimuli i being selected over the trained stimuli j
| Item i | Item j | Probability | Odds Ratio |
|---|---|---|---|
| Gorilla | |||
| Apple | Cucumber | 0.61 | 1.56 |
| Apple | Grape | 0.23 | 0.30 |
| Apple | Turnip | 0.67 | 2.03 |
| Apple | Carrot | 0.56 | 1.27 |
| Tomato | Cucumber | 0.74 | 2.85 |
| Tomato | Grape | 0.50 | 1.00 |
| Tomato | Turnip | 0.87 | 6.69 |
| Tomato | Carrot | 0.75 | 3.00 |
| Chimpanzee | |||
| Apple | Cucumber | 0.53 | 1.13 |
| Apple | Grape | 0.43 | 0.75 |
| Apple | Turnip | 0.54 | 1.17 |
| Apple | Carrot | 0.52 | 1.08 |
| Tomato | Cucumber | 0.64 | 1.78 |
| Tomato | Grape | 0.41 | 0.69 |
| Tomato | Turnip | 0.64 | 1.78 |
| Tomato | Carrot | 0.65 | 1.86 |
| Macaque | |||
| Oats | Celery | 0.79 | 3.76 |
| Oats | Jungle Pellet | 0.16 | 0.19 |
| Oats | Peanuts | 0.05 | 0.05 |
| Oats | Carrot | 0.25 | 0.33 |
| Green Beans | Celery | 0.89 | 8.09 |
| Green Beans | Jungle Pellet | 0.19 | 0.23 |
| Green Beans | Peanuts | 0.09 | 0.10 |
| Green Beans | Carrot | 0.42 | 0.72 |
Lambda parameters of the model and the random effects standard deviation
| Parameter | Mean | Median | HPD lower | HPD lower | N. Eff. Samples |
|---|---|---|---|---|---|
| Active | − 3.16 | − 3.14 | − 5.98 | − 0.52 | 2793 |
| Active-Collaborative | 2.10 | 2.08 | − 0.60 | 4.82 | 2764 |
| Collaborative | 4.88 | 4.89 | 2.01 | 7.71 | 2741 |
| Passive-Collaborative | 1.23 | 1.24 | − 1.38 | 4.00 | 2724 |
| Passive | − 5.11 | − 5.09 | − 7.99 | − 2.13 | 2718 |
| U1_std | 3.60 | 3.57 | 2.66 | 4.56 | 1899 |
Subject predictors parameters by role
| Parameter | Mean | Median | HPD lower | HPD lower | N. Eff. Samples |
|---|---|---|---|---|---|
| Active | |||||
| Internal | − 0.16 | − 0.16 | − 2.72 | 2.61 | 2563 |
| Chance | − 0.15 | − 0.15 | − 2.93 | 2.56 | 2494 |
| Doctors | − 0.80 | − 0.80 | − 3.53 | 1.97 | 2211 |
| Other people | − 0.29 | − 0.28 | − 3.16 | 2.33 | 2576 |
| Active-Collaborative | |||||
| Internal | − 0.01 | − 0.01 | − 2.64 | 2.56 | 2534 |
| Chance | − 0.24 | − 0.25 | − 2.94 | 2.55 | 2374 |
| Doctors | − 0.74 | − 0.73 | − 3.50 | 1.92 | 2204 |
| Other people | − 0.50 | − 0.50 | − 3.39 | 2.14 | 2594 |
| Collaborative | |||||
| Internal | − 0.09 | − 0.08 | − 2.72 | 2.61 | 2571 |
| Chance | 0.09 | 0.09 | − 2.56 | 2.93 | 2362 |
| Doctors | 0.28 | 0.29 | − 2.48 | 3.02 | 2190 |
| Other people | − 1.22 | − 1.23 | − 3.98 | 1.51 | 2703 |
| Passive-Collaborative | |||||
| Internal | 0.12 | 0.12 | − 2.46 | 2.90 | 2516 |
| Chance | 0.13 | 0.14 | − 2.60 | 2.90 | 2355 |
| Doctors | 0.75 | 0.76 | − 1.97 | 3.54 | 2174 |
| Other people | 1.04 | 1.04 | − 1.69 | 3.81 | 2708 |
| Passive | |||||
| Internal | 0.00 | 0.01 | − 2.71 | 2.59 | 2509 |
| Chance | − 0.20 | − 0.20 | − 3.08 | 2.45 | 2375 |
| Doctors | 0.41 | 0.40 | − 2.38 | 3.12 | 2205 |
| Other people | 0.81 | 0.81 | − 1.90 | 3.59 | 2656 |
Fig. 4The values of the subject predictors parameters with HPD intervals
Probabilities of selecting role i instead of j based on changes of the values of the HLOC dimensions
| Roles | HLOC dimensions | |||||
|---|---|---|---|---|---|---|
| i | j | Internal | Chance | Doctors | OtherPeople | Probability |
| Active | Passive | 0 | 0 | 0 | 0 | 0.88 |
| Active | Passive | − 2 | 0 | 0 | 0 | 0.80 |
| Active | Passive | 2 | 0 | 0 | 0 | 0.88 |
| Active | Passive | 0 | 0 | − 2 | 0 | 0.89 |
| Active | Passive | 0 | 0 | 2 | 0 | 0.78 |
| Act.-Collab. | Collab. | 0 | 0 | 0 | 0 | 0.08 |
| Act.-Collab. | Collab. | − 2 | 0 | 0 | 0 | 0.08 |
| Act.-Collab. | Collab. | 2 | 0 | 0 | 0 | 0.07 |
| Act.-Collab. | Collab. | 0 | 0 | − 2 | 0 | 0.07 |
| Act.-Collab. | Collab. | 0 | 0 | 2 | 0 | 0.04 |
| Collab. | Pass.-Collab. | 0 | 0 | 0 | 0 | 0.98 |
| Collab. | Pass.-Collab. | 0 | − 2 | 0 | 0 | 0.94 |
| Collab. | Pass.-Collab. | 0 | 2 | 0 | 0 | 0.98 |
| Collab. | Pass.-Collab. | 0 | 0 | 0 | − 2 | 0.97 |
| Collab. | Pass.-Collab. | 0 | 0 | 0 | 2 | 0.96 |