Abstract
A Thurstonian model for ranking data assumes that observed rankings are consistent with those of a set of underlying continuous variables. This model is appealing since it renders ranking data amenable to familiar models for continuous response variables—namely, linear regression models. To date, however, the use of Thurstonian models for ranking data has been very rare in practice. One reason for this may be that inferences based on these models require specialized technical methods. These methods have been developed to address computational challenges involved in these models but are not easy to implement without considerable technical expertise and are not widely available in software packages. To address this limitation, we show that Bayesian Thurstonian models for ranking data can be very easily implemented with the JAGS software package. We provide JAGS model files for Thurstonian ranking models for general use, discuss their implementation, and illustrate their use in analyses.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
Introduction
Consider data where subjects rank K choices. Ranking data can be represented by a set of K response variables: \( {Y_{i1 }},{Y_{i2 }},\ldots,{Y_{iK }} \), where Y ik represents the rank given by subject i to choice k. For example, Y i1 = 2, Y i2 = 3, and Y i3 = 1 is a ranking of K = 3 choices by subject i where the third choice is ranked first, the first choice is ranked second, and the second choice is ranked third. The use of ranking data in research is attractive because ranks are relatively easy to elicit from respondents, cannot violate transitivity, and are not subject to idiosyncrasiesin scale use. Ranking data are particularly useful in applications where respondents are faced with evaluating several choices simultaneously, as in conjoint analysis. The challenge of ranking data lies in the statistical analysis of these multivariate discrete responses. Reviews of statistical models for ranking data are given by Critchlow, Flinger, and Verducci (1991) and Marden (1995). One particular family of models, known as order statistic models, assume that the observed ranking can be modeled on the basis of the order statistics of a sample from an underlying multivariate continuous distribution. The Thurstonian ranking model is one of the oldest and most well-known order statistic models.
Despite being a relatively simple and intuitive model, reported applications of Thurstonian ranking models have been rare, and many of these are only examples in methodological articles. Computational difficulties in implementing Thurstonian ranking models are one likely reason for their rarity. Thurstonian ranking models define the probability of an observed ranking as a (K − 1)-dimensional integral, which cannot be expressed in closed form. The crux of the problem of implementing these models is how to either approximate this integral numerically or circumvent its evaluation altogether. Much of the methodological research on Thurstonian ranking models has focused on this issue, and a variety of solutions have been proposed. But these methods require significant technical expertise to use, and since software using these methods is not widely available, analyses must often be programmed on a case-by-case basis. This article directly addresses this problem by showing that Bayesian Thurstonian ranking models can be very easily implemented in the free and open-source software package JAGS. We also provide generic JAGS model files that users can easily adapt for their own analyses.
The rest of this article is organized as follows. We briefly review Thurstonian ranking models, including discussions of the specification of covariates, model identification, and estimation methods. We then describe in detail the implementation of Bayesian Thurstonian ranking models in JAGS. We also provide two demonstrations of analyses using Thurstonian ranking models with JAGS, using real data sets. Model files and further details are provided in the appendices and as supplementary material.Footnote 1
Thurstonian ranking models
The Thurstonian ranking model was proposed as a scaling method for ranking data by Thurstone (1931), on the basis of his law of comparative judgment (Thurstone, 1927). This model assumes that observed frequencies of rankings are consistent with probabilities of the ranking of unobserved continuous response variables representing what might be thought of as the psychological perception of each choice. A Thurstonian ranking derives the probability of a given ranking on the basis of the distribution of a set of K unobserved or latent response variables, \( {U_{i1 }},{U_{i2 }},\ldots,{U_{iK }} \), corresponding to the K ranked choices.Footnote 2 These latent response variables are assumed to have a multivariate normal distribution, \( {N_K}\left( {{\mu_i},∑} \right) \). One of the strengths of Thurstonian ranking models is in the flexibility of the mean and covariance structure of the latent responses. To extend the model to include covariates, we index the mean vector by the observation and will later discuss how to parameterize the mean as a function of one or more covariates. An arbitrary covariance structure allows heteroscedasticity of and correlations among the latent responses. Other related order-statistic models, such as “exploded” logit models (Beggs, Cardell, & Hausman, 1981; Chapman & Staelin, 1982; Hausman & Ruud, 1987; Luce, 1959; Plackett, 1975; Punj & Staelin, 1978), assume independence of the latent responses (sometimes referred to as independence of irrelevant alternatives. or IIA, in the discrete choice literature), which can be too restrictive.
It is common to write Thurstonian ranking models in terms of the differences among the latent responses for identification reasons and to slightly simplify computations. Let \( {Z_{ik }}={U_{ik }}-{U_{iK }} \) represent the difference between the latent response to the kth and Kth (i.e., last) choice. In matrix notation, this can be written as z i = C u i , where \( u_i^{\prime }=\left( {{U_{i1 }},{U_{i2 }},\ldots,{U_{iK }}} \right) \), \( z_{i}^{\prime } = ({{Z}_{{i1}}},{{Z}_{{i2}}}, \ldots ,{{Z}_{{i,K - 1}}}) \), and
The probability of a given rank order can be expressed as
where ϕ denotes the probability density function of a multivariate normal distribution with given mean vector and covariance matrix evaluated at \( z\prime =\left( {{z_1},{z_2},\ldots,{z_{K\;-\;1 }}} \right) \), and S i is the set of values \( {z_1},{z_2},\ldots,{z_{K-1 }} \) such that, when combined with z K = 0, has the same rank order as \( {y_{i1 }},{y_{i2 }},\ldots,{y_{iK }} \). Note that \( I\left( {z\in {S_i}} \right)=1 \) if \( z\in {S_i} \), and zero otherwise, so that Eq. 2 computes the probability that the multivariate, normally distributed vector z i with mean vector C μ i and covariance matrix \( \mathbf{C}∑C\prime \) falls within S i to produce the observed rank order \( {{y}}_i^{\prime }=\left( {{y_{i1 }},{y_{i2 }},\ldots,{y_{iK }}} \right) \).
Including covariates
Discussions of Thurstonian ranking models do not always include covariates. The mean and variance are often specified as being constant over observations, although some researchers have discussed letting the mean μ i vary over observations, due to its dependence on covariates (e.g., Yu, 2000). This is not a major extension of the model, but it is worth discussion since, in practice, covariates are common and there are some important considerations in terms of how their effects are specified and identified. Including covariates effectively creates a kind of regression model for ranking data.
Because ranking data are multivariate in the sense that each observation consists of K ranks, \( {Y_{i1 }},{Y_{i2 }},\ldots,{Y_{iK }} \), that vary both between and within choice sets, it is useful to distinguish between covariates that vary only between choice sets (i.e., over i but not over k) and those that vary within choice sets (i.e., over k). In the first case, the covariates might represent characteristics of respondents, conditions under which respondents made their rankings, and interactions thereof. Assume that the values of P covariates are collected in a vector \( x_i^{\prime }=\left( {1,{x_{i1 }},{x_{i2 }},\ldots,{x_{iP }}} \right) \). Then it might be reasonable to model the mean vector \( \mu_i^{\prime }=\left( {{\mu_{i1 }},{\mu_{i2 }},\ldots,{\mu_{iK }}} \right) \) using the linear model
A second case is one where all covariates vary within choice sets. This could occur if characteristics of the choices are used as covariates. Here, the covariates are collected into a vector \( x_{ik}^{\prime }=\left( {{x_{i1k }},{x_{i2k }},\ldots,{x_{ikP }}} \right) \). A linear model for the mean in this case would be
Note that the differences between Eqs. 3 and 4 are whether the parameters or covariates vary over choices. A third situation is one where some covariates vary only between choice sets, whereas others vary within choice sets. Suppose that there are P b covariates that vary only between choice sets and P w covariates that vary within choice sets. Here, a mean structure can be created that combines Eqs. 3 and 4 so that
Here, we use the superscripts (b) and (w) to distinguish between covariates and parameters corresponding to effects that vary between choice sets and within choice sets, respectively. Clearly the models in Eqs. 3 and 4 can be thought of as special cases of Eq. 5. Perhaps less obviously, with the use of dummy variables for each choice, Eqs. 3 and 5 can be written as Equation 4. But for simplicity and clarity, it is useful to consider special cases separately, rather than considering only the general but more complicated model. Similar discussions of parameterizations for models for choice data are given by, for example, Agresti (2002).
Parameter identification
The identification of Thurstonian models for ranking data is complicated by the fact that the probabilities defined in Eq. 2 depend only on the differences between latent responses and that the scale of these differences is arbitrary. On the basis of the mean structure in Eq. 3, the mean of \( {Z_{ik }}={U_{ik }}-{U_{{i{k}^{\prime}}}} \) is
Since the mean difference depends only on the difference between β jk and β jk′, we can fix, say, β jK = 0 to resolve the indeterminacy. However, it should be noted that the choice of which β jk should be fixed and the value at which it should be fixed are arbitrary. Thus, inferences are limited to the differences among the β jk between choices (i.e., over k). The mean of Z ik based on the mean structure in Eq. 4 is
This shows that an implicit assumption of this parameterization is that x ijk varies over the choices; otherwise, \( {x_{ijk }}-{x_{{ij{k}^{\prime}}}}=0 \) and β j are not identified. Models with covariates that do not vary within choice sets should use the parameterization in Eq. 3 or 5. The identification constraints necessary for the mean structure in Eq. 5 follow naturally from those for Eqs. 3 and 4, discussed above.
The covariance matrix \( \mathbf{∑} \) is identified only up to the covariance matrix of the differences, \( \mathbf{C}∑C\prime \). Our recommendation is to limit inferences to this covariance matrix. Although there are various constraints that can be imposed on \( \mathbf{∑} \) so that it is identified (see Yu, 2000), these constraints, while technically convenient, are not particularly meaningful. The scale of the latent responses is not set, meaning that the probability of a given rank order does not change if μ i and \( \mathbf{C}∑C\prime \) are multiplied by d and \( \sqrt{d} \), respectively, for any d > 0. Our approach to resolving this indeterminacy is to fix the generalized variance of \( \mathbf{C}∑C\prime \), which is defined as the determinant \( v=\left| {\mathbf{C}∑C\prime } \right| \).Footnote 3 We find this approach useful because it does not involve fixing individual arbitrary parameters.
Estimation methods
Perhaps the most significant obstacle to the use of Thurstonian ranking models in research is the computational complexity of the probability defined in Eq. 2. The (K − 1)-dimensional integral cannot be expressed in closed form. In cases with relatively few observed rank orders, few choices, and/or few distinct values of the covariate vector, numerical methods can be used to directly approximate the integral (e.g., Genz, 1992), but these methods can be computationally or numerically problematic in other situations. Other estimation approaches have been proposed to circumvent the integration in various ways. Several researchers have proposed limited-information methods using the ranking of pairs or triples of choices (Brady, 1989; Chan & Bentler, 1998; Maydeu-Olivares, 1999). Others have proposed full-information maximum likelihood methods using Monte Carlo expectation-maximization algorithms (Poon & Lu, 2009; Xu, Poon, & Lee, 2008). Yao and Böckenholt (1999) and Yu (2000) showed that Bayesian Thurstonian ranking models are amenable to Markov chain Monte Carlo (MCMC) algorithms by using data augmentation with Gibbs sampling (Gelfand & Smith, 1990; Tanner & Wong, 1987). Using this approach, the unobserved differences are specified as missing data in a complete-data likelihood function to create the Bayesian probability model:
where h(θ) denotes a prior distribution for all unknown parameters (collected into the vector θ). Using MCMC, a sample of realizations from the posterior distribution can be simulated. Inferences concerning the marginal posterior distribution of θ, “integrating” over the unobserved responses \( z\prime_i=\left( {{Z_{i1 }},{Z_{i2 }},\ldots,{Z_{i,K\;-\;1 }}} \right) \), can then be done using summary statistics of the sample without reference to z i .
While these approaches have significantly lessened computational obstacles to the use of Thurstonian ranking models, they require significant expertise in their use. Progress has been made in making limited-information methods accessible using standard software packages for mean and covariance structure models (Brown & Maydeu-Olivares, 2012; Maydeu-Olivares & Böckenholt, 2005). But full-information likelihood-based methods have not yet been incorporated into widely available user-friendly software packages, and implementing them oneself requires significant expertise in programming algorithms for simulation-based inference. The main purpose of this article is to address this obstacle by showing how Bayesian Thurstonian ranking models can be implemented very easily in the software package JAGS.
Implementing Bayesian Thurstonian Ranking Models in JAGS
Just Another Gibbs Sampler, or JAGS (Plummer, 2003), is a free program licensed under the GNU General Public License. Compiled versions of JAGS are available for the Macintosh OS X and Microsoft Windows operating systems and several Linux distributions. The source code is also available. JAGS is similar to WinBUGS (Lunn, Spiegelhalter, Thomas, & Best, 2009) and OpenBUGS (Thomas, O’Hara, Ligges, & Sturtz, 2006), where “BUGS” stands for “Bayesian inference using Gibbs sampling,” and also PROC MCMC in SAS/STAT (SAS Institute Inc., 2008). With these programs, a user specifies a Bayesian probability model, and the program builds an MCMC algorithm to sample realizations from the posterior distribution. These programs exploit the fact that such algorithms can be broken down into a series of smaller steps for models that can be represented as directed acyclic graphs, which include many common statistical models. But the user needs only to specify a model in a simple syntax. The syntax used by JAGS, WinBUGS, and OpenBUGS is similar to that used in R (R Development Core Team, 2012). All this allows the user to focus on model specification and inference, and not the development and programming of the MCMC algorithm. For a good didactic treatment of Bayesian modeling and analysis using JAGS, see Kruschke (2011).
Here, we show how to use JAGS to conduct analyses using Thurstonian ranking models. It is convenient to use the data augmentation approach to specify the Bayesian probability model given in Eq. 8, since the probability in Eq. 2 is difficult to evaluate. Given S i , the distribution of z i is censored, in the sense that the value of z i is unknown but is known to be in S i so as to be consistent with the observed ranking, y i . We refer to z i as being rank-censored. Without conditioning on \( {z_i}\in {S_i} \), the observed ranking, the distribution of z i is multivariate normal, so that
The trick is to specify the rank-censoring mechanism. This can be done by using some of the built-in programming functions to define bounds for the “distribution” in JAGS. This functionality is intended for censored response variables, such as in survival models, but it can also be used to specify the censoring of \( {Z_{i1 }},{Z_{i2 }},\ldots,{Z_{i,K\;-\;1 }} \) implied by an observed ranking. Formally, the rank-censoring implies that
where y i(k) is the value of y ik with rank k.Footnote 4 For example, the ranking y i1 = 2, y i2 = 3, y i3 = 1, and y i4 = 4 implies that S i is the region such that 0 < Z i2 < Z i1 < Z i3 (recall that Z iK = 0 by definition). This can be expressed as interval-censoring, since the ranking is consistent with
Thus, each Z ik is censored by one or two of the other latent responses. While WinBUGS, OpenBUGS, and PROC MCMC in SAS/STAT allow specification of censored variables, these packages cannot be used for Thurstonian ranking models in general, since they limit the censoring to scalars that are (conditionally) independent, which limits the range of models that can be considered. JAGS allows censoring of variables with an arbitrary joint distribution, and so, among the packages that have been developed for MCMC-based Bayesian inference, JAGS is particularly suitable for Thurstonian ranking models.
Appendix 1 lists the JAGS model file for a Thurstonian ranking model with a mean structure as defined in Eq. 3. In the interest of space, Appendix 2 lists only changes to this file to allow for the mean structures defined in refeq:mumodelw and Eq. 5. Little or no modification of the file is necessary otherwise. This file is quite general in the sense that it can be applied to data with an arbitrary number of observations, choices, and covariates. The files do not require changes on the part of the user, since known variable values are passed to the program as variables during a JAGS session. We will, however, consider a few points that may be of interest to some users. The rank-censored multivariate distribution of z i is defined on lines 15–23. The censoring mechanism given in Eq. 10 is defined on lines 17 and 18, which define the bounds for each element of z i , line 19, which indicates how each element of z i is censored on the basis of those bounds (the “variable” is a dummy variable indicating that the element is between the supplied bounds), and lines 22 and 23, which define the distribution of the elements of z i prior to censoring (here, Z iK = 0 by definition). The prior distribution of all β jk parameters is specified on line 27 as the relatively noninformative distribution N(0,1000). The prior distribution for the inverse of \( \mathbf{C}ΣC\prime \) is specified to be a Wishart distribution on line 36, with inverse scale matrix R = (K – 1)CC′ (defined on line 10) and degrees of freedom K − 1, which is also a relatively noninformative prior distribution.Footnote 5 Of course, these prior distributions can be modified by the user. The two quantities that a user will likely be interested in are and , which are defined as
and
respectively, where
to fix the generalized variance at v, which in our examples is v = K.Footnote 6 Recall that when β jk is interpreted, it is useful to consider differences or contrasts between choices of the form β jk – β jk′ since β jK = 0 to identify the model, but the choice of value at which to fix β jk is arbitrary. In cases where all covariates vary between choices as in Eq. 4, the identified parameters for the mean structure are
and in cases where some covariates vary within choice sets and some do not, the identified parameters for the mean structure are
To simplify notation, where necessary, we use an asterisk to denote an identified parameter based on the generalized variance, so that, for example, \( \beta_{jk}^{*}={\beta_{jk }}\sqrt{d} \) and \( \beta_j^{*}={\beta_j}\sqrt{d} \). The rest of the model file concerns only minor computations and variable definitions that will generally not vary over applications.
Again, we would like to emphasize that the JAGS model files are quite general. In practice, one needs only to consider whether covariates vary between choice sets, within choice sets, or both to choose the appropriate model file. The only other information that needs to be provided are the N by K array of rankings, the design matrix or matrices, the number of observations (N), the number of choices (K), and the number of covariates (P, or P b and P w ). A relatively efficient way to run JAGS is by using the rjags package (Plummer, 2011) in R. We show how to do this in the following examples. The JAGS model files, data, and R scripts for replicating these analyses are available as supplementary material.
Example: Relationship between ranking of compensation plans and cultural orientation
This example concerns data collected as part of a study on compensation preferences (Kuhn & Johnson, 2004). While it is sometimes claimed that most people prefer to be paid on the basis of individual performance, rather than team or organizational performance, and that most strongly prefer fixed pay (salaries) to variable pay, such as performance bonuses and profit sharing (see Rynes, Colbert, & Brown, 2002), other research indicates more complex relationships (Kuhn, 2009; Kuhn & Yockey, 2003). In particular, cross-cultural variation in preferences for reward allocation has been widely studied (see Fischer & Smith, 2003, for a review), and U.S. students with more individualistic orientations tend to report greater preferences for individual rather than team-based raises (Cable & Judge, 1994). The data analyzed here adopted a more nuanced approach to individual differences in value orientations as predictors of preferences among common pay schemes, using the Triandis and Gelfand (1998) model that crosses individualism and collectivism with power distance to describe four cultural value types: horizontal individualism (hi), horizontal collectivism (hc), vertical individualism (vi), and vertical collectivism (vc). In addition to completing an inventory developed by Triandis and Gelfand to assess these four value types, each subject in a sample of N = 116 also ranked K = 4 compensation plans in order of preference: individual bonus, team bonus, profit sharing, and seniority.
Let Y i1, Y i2, Y i3, and Y i4 denote the ranks of the individual bonus, team bonus, profit sharing, and seniority compensation plants, respectively, and let hi i , hc i , vi i , and vc i denote the standardized cultural orientation scores for the ith subject.Footnote 7 To model the rankings of the compensation plans as a function of these scores, we modeled the mean latent response of the ith subject to the kth compensation plan as
The parameters for the seniority-based compensation plan are fixed at zero (i.e., \( {\beta_{0,4 }}={\beta_{1,4 }}={\beta_{2,4 }}={\beta_{3,4 }}={\beta_{4,4 }}=0 \)) to identify the model. Because this constraint is arbitrary, to interpret the parameters, it is useful to consider differences in the mean response between compensation plans:
Thus, differences of parameters between plans capture the effect of the covariates on the mean difference or relative preference for the plans. For example, to compare individual bonus (k = 1) to team bonus (k′ = 2), β 1k – β 1k′ indicates how the mean preference for individual bonus changes relative to that of the team bonus plan as the horizontal individualism score (hi i ) changes. If \( {\beta_{1k }}-{\beta_{{1{k}^{\prime}}}} > 0 \), respondents tend to prefer individual over team bonus plans more as hi i increases, whereas if \( {\beta_{1k }}-{\beta_{{1{k}^{\prime}}}} < 0 \), respondents tend to prefer individual over team bonus plans less as hi i increases. The value of \( {\beta_{1k }}-{\beta_{{1{k}^{\prime}}}} \) is the rate at which this relative preference increases or decreases per unit change in hi i .
To conduct our analysis, we simulated realizations from the posterior distribution of the Bayesian Thurstonian ranking model given in Eq. 8 with the mean structure described above using JAGS from R using rjags. The R commands are given below.
The data are an N = 116 by K = 4 array of rankings (), and the corresponding four vectors of N = 116 cultural orientation scores (, , , and ). These are stored in a list object called , along with the values of N, P, and K. Initial values for the latent differences are generated by the function and stored in the array (the function is provided in Appendix 3). The command checks and compiles the model defined in the file . The listing of this file is given in Appendix 1. The command produces an initial sample to “burn in” the algorithm for 5,000 iterations. The command then simulates 10,000 realizations from the posterior distribution of and , as defined in Eqs. 12 and 13, respectively, which are saved in . Summaries (e.g., posterior means, quantiles and percentile ranks) of the posterior distribution of any parameter or functions thereof, such as those shown in the figures discussed below, can then be obtained by simply computing descriptive statistics of with any general-purpose statistical package. The adequacy of the burn-in period, convergence of the simulation, and the size of the simulated sample from the posterior distribution can be assessed using utilities in the R package coda (Plummer, Best, Cowles, & Vines, 2006).Footnote 8
Figure 1 shows the posterior distributions of the identified parameter differences, \( \beta_{jk}^{*}-\beta_{{j{k}^{\prime}}}^{*} \). Each box plot depicts the posterior distribution for the parameter difference for a given pair of compensation plans, k and k′. The box plots are constructed on the basis of the 2.5 %, 25 %, 50 %, 75 %, and 97.5 % percentiles. These percentiles are approximated by the sample percentiles from the posterior distribution of simulated realizations of \( \beta_{jk}^{*}-\beta_{{j{k}^{\prime}}}^{*} \) generated by JAGS. The box plots also show 95 % credibility intervals, since they cover the middle 95 % of the distribution. These can be used to assess which differences are unambiguously positive or negative. The example mentioned earlier of the effect of horizontal individualism on the relative preference for individual versus team bonus is shown by the left-most box plot in the panel in the second row and the second column (and also the left-most box plot in the panel in the second row and the first column, which is the reverse of this difference). This shows that on the basis of this analysis, we can be relatively confident that increases in horizontal individualism result in a preference for individual bonus to increase, relative to that of team bonus. As another example, the apparent effect of vertical collectivism is to increase preferences for team bonus, in comparison with the individual bonus, as shown in the left-most box plot in the last row and first and second columns. Probabilities can also be used to assess the (un)certainty in these differences. For example, the posterior probability that the preference for individual versus team bonus increases with horizontal individualism is \( P\left( {{\beta_{1,1 }}-{\beta_{1,2 }} > 0\left| y \right.} \right)\approx 0.99 \). The posterior probability that preference for team bonus versus individual bonus increases with vertical collectivism is \( P\left( {{\beta_{4,2 }}-{\beta_{4,1 }} > 0\left| y \right.} \right)\approx 0.99 \). These posterior probabilities are approximated very easily by the proportion of observations of the difference in the simulated sample that exceed zero.
In this example, the covariance structure \( \mathbf{C}ΣC\prime \) is not of interest. However, inferences concerning the covariance structure can be made using the posterior distribution of the elements of the covariance matrix. For illustration, Fig. 2 shows box plots depicting the posterior distribution of each distinct element of the covariance structure. It is important to remember that these are the posterior distributions of the (co)variances of the differences \( {Z_{ik }}={U_{ik }}-{U_{iK }} \), and not U ik , since, as was discussed earlier, the covariance structure of the latter is not identified.
Example: Ranking of job candidates after revelation of résumé discrepancies
This second example concerns a data set from a study that examined the effect of an experimental manipulation of apparent deception on the rank ordering of hypothetical job applicants (Kuhn, Johnson, & Miller, in press). Subjects were presented with a job description and were asked to evaluate the résumés of three candidates (with the initials MC, AS, and SW), and then they were given background check reports for each candidate before recording their final rank ordering. All participants evaluated the same three résumés, but they were randomly assigned to one of six conditions for the background reports. In each experimental condition, the background reports revealed that one applicant had a serious discrepancy (not having completed a claimed college degree), one applicant had a less serious discrepancy (employment dates of a previous job somewhat different than claimed), and the third applicant had no discrepancies. As part of the study, N = 73 subjects were asked to rank the K = 3 candidates with respect to their suitability for the job.
Let Y i1, Y i2, and Y i3 denote the ranks of the candidates MC, AS, and SW, respectively. Since all covariates vary within choice sets, we used the mean parameterization given in Eq. 4. The model is
where mc ik and as ik are indicator variables for the candidates MC and AS, respectively, and dates ik and degree ik are indicator variables for the dates and degree discrepancy conditions, respectively. On the scale of the latent response variables, this is effectively a three by three two-way factorial model with main effects for the candidate (MC, AS, or SW) and the presence and type of résumé discrepancy (dates, degree, or none). Here, the question is how the rankings depend on the candidate and the discrepancy conditions.
The implementation of this model in JAGS is similar to that in the previous example. The commands are given below.
The listing for the model file is described in Appendix 2. With respect to the previous example, the main difference here is the design matrix. Because the covariates vary over choices as well, three design matrices are assembled into an N by P by K array . Each “slice” of the array along the third dimension is a choice-specific design matrix, called , , and . A design matrix must be specified for each choice, but they are passed to JAGS as one array.
Figure 3a shows the posterior distributions of \( \beta_{i1}^{*} \) and \( \beta_{i2}^{*} \), as well as \( \beta_{i1}^{*}-\beta_{i2}^{*} \), which are the three pairwise contrasts among the three candidates. The posterior distributions show a clear mean preference for candidate MC over AS, SW over AS, and MC over SW. The posterior probabilities that these mean differences exceed zero are all at least .98. Figure 3b shows the posterior distributions of \( \beta_{i3}^{*} \), \( \beta_{i4}^{*} \), and \( \beta_{i3}^{*}-\beta_{i4}^{*} \), which are the three pairwise contrasts among the three discrepancy conditions. There appears to be a negligible distinction in mean preferences between the date discrepancy and the no-discrepancy versions. However, a college degree discrepancy clearly made the candidate less preferable, on average, in comparison with those with a date discrepancy or no discrepancy. The posterior probabilities that these mean differences are in the stated direction are both greater than 0.99.
The model used here is only one possible model for the observed data. Other Thurstonian models could be specified (e.g., with different mean or covariance structures), or other models from outside the family of Thurstonian models could be used. One general approach to assessing the fit of a Bayesian probability model is to use posterior predictive checks (Gelman, Meng, & Stern, 1996; Meng, 1994; Rubin, 1984). These checks are based on comparing observed values of a chosen statistic, computed from the data, with the posterior predictive distribution of the statistic implied by the model. This effectively compares the observed value of the statistic to its predicted value, while taking into account the uncertainty in the model parameters. For ranking data, one simple and intuitive measure is the count of each rank order. It is relatively simple to generate a sample of observations from the posterior predictive distribution using JAGS. This can be done by adding the following lines between lines 23 and 24 in the model file in Appendix 1:
These lines simulate realizations of Z ik () from the posterior predictive distribution and the ranking they imply (). Then the frequency of the six possible rankings in each simulated sample can be tabulated. Figure 4 shows the observed and posterior predictive distributions for the frequencies of the six possible rankings of the three candidates.
A model with poor fit may reveal observed counts that are outliers relative to the posterior predictive distribution of the counts.Footnote 9 Note that in Fig. 4, none of the observed counts appear to be particularly unusual, so this check does not suggest that the specified model is a poor fit. If one or more of the observed counts appeared to be extreme outliers, it would be appropriate to consider modifying the model to produce a better fit or to abandon the model if such modifications were unsuccessful. It should be noted that other statistics can be specified for the checks. Yao and Böckenholt (1999) suggested using counts of partial rankings of all subsets of two, three, and/or four choices. This approach is particularly useful when the observed counts of all possible rankings are too sparse, such as when the number of choices is large relative to the sample size.
Discussion
Our goal with this article is to show that Bayesian Thurstonian ranking models can be very easily implemented using the free software package JAGS. To this end, we have provided general-purpose and easy-to-use JAGS model files, as well as detailed information and examples as to their use.Footnote 10 It is our hope that our contribution will make Thurstone’s classic model for ranking data significantly more accessible for research.
The Thurstonian ranking model will hopefully become more widely available in statistical packages, following the increasing trend in available packages for multinomial probit models (a special case of Thurstonian ranking models in which only the first or top-ranked choice is given). MCMC algorithms for Bayesian multinomial probit models can be extended to model a full ranking of choices (Imai & van Dyk, 2005). But even with increasing availability of packages implementing the Thurstonian ranking model, we believe that there are benefits to the approach we described here using JAGS. In particular, the “open” nature of the JAGS model file allows a user to easily extend the model in ways that may not be feasible with other software. For example, the user could specify a mean structure that is nonlinear in the covariates or a specialized covariance structure. The JAGS model files we have provided may be used to develop other models as special cases of or extensions to a Thurstonian ranking model.
The focus here has been on modeling the mean structure of the latent responses. This is in contrast to others who have focused on modeling the covariance structure (e.g., Maydeu-Olivares, 1999; Maydeu-Olivares & Böckenholt, 2005).We have focused on only modeling the mean structure for simplicity, but we would argue that this is an important case for applied work, since in many applications, the effects of observed covariates as reflected in the mean structure are likely to be of interest. Furthermore, in cases where the covariance structure can be thought of as a consequence of additional latent variables, such as factor-analytic models, the covariance structure can be modeled alternatively by specifying these latent variables as unobserved covariates in the mean structure.
The data sets featured in the examples were from laboratory studies and might be considered relatively small in terms of both sample size and number of choices. We have found, however, that JAGS scales very well with both N and K, so larger data sets are not a significant computational burden. At most, we have found that the increase in computer time is approximately linear with the number of observations and choices.Footnote 11
Notes
Available as supplementary material.
Thurstone referred to what we call here U ik as the realization of a “discriminal process” to account for the randomness (from the perspective of the researcher) of the observed rank orders. A related concept is that of “random utility maximization” in economics and econometrics (Marschak, 1960; McFadden, 1974). See Böckenholt (2006) for a review.
The generalized variance can be interpreted as a measure of the amount of “total variation” reflected by a covariance matrix. It takes into account the variability and the covariability of the variables.
For simplicity of the exposition, we assume a complete ranking where all choices have been ranked. This approach, however, can be modified to accommodate partial rankings where only the first K′ choices are ranked where K′ < K.
The parameterization of the Wishart distribution is such that the prior expected value of \( {{\left( {\mathbf{C}ΣC\prime } \right)}^{-1 }} \) is \( \left( {K-1} \right){{\mathbf{R}}^{-1 }}={{\left( {\mathbf{C}C\prime } \right)}^{-1 }} \).
The value at which the generalized variance is fixed is arbitrary. We chose v = K only because this would be the value of the generalized variance if \( \mathbf{Σ} =\mathbf{I} \).
Standardization is useful here not just for interpretation, but also because centering can improve the performance of the MCMC algorithm.
Our experience has been that MCMC algorithms for Thurstonian ranking models using JAGS are very “well-behaved” in the sense that excessively large burn-in periods or samples are not generally necessary to obtain accurate results.
Posterior predictive checks evaluate the fit of a given model, although they could also be used to compare the relative fit of two or more models. Other approaches have been proposed to evaluate the relative fit of two or more Bayesian models on the basis of likelihood, such as the deviance information criterion (DIC; Spiegelhalter, Best, & Carlin, 1998). The use of DIC here is problematic for two reasons. One is that the although JAGS can compute DIC for some models, it cannot do so when using truncated latent response variables. The other is that the literature on DIC is still somewhat inconclusive on its effectiveness, particularly for more complicated models (Plummer, 2007).
Available as supplementary material.
The examples reported in this article took under a minute on a modest contemporary personal computer.
References
Agresti, A. (2002). Categorical data analysis (2nd ed.). Hoboken, NJ: Wiley.
Beggs, S., Cardell, S., & Hausman, J. (1981). Assessing the potential demand for electric cars. Journal of Econometrics, 17, 1–19.
Böckenholt, U. (2006). Thurstonian-based analyses: Past, present, and future utilities. Psychometrika, 71, 615–629.
Brady, H. E. (1989). Factor and ideal point analysis for interpersonally incomparable data. Psychometrika, 54, 181–202.
Brown, A., & Maydeu-Olivares, A. (2012). Fitting a Thurstonian IRT model to forced-choice data using Mplus. Behavior Research Methods. doi:10.3758/s13428-012-0217-x
Cable, D. M., & Judge, T. A. (1994). Pay preference and job search decisions: A person-organization fit perspective. Personnel Psychology, 47, 317–348.
Chan, W., & Bentler, P. M. (1998). Covariance structure analysis of ordinal ipsative data. Psychometrika, 63, 369–399.
Chapman, R. G., & Staelin, R. (1982). Exploiting rank ordered choice set data with the stochastic utility model. Journal of Marketing Research, 14, 288–301.
Critchlow, D. E., Flinger, M. A., & Verducci, J. S. (1991). Probability models on rankings. Journal of Mathematical Psychology, 35, 294–318.
Fischer, R., & Smith, P. B. (2003). Reward allocation and culture: A meta-analysis. Journal of Cross-Cultural Psychology, 34, 251–268.
Gelfand, A. E., & Smith, A. F. M. (1990). Sampling-based approaches to calculating marginal densities. Journal of the American Statistical Association, 85, 398–409.
Gelman, A., Meng, X. L., & Stern, H. (1996). Posterior predictive assessment of model fitness via realized discrepancies. Statistica Sinica, 6, 733–807.
Genz, A. (1992). Numerical computation of multivariate normal probabilities. Journal of Computational and Graphical Statistics, 1, 141–149.
Hausman, J. A., & Ruud, P. A. (1987). Specifying and testing econometric models for rank-ordered data. Journal of Econometrics, 34, 83–104.
Imai, K. & van Dyk, D. A. (2005). MNP: R package for fitting the multinomial probit model. Journal of Statistical Software, 14.
Kruschke, J. K. (2011). Doing Bayesian data analysis: A tutorial with R and BUGS. Burlington, MA: Academic Press.
Kuhn, K. M. (2009). Compensation as a signal of organizational culture: The effects of advertising individual or collective incentives. International Journal of Human Resource Management, 20, 1630–1644.
Kuhn, K. M., & Johnson, T. R. (2004). The effects of risk, performance basis, and response method on preferences for compensation plans. Minneapolis: Poster presented at the meeting of the Society for Judgment and Decision Making. 2004.
Kuhn, K. M., Johnson, T. R., & Miller, D. R. (in press). Applicant desirability influences reactions to discovered résumé embellishments. International Journal of Selection and Assessment.
Kuhn, K. M., & Yockey, M. D. (2003). Variable pay as a risky choice: Determinants of the relative attractiveness of incentive plans. Organizational Behavior and Human Decision Processes, 90, 323–341.
Luce, R. D. (1959). Individual choice behavior. New York: Wiley.
Lunn, D., Spiegelhalter, D., Thomas, A., & Best, N. (2009). The BUGS project: Evaluation, critique and future directions. Statistics in Medicine, 25, 3049–3067.
Marden, J. I. (1995). Analyzing and modeling rank data. London: Chapman & Hall.
Marschak, J. (1960). Binary choice constraints on random utility indictor. In K. I. Arrow, S. Karlin, & P. Suppes (Eds.), Stanford symposium on mathematical methods in the social sciences (pp. 312–329). Stanford, CA: Stanford University Press.
Maydeu-Olivares, A. (1999). Thurstonian modeling of ranking data via mean and covariance structure models. Psychometrika, 64, 325–340.
Maydeu-Olivares, A., & Böckenholt, U. (2005). Structural equation modeling of paired-comparisons and ranking data. Psychological Methods, 10, 285–304.
McFadden, D. (1974). Conditional logit analysis of qualitative choice behavior. In P. Zarembka (Ed.), Frontiers in econometrics (pp. 105–142). New York: Academic Press.
Meng, X. L. (1994). Posterior predictive p-values. The Annals of Statistics, 22, 1142–1160.
Plackett, R. L. (1975). The analysis of permutations. Applied Statistics, 24, 193–201.
Plummer, M. (2003). JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling. Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), March 20–22, Vienna, Austria.
Plummer, M. (2007). Penalized loss functions for Bayesian model comparison. Biostatistics, 9, 523–539.
Plummer, M. (2011). rjags: Bayesian graphical models using MCMC. R package version 3–5. http://CRAN.R-project.org/package=rjags
Plummer, M., Best, N., Cowles, K., & Vines, K. (2006). CODA: Convergence diagnosis and output analysis for MCMC. R News, 6, 7–11.
Poon, W. Y., & Xu, L. (2009). On the modelling and estimation of attribute rankings with ties in the Thurstonian framework. British Journal of Mathematical and Statistical Psychology, 62, 507–527.
Punj, G. N., & Staelin, R. (1978). The choice process for graduate business schools. Journal of Marketing Research, 15, 588–598.
R Development Core Team (2012). R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. http://www.R-project.org
Rubin, D. B. (1984). Bayesianly justifiable and relevant frequency calculations for the applied statistician. The Annals of Statistics, 12, 1151–1172.
Rynes, S. L., Colbert, A. E., & Brown, K. G. (2002). HR professionals’ beliefs about effective human resource practices: Correspondence between research and practice. Human Resource Management, 41, 149–174.
SAS Institute Inc. (2008). SAS/STAT 9.2 User’s Guide. Cary, NC: SAS Institute Inc.
Spiegelhalter, D. J., Best, N. G., & Carlin, B. P. (1998). Bayesian deviance, the effective number of parameters, and the comparison of arbitrarily complex models. Technical Report. Cambridge, UK: MRC Biostatistics Unit.
Tanner, M. A., & Wong, W. H. (1987). The calculation of posterior distributions by data augmentation. Journal of the American Statistical Association, 82, 528–540.
Thomas, A., O’Hara, B., Ligges, U., & Sturtz, S. (2006). Making BUGS open. R News, 6(1), 12–17.
Thurstone, L. L. (1927). A law of comparative judgment. Psychological Review, 79, 281–299.
Thurstone, L. L. (1931). Rank order as a psychological method. Journal of Experimental Psychology, 14, 187–201.
Triandis, H. C., & Gelfand, M. J. (1998). Converging measurement of horizontal and vertical individualism and collectivism. Journal of Personality and Social Psychology, 74, 118–128.
Xu, L., Poon, W. Y., & Lee, S. K. (2008). Influence analysis for the factor analysis model with ranking data. British Journal of Mathematical and Statistical Psychology, 61, 133–161.
Yao, K. G., & Böckenholt, U. (1999). Bayesian estimation of Thurstonian ranking models based on the Gibbs sampler. British Journal of Mathematical and Statistical Psychology, 52, 79–92.
Yu, P. L. H. (2000). Bayesian analysis of order-statistics models for ranking data. Psychometrika, 65, 281–299.
Author information
Authors and Affiliations
Corresponding author
Additional information
The authors thank the editor and two anonymous reviewers for helpful suggestions on a previous draft.
Appendices
Appendix 1
The following listing is the JAGS model file for a Thurstonian ranking model using the mean structure in Eq. 3, where covariates vary between, but not within, choice sets. It is named in the examples.
Appendix 2
The listing below shows the changes to the listing in Appendix 1 to create a JAGS model file for the mean structure in Eq. 4, where all covariates vary within choice sets. This file is named .
The changes are simply to replace lines 20–40 in the listing in Appendix 1 with lines 20–33 above. For a model with some covariates that vary strictly between choice sets and some that vary within choice sets, the listing in Appendix 1 can be changed by replacing lines 20–40 with the lines given below.
The full file is called . Note that to implement this model, one must specify design matrices for both sets of covariates (i.e., between and within choice sets), as well as the number of covariates of each type. As an example, consider the second example where the mean structure could be written alternatively using the mean structure in Eq. 5 as
Here, there are two covariates that vary within choice sets and no covariates that vary only between choice sets. The “intercept” parameters \( \beta_{0k}^{(b) } \) are equivalent to the parameters for the main effect for candidate. Using the model file , the data would be defined as follows:
Appendix 3
The following R function creates initial values for \( {Z_{i1 }},{Z_{i2 }},\ldots,{Z_{i,K\;-\;1 }} \) to be passed to JAGS.
Rights and permissions
About this article
Cite this article
Johnson, T.R., Kuhn, K.M. Bayesian Thurstonian models for ranking data using JAGS. Behav Res 45, 857–872 (2013). https://doi.org/10.3758/s13428-012-0300-3
Published:
Issue Date:
DOI: https://doi.org/10.3758/s13428-012-0300-3