Thanks as always to Kit Baum, a new command logistic_scores is now available from SSC. Stata 9 is required.
It's all about generating logistic scores, a transformation of graded ordinal variables best publicised in Frederick Mosteller and John W. Tukey's book Data Analysis and Regression (1977). The idea can also be seen in a long paper by Tukey written in 1961 but not published until 1986.
This is a slow-running project, I posted some Mata code on Statalist in 2007, got around to writing a command in 2015, and tweaked it in 2022, and finally wrote up a help file this month.
The definitions and even the derivation of the recipe are all in the help file and an ancillary document and its references.
Take any example of such a variable. Many Stata users will know that the auto dataset includes rep78 -- which is repair record 1978 on a five-point scale with numeric values 1 to 5.
Here is a graph to show what this command produces for that variable.

And here as a second example are some anonymous or at least unexplained data from Mosteller and Tukey, included so that I could check that the command produced the same results.

People not interested in this command might nevertheless be interested in the small graphical tricks for producing such displays. Complete code is included in the help file.
In two sentences, perhaps not intelligible until you've read the longer accounts: Cumulative probabilities define breakpoints between slices of an underlying distribution taken be standard logistic. Scores are then returned as the centres of gravity of those slices.
How far the original variables say something about whatever is being graded, or something about the people doing the grading, is a topic for discussion. Either way or both ways, they are the data we have.
Many people reading this will have been exposed to a classification of measurement scales or levels into nominal, ordinal, interval, and ratio, That classification was revisited repeatedly in articles (and a book) by the psychologist Stanley Smith Stevens from 1946 to 1975 (the last publication was posthumous). The way it is cited varies across the entire range from purely descriptive to strongly prescriptive -- or even strongly proscriptive.
One common argument runs that for variables like this with values 1 2 3 4 5 are, as said, just ordinal grades conventionally reported as successive integers, but not otherwise to be taken literally, which means numerically. We don't have licence, the argument runs, to treat intervals such as 2 minus 1 or 3 minus 2 as equal or even as meaning anything in particular. So the scale lacks the property that intervals can be taken literally. Still less can we take it that 2 is twice 1, 4 is twice 2, and so on. Ratios can be formed, but not legitimately. So far, so correct, but does that affect what we can do (should do) statistically? Have you heard the line that only medians make sense for such variables, and that means can't be used validly? Do you agree in principle? In your statistical practice?
Despite this caution much of the practice of data analysis ignores or even defies any purism about measurement scales. summarize (for example) will without a murmur of discontent take such a variable and calculate not just means, but also SD, skewness and kurtosis, and so forth. Is that valid or useful? Stata's attitude, as with most comparable software, is that yours is the choice to make, and yours is the responsibility. More broadly, any number of websites post average review scores, not to mention what many universities do with student grades or marks.
On a less abstract level: How do people use such variables? Perhaps the easiest decision to make is to treat a variable like rep78 through a set of indicator variables when it is regarded as a predictor or covariate. That answers, or avoids, qualms about measurement scale. It is letting the data show how the variable works in practice. Depending on results, researchers might leave the variable as indicators, to be emboldened to replace it with the data as it came, to use a quadratic instead, and so on.
Logistic scores are also a variant on the letting the data show how the variable works in practice. The easy part to buy is that cumulative probabilities are well defined if anything is with such a variable. The last cumulative probability is identically 1. Otherwise we have (usually) one fewer cumulative probability than categories acting as breakpoints between slices of a distribution.
More arbitrary is positing an underlying logistic distribution. The argument for that pivots on simplicity and tractability: the scores for each slice fall out as a result of a moderately simple calculation, as now done for you by this command.
I wouldn't usually use logistic scores as a predictor without checking whether alternatives, notably indicator variables, give broadly similar results.
What about logistic scores as an outcome? Recently I heard of a variable like rep78 being used as an outcome in multiple regression as it came. I had to suppress as commentary what I suppose is a fairly standard line that you should be trying something quite different instead, say ordinal logit -- or ordinal probit, or any number of alternative ordinal models from categorical data analysis. I readily confess to a chicken and egg reluctance to get involved with these models. That is, you need to use them routinely before you can wrap your head around which one to use, what to look for, and how to explain them. So, although there is always a need to check whether linearity works well enough I don't want to write off that kind of application, and now have an alternative to suggest.
It's all about generating logistic scores, a transformation of graded ordinal variables best publicised in Frederick Mosteller and John W. Tukey's book Data Analysis and Regression (1977). The idea can also be seen in a long paper by Tukey written in 1961 but not published until 1986.
This is a slow-running project, I posted some Mata code on Statalist in 2007, got around to writing a command in 2015, and tweaked it in 2022, and finally wrote up a help file this month.
The definitions and even the derivation of the recipe are all in the help file and an ancillary document and its references.
Take any example of such a variable. Many Stata users will know that the auto dataset includes rep78 -- which is repair record 1978 on a five-point scale with numeric values 1 to 5.
Here is a graph to show what this command produces for that variable.
And here as a second example are some anonymous or at least unexplained data from Mosteller and Tukey, included so that I could check that the command produced the same results.
People not interested in this command might nevertheless be interested in the small graphical tricks for producing such displays. Complete code is included in the help file.
In two sentences, perhaps not intelligible until you've read the longer accounts: Cumulative probabilities define breakpoints between slices of an underlying distribution taken be standard logistic. Scores are then returned as the centres of gravity of those slices.
How far the original variables say something about whatever is being graded, or something about the people doing the grading, is a topic for discussion. Either way or both ways, they are the data we have.
Many people reading this will have been exposed to a classification of measurement scales or levels into nominal, ordinal, interval, and ratio, That classification was revisited repeatedly in articles (and a book) by the psychologist Stanley Smith Stevens from 1946 to 1975 (the last publication was posthumous). The way it is cited varies across the entire range from purely descriptive to strongly prescriptive -- or even strongly proscriptive.
One common argument runs that for variables like this with values 1 2 3 4 5 are, as said, just ordinal grades conventionally reported as successive integers, but not otherwise to be taken literally, which means numerically. We don't have licence, the argument runs, to treat intervals such as 2 minus 1 or 3 minus 2 as equal or even as meaning anything in particular. So the scale lacks the property that intervals can be taken literally. Still less can we take it that 2 is twice 1, 4 is twice 2, and so on. Ratios can be formed, but not legitimately. So far, so correct, but does that affect what we can do (should do) statistically? Have you heard the line that only medians make sense for such variables, and that means can't be used validly? Do you agree in principle? In your statistical practice?
Despite this caution much of the practice of data analysis ignores or even defies any purism about measurement scales. summarize (for example) will without a murmur of discontent take such a variable and calculate not just means, but also SD, skewness and kurtosis, and so forth. Is that valid or useful? Stata's attitude, as with most comparable software, is that yours is the choice to make, and yours is the responsibility. More broadly, any number of websites post average review scores, not to mention what many universities do with student grades or marks.
On a less abstract level: How do people use such variables? Perhaps the easiest decision to make is to treat a variable like rep78 through a set of indicator variables when it is regarded as a predictor or covariate. That answers, or avoids, qualms about measurement scale. It is letting the data show how the variable works in practice. Depending on results, researchers might leave the variable as indicators, to be emboldened to replace it with the data as it came, to use a quadratic instead, and so on.
Logistic scores are also a variant on the letting the data show how the variable works in practice. The easy part to buy is that cumulative probabilities are well defined if anything is with such a variable. The last cumulative probability is identically 1. Otherwise we have (usually) one fewer cumulative probability than categories acting as breakpoints between slices of a distribution.
More arbitrary is positing an underlying logistic distribution. The argument for that pivots on simplicity and tractability: the scores for each slice fall out as a result of a moderately simple calculation, as now done for you by this command.
I wouldn't usually use logistic scores as a predictor without checking whether alternatives, notably indicator variables, give broadly similar results.
What about logistic scores as an outcome? Recently I heard of a variable like rep78 being used as an outcome in multiple regression as it came. I had to suppress as commentary what I suppose is a fairly standard line that you should be trying something quite different instead, say ordinal logit -- or ordinal probit, or any number of alternative ordinal models from categorical data analysis. I readily confess to a chicken and egg reluctance to get involved with these models. That is, you need to use them routinely before you can wrap your head around which one to use, what to look for, and how to explain them. So, although there is always a need to check whether linearity works well enough I don't want to write off that kind of application, and now have an alternative to suggest.

Comment