I have a set of data with a set of preference rankings for different items for each participant. A subset of the data sample is included below:
Participant <- c("P1", "P2", "P3", "P4", "P5", "P6", "P7")
I1 <- c(1.818,2.2727,3.2727,2.4545,2.3636,2.6364,2.7272)
I2 <- c(2.6364,2.8182,3.4545,3.0909,3.3636,2.8182,2.6364)
I3 <- c(3.9191,3.8182,3.6364,2.3636,3.0909,3.8182,3.7273)
I4 <- c(2.7273,2.3636,3.3636,2.4545,1.6364,1.1818,3.3636)
Exp1data <- data.frame(Participant, I1, I2, I3, I4)
The actual data set has 20 participants and preference rankings for 12 items. I tried to use mdpref from the 'pmr' package to analyze the data using this script:
mdpref(Exp1data, rank.vector=TRUE, ndim=2)
I get the following error
Error in `[<-`(`*tmp*`, temp, (nitem + 1 + j), value = 0.164634668997455) : subscript out of bounds
and the graph doesn't look right - I'm not sure if that's linked to the same issue as the error or separate. Can anyone explain the error and how I can fix it? I'm also wondering if I've set the data up right in order to run the mdpref.
Thanks!