markhwhiteii / bwsTools

Tools for Case 1 Best-Worst Scaling (MaxDiff) Designs
https://osf.io/wb4c3/
Other
13 stars 2 forks source link

get_checks() error in e_bayesscoring #40

Closed annaymj closed 3 years ago

annaymj commented 3 years ago

image Hi, The newly added get_checks() function is causing the following error. Please advice the way to work around it.

Error in get_checks(data, id, block, item, choice): Each pairwise comparison between items must occur the same amount of times for each id. Traceback:

  1. bwsTools::e_bayescoring(dat1, "pid", "block", "label", "resp")
  2. get_checks(data, id, block, item, choice)
  3. stop("Each pairwise comparison between items must occur the same amount\n of times for each id.")

Thanks!

annaymj commented 3 years ago

I copied your e_bayesscoring function and commented out get_checks(), it worked fine.

markhwhiteii commented 3 years ago

The empirical Bayes method (and the analytical estimation of the multinomial logit model that it's derived from) assumes that data come from a balanced incomplete block design (BIBD). (See the paper here: https://osf.io/xftvq/).

What this error is saying is that your data do not come from a BIBD: Each pairwise comparison between items does not occur the same amount of times.

I'm currently working on a paper to see how robust these estimations are to violating a BIBD, but for now I would suggest using the eloscoring function if your data do not come from a balanced design.