I am reading in data from an SPSS .sav file on R (I do not have access to the CSV or XLSX file). I am trying to do analyses with mirt. However, the data type is "list", and I cannot get it to change to "integer" or "numeric". There is one column with text and the rest are 0s and 1s. However, I have tried this on a subset of the data which contains only 0s and 1s and have had the same issue. I get this error message when I read in the data:
Warning messages:
1: Values in accuracy
are not uniquely identified; output will contain list-cols.
I have tried the as.data.frame command, the data.frame command, and the as.numeric command, but every time I call "typeof" it still tells me "list".
Can anyone tell me how to convert these data to integer or numeric? Thanks in advance!
EDIT: 1 Here is an image of the data.
And the structure from the "dput" call:
structure(list(Username = c("lga_tso19", "lga_tso2", "lga_tso20",
"lga_tso21", "lga_tso22", "lga_tso24", "lga_tso26", "lga_tso27"
), NEO_C_Q01 = structure(c(5, 3, 4, 4, 5, 4, 5, 5), label = "Always prepared", labels = c(Very inaccurate
= 1,
Moderately inaccurate
= 2, Neither accurate nor inaccurate
= 3,
Moderately accurate
= 4, Very accurate
= 5), class = "haven_labelled"), structure(list(77
= list(structure(0, label = "User Respond Correctly?", labels = c(No = 0,
Yes = 1), class = "haven_labelled"), structure(1, label = "User Respond Correctly?", labels = c(No = 0,
Yes = 1), class = "haven_labelled"), structure(0, label = "User Respond Correctly?", labels = c(No = 0,
Yes = 1), class = "haven_labelled"), structure(0, label = "User Respond Correctly?", labels = c(No = 0,
Yes = 1), class = "haven_labelled"))
So far, I have attempted unlist(data), as.data.frame(data), data.frame(data), and write.csv(data). When I do unlist() and then typeof() it changes the data to "double", and when I try to run the following on a subset of this data: 2PL<-mirt(baggage, "2PL")
I get this message:
Error in model$x[i, "Type"] : subscript out of bounds In addition: Warning message: In cbind(model$x, OptionalGroups = "") : number of rows of result is not a multiple of vector length (arg 2)