WrightMap and TAM - Example continued...
As a follow up on the previous post on integrating the TAM and WrightMap packages, we received a message from one of the TAM developers, Alexander Robitzsch, suggesting that it is possible to generate the Wright Map directly from the MML estimated distribution (instead of using the WLE estimates used in the previous post).
Let’s start with the same setup:
library(TAM) library(WrightMap) data( sim.rasch ) str( sim.rasch ) dat <- sim.rasch # Run Rasch Model mod1 <- tam.mml( dat ) summary( mod1 ) `</pre> After estimating the Rasch model in our data, we can get the item parameters directly from our model object: <pre>`difficulties <- tam.threshold( mod1 ) `</pre> Now, for the new part, Alexander has sent us this snippet to recover the estimated person distribution: <pre>`uni.proficiency <- rep( mod1$theta[,1] , round( mod1$pi.k * mod1$ic$n) ) `</pre> This extracts the ability distribution node locations as a vector, and then repeats each entry in the vector a specific number of times, according to the weight assigned that location in the distribution. This results in a vector of abilities that can be used to plot that distribution on `wrightMap`: <pre>`wrightMap( thetas = uni.proficiency, thresholds = mod1$xsi[,1], label.items.rows = 3)
This final Wright Map shows the distribution based on the nodes and weights estimated directly as part of the marginal maximum likelihood estimation, without needing to resort to generating person estimates on a separate step.












