Nominal Model - Data Matrix

47 views
Skip to first unread message

Leigh Allison

unread,
Dec 1, 2017, 9:34:50 PM12/1/17
to mirt-package
Good Evening!

I am attempting to analyze a set of categorical variables with the nominal model. I have structured the data into a single matrix with the columns being dummy variables (1 variable for each category of each question) coded as (0 or 1) and my responses patterns are the rows. However, in most of the literature on modeling dummy variables, it talks about removing or defining a reference variable before analyzing the data. Does the nominal method do this? If so how does it specify them for each question? 

Thank you!
Leigh 

Phil Chalmers

unread,
Dec 2, 2017, 8:55:31 AM12/2/17
to Leigh Allison, mirt-package
Hi Leigh,

This sounds like a bit of a strange setup for the nominal response model. The setup for mirt is to assume that each column represents a single item, so you should code the responses numerically as 1,2,3,...K, and assign this item 'nominal' in the itemtype input to mirt(). For the nominal model the order of the numbers does not indicate anything interested because they don't matter, so however you choose to do this is arbitrary. HTH.

Phil

--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leigh Allison

unread,
Feb 19, 2018, 6:32:39 AM2/19/18
to mirt-package
Thank you Phil! That was very helpful. I was attempting to aggregate my data, which is why the setup of the dataframe was odd.  I have reverted back to the traditional setup that you described below. However, now I am getting a summary error.

Error in Summary.factor(2813L, na.rm = FALSE) : 
  ‘sum’ not meaningful for factors

I have checked that all my input data are numeric; there are however some missing items coded as NA. Do you have any suggestions on what else could be causing the error?

Thanks, 
Leigh 

Phil

To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package...@googlegroups.com.

Phil Chalmers

unread,
Feb 19, 2018, 8:32:16 AM2/19/18
to Leigh Allison, mirt-package
Hi Leigh,

Can you demonstrate how this error arose? I've never seen it before. Cheers.

Phil

To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.

Leigh Allison

unread,
Feb 19, 2018, 8:45:39 AM2/19/18
to mirt-package
Hi Phil, 

Absolutely! This is the code that I used.  The dataframe is 85,264 observations with 213 variables and one weight variable. 

Individual_Data_Final_Numeric_NoCountry <- read.csv("Individual_Data_Nominal.csv")

Indiv_Model <- mirt(Individual_Data_Final_Numeric_NoCountry, 3, itemtype = "nominal", 
                    survey.weights = Individual_Data_Final$V258.x)

Item re-scored so that all values are within a distance of 1

Error in Summary.factor(2813L, na.rm = FALSE) : 
  ‘sum’ not meaningful for factors

I'm happy to send the data and code if you'd like to see it as well. 

Thank you for the help, 
Leigh 
Reply all
Reply to author
Forward
0 new messages