I am trying to use the eRm Library to do a Rasch analysis. Our likert scale questionnaire does not have the full range of values (sometimes people have answered 1-3 or 1-4, or 2-5. Therefore, I receive this error message: ("RSM can not be computed since number of categories are not the same for each item!\n")

I am somewhat novice to R, and I am sorry to bother you, and appreciate any response or referral to an R blog/community that may be useful to post these questions.

**From:** Stuart Gardiner

**Date:** Wednesday, September 4, 2019 at 11:10 AM

**To:** Steven Mansberger

**Subject:** RE: Rasch analysis

Well I can tell you the problem, but not the solution…

Some of the columns in that dataset don’t have any datapoints with value 1. The RSM code resets each column to have a minimum value of zero; so you end up with most of the columns ranging from 0 to 4, but some of them range from 0 to 3. Hence, the number of categories differs for some of the items. If you run the RSM on a dataset that only contains columns that contain all five possible answers, then it works.

I don’t know enough about the rating scale model to know the best solution. One thought I’d had was to create a ‘dummy’ respondent, a new row that just contains an answer of 1 for every scale; equivalent to having a fake person who just hated everything. Since that person doesn’t provide any information that discriminates between the scales in any way, I think it might not affect the estimates. But I’m not sure, and I wouldn’t want to do that without checking with a more experienced Rasch model expert first.

**From:** Steve Mansberger

**Sent:** Tuesday, September 3, 2019 10:05 PM

**To:** Stuart Gardiner

**Subject:** Rasch analysis

HI Stuart,

I am trying to run a Rasch analysis using eRm R library (https://cran.r-project.org/web/packages/eRm/eRm.pdf). I am using the function RSM to a GTCAT dataset from U Michigan. res_rm_1 <- RSM(statements)

I get this error: “Error in datprep_RSM(X, W, sum0) :

RSM can not be computed since number of categories are not the same for each item!”

Here is the code to create the error message:

*#... X: data matrix with response categories to be converted into 0/1 matrix*

max.it <- apply(X,2,max,na.rm= **TRUE** ) *#RSM check for equal number of categories*

if (length(table(max.it)) > 1) stop("RSM can not be computed since number of categories are not the same for each item!\n")

Do I need to remove the NA? Or do something else?