I am trying to do a ddm analysis with the choiceRT_ddm function in R. My dataframe (called DDM) is composed of three columns (subjID, choice, RT) with 4320 observations for 54 participants (80 obs/participants). Some observations are missing (13 to be precise).
When I try with the following code:
output <- choiceRT_ddm(data = DDM, niter = 2000,
nwarmup = 1000, nchain = 4, ncore = 4)
I have the following warning and error:
The following lines of the data file have NAs in necessary columns: 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521 (total 13 lines) These rows are removed prior to modeling the data. Error in RTu[i, 1:Nu[i]] <- subj_data$rt[subj_data$choice == 2] : the number of objects that must be replaced is not a multiple of the size of the replacement.
When I am trying to delete the NAs before, the same is happening:
DDM2 <- na.omit(DDM)
output <- choiceRT_ddm(data = DDM2, niter = 2000,
nwarmup = 1000, nchain = 4, ncore = 4)
Error in RTu[i, 1:Nu[i]] <- subj_data$rt[subj_data$choice == 2] : the number of objects that must be replaced is not a multiple of the size of the replacement.
I have verified: my R version, my Rstan version and my packages version are recent enough, thus the problem is not related to that.
Could it be because I don't have the same number of responses for each participant?
Thank you so much in advance.