vignettes/blog/2020-12-22-analysing-continuous-responses-with-dexter.Rmd
2020-12-22-analysing-continuous-responses-with-dexter.Rmd
When we apply IRT to score tests, we most often use a model to map patterns of TRUE/FALSE responses onto a real-valued latent variable, the great advantage being that responses to different test forms can be represented on the same latent variable relatively easy. When all observed responses are continuous, most psychometricians will probably think first of factor analysis, structural equations and friends. Yet the world of IRT is more densely populated with continuous responses than anticipated.
To start with, computer-administered testing systems such as MathGarden readily supply us with pairs of responses and response times. It is a bit awkward to model them simultaneously, since responses are usually discrete (with few categories) and response times continuous – yet there exist a myriad of models, as the overview in Boeck and Jeon (2019) shows. To apply the same type of model to both responses and response times, Partchev and De Boeck (2012) have chosen to split the latter at the median, either person- or item-wise.
Second, item responses increasingly get scored by machine learning algorithms (e.g. Settles, T. LaFlair, and Hagiwara (2020)), whose output is typically a class membership probability. If classification is to be into two classes, the boundary is usually drawn at 0.5. One of the questions we ask ourselves in this blog is whether there can be a better way.
Within more traditional testing, there have been attempts to avoid modeling guessing behavior with ad hoc models by asking test takers about their perceived certainty that the chosen response is correct (Finetti (1965), Dirkzwager (2003)). These approaches also lead to responses that can be considered as continuous.
The Rasch model for continuous responses must have been proposed many times in more or less obvious forms. As represented, for example, in Verhelst (2019):
where is the (continuous) response to item , is the latent ability, and is an item difficulty parameter. The similarity with the conventional Rasch model is obvious, except that we are now predicting a density rather than a probability. The assumption of local independence plays just as important a role, i.e., we can multiply over items to get at the likelihood for the entire response pattern. The integral in the denominator has a closed form:
The model – we shall call it henceforth the continuous Rasch model, or CRM – is an exponential family model; like the Rasch model, it has the property that the person and item sum scores are sufficient statistics for the model parameters: the student ability, , and the item difficulty, . Models discussed in Maris and Maas (2012) and Deonovic et al. (2020) can be shown to have the same structure.
In this blog, we capitalize on new insights in Deonovic et al. (2020) and Maris (2020) to demonstrate how the CRM can be used for any type of continuous responses. We show how to plot the density, the probability function, and the expectation under the CRM, how to simulate data from it, and we explore the limits to which dexter can be used to analyze continuous responses (hint: we plan to push these limits with a new package in the near future).
These can be calculated easily in R with the following functions:
# probability density function
dCR = function(x, eta=2)
{
if (eta==0) 1
if (eta!=0) eta*exp(x*eta)/(exp(eta)-1)
}
# cumulative distribution function
pCR = function(x,eta)
{
(exp(x*eta)-1)/(exp(eta)-1)
}
# Expectation
ECR = function(eta)
{
dm = exp(eta)
dm = dm/(dm-1) - 1/eta
dm[is.na(dm)] = 0.5
dm
}
The following graph shows them for various choices of :
Note that the expected score is monotone increasing in student ability, as it should be.
Simulated data conforming to the CRM can be generated by inversion sampling. Specifically,
where . This means that if we sample from a uniform distribution, is an item response sampled from the CRM.
Sampling from the CRM can be thus done with a single line of code:
rCR = function(theta, delta)
{
eta = theta - delta
ifelse(eta!=0, (1/eta)*log(runif(nrow(X))*(exp(eta)-1)+1), runif(nrow(X)))
}
The following code produces a data set in long format with 5000 persons answering to 100 items.
n <- 100 #number of items
N <- 5000 #number of persons
delta <- runif(n, -1, 1) #difficulty
theta <- rnorm(N, 0, 1) #ability
X <- data.frame(person_id = rep(1:N, each=n),
item_id = rep(1:n, N))
X$response = rCR(theta[X$person_id], delta[X$item_id])
At the time of writing, dexter has no provision to deal with continuous responses. Instead, we use the suggestion by Deonovic et al. (2020) to analyze binary responses derived from the continuous ones. How does this work?
With an observed continuous response, define two new variables:
These are conditionally independent sources of information on ability from which the original observations can be reconstructed; that is, given , is independent of . Moreover, it is easy to show that the implied measurement model for is the Rasch model:
where the discrimination is equal to 0.5. The other variable, , is continuous and has the following distribution over the interval 0 to :
Thus, both and follow a CRM but the former has a different range for the values of the continuous response.
The proposal is to analyze the constructed dichotomous responses instead of the original continuous responses. The following code makes these responses and fits the Rasch model to them:
Let us see whether we recover the parameters:
Obviously, parameter recovery was quite good. Note that the discrimination was specified as 1, as a half is not allowed in dexter – thus, we estimate twice the abilities and difficulties that have been used to generate the data.
We can continue the process and split up into two new variables, and , then split up , and so on. In this way, we recursively transform the continuous response intto a set of conditionally independent Rasch response variables, . Deonovic et al. (2020) note that this corresponds to the dyadic expansion of ; that is,
The discrimination will halve in every step of the recursion, which means that each new item provides (four times) less information about ability than its predecessor. More specifically, the information function of the dyadic expansion of order can be defined as:
where is the information function of the -th Rasch item, with
If , we find that:
It follows that the information provided by the first binary response, , is already percent of what can be achieved under the CRM. We illustrate this with the next plot. Adding a second one would raise this to percent, a third to percent, etc. This suggests that three dichotomous items will suffice to capture most of the information in the continuous responses.
The current version of dexter does not allow different items to share the same difficulty parameter, such that data with more than one constructed item cannot be analyzed presently. However, we have some news. dexter may soon have a little brother (or sister) dedicated to the analysis of response times, and models like the CRM will find their natural place there. We have the feeling that the use of response times in practical testing is lagging behind the current state of the methodology, and does not sufficiently exploit the wealth of information they contain. A companion to dexter with the same slant towards the practitioner is probably overdue.
And there is more, much more. The insights in the Maris (2020) and Deonovic et al. (2020) papers lead far beyond traditional testing and into the world of integrated learning systems with their specific concerns of cold starts, ability trackers, and so on. But it would take many more blogs and papers to give proper idea of the full potential – so, for now, we say: Happy New Year!