Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

MaxDiff query

  • Matadeleo
  • Matadeleo's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 6 months ago #175392 by Matadeleo
MaxDiff query was created by Matadeleo
Hi guys, I was looking at the Max Diff workaround and it seems it is possible to select the same answer on it - see below



Anyone know a fix for this?

Also - has anyone managed to make a true max diff work in LimeSurvey, complete with sets/prohibitions etc??
Attachments:
The topic has been locked.
More
5 years 6 months ago #175393 by jelo
Replied by jelo on topic MaxDiff query

Matadeleo wrote: Hi guys, I was looking at the Max Diff workaround

What workaround? The manual has no workaround for LS3 (but for no longer maintained versions of LimeSurvey).
manual.limesurvey.org/Workarounds:_Quest...axDiff_question_type

Matadeleo wrote: Also - has anyone managed to make a true max diff work in LimeSurvey, complete with sets/prohibitions etc??

Never seen one. But sets/prohibitions would be still have to be set question by question. I would never do that in LimeSurvey. Would cost to much time. The risk to have a bug in the survey design would be too high. At least if you use it in a business project. Academic research might have longer project-times. But you can get MaxDiff capable tools (SaaS) for 1,800 USD per year. And if you're doing a lot of MaxDiff you mostly end up with more costly solutions anyway (10,000 USD per year).

A question theme or workaround for LS 3 should be possible. Design of experiment tools are not planned for LS3/LS4. And I don't see a thirdparty developing and offering such tools. The customer base seems to be small and the price would be high.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • Matadeleo
  • Matadeleo's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 6 months ago - 5 years 6 months ago #175395 by Matadeleo
Replied by Matadeleo on topic MaxDiff query
Thanks for the reply - I believe the workaround will still work for LS3 but I have a version running 2.5 also.

I don't have any budget for a paid tool, so I'm looking into any options available to me. Any solution in LimeSurvey would likely require a level of JS skill which I don't have.

One option I'm considering is to build a MaxDiff in PHP, split the survey into 2 and then attempt to pass ID's and data between them all. Passing so much data via URI makes me nervous though.
Last edit: 5 years 6 months ago by Matadeleo.
The topic has been locked.
More
5 years 6 months ago #175397 by jelo
Replied by jelo on topic MaxDiff query

Matadeleo wrote: One option I'm considering is to build a MaxDiff in PHP, split the survey into 2 and then attempt to pass ID's and data between them all. Passing so much data via URI makes me nervous though.

Sounds like more work in the end.

MaxDiff is a lot more easier than e.g. Conjoint.


A MaxDiff question type / question for LimeSurvey 3 could be useful for others too.
I haven't test the workarounds in LS3. Would be surprised if they work.
But let's say a question theme in LS3 will be doable.

The question type isn't offering subquestion relevance. So prohibitions are not easily done inside LS.
I personally try to prevent prohibitions at all costs. It will hurt the data quality badly. Depends a bit on the analysis, but prohibitions can be prevented most of the times.

The next step would be to plan the experiment.
How many items are in your MaxDiff experiment?
How many items per set are suitable?
How many respondents are there?

That way you get a set (n pages of tasks).
You may now offer 2-3 versions of a set (different layout) to prevent effects ("e.g. always choose first item).
Via a random number you expose version 1,2 or 3.
The biggest issue with LimeSurvey is copying all the stuff. And correcting things afterwards (e.g adding an item).
Perparing questions via a spreadsheet might speed up things a bit.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • Matadeleo
  • Matadeleo's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 6 months ago #175399 by Matadeleo
Replied by Matadeleo on topic MaxDiff query

The question type isn't offering subquestion relevance. So prohibitions are not easily done inside LS.


I've been asked to do prohibitions before but luckily in this case, there are none required. However, the question type is Array by Column, which does allow using subquestion relevance.

How many items are in your MaxDiff experiment? - 16
How many items per set are suitable? - Not sure on this, I planned to use 4 for simplicity
How many respondents are there? I believe the target is 200 respondents

I've imported my template and max diff sample question to LS3.8.0, looks same as 2.5.



That way you get a set (n pages of tasks).
You may now offer 2-3 versions of a set (different layout) to prevent effects ("e.g. always choose first item).
Via a random number you expose version 1,2 or 3.


I had planned to create a hidden equation question with
Code:
{rand(1,X)}
then base the others on this random number.
Attachments:
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175407 by tpartner
Replied by tpartner on topic MaxDiff query
In 3.x, to prevent clicking two radios in the same row, use the code below in custom.js. I have updated
the workaround
accordingly.

Code:
function maxDiff(qID, randomize) {
 
  // Identify some elements
  var thisQuestion = $('#question'+qID);
  var thisTable = $('table.subquestion-list:eq(0)', thisQuestion);
 
  // Assign a new question class
  $(thisQuestion).addClass('max-diff-array');
 
  // Move the columns
  $('thead tr:eq(0)', thisTable).prepend($('thead tr:eq(0) th:eq(1)', thisTable));
  $('tr.answers-list', thisTable).each(function(i){
    $('td.answer-item:eq(0)', this).prependTo(this);
  });
 
  // Random rows
  if(randomize) {
    var rowsArr = [];
    $('tr.answers-list', thisTable).each(function(i){
      $(this).attr('data-index', i);
      rowsArr.push(i);
    });
    shuffleArray(rowsArr);
    $(rowsArr).each(function(i){
      $('tbody', thisTable).append($('tr[data-index="'+this+'"]', thisTable));
    });
  }
 
  // Prevent clicking twice in the same row
  $('input:radio', thisQuestion).on('click', function () {
 
    $('input:radio', thisQuestion).prop('disabled', false);
    $('input:radio:checked', thisQuestion).each(function(i) {
      var thisRow = $(this).closest('tr.answers-list');
      $('input:radio', thisRow).not(this).prop('disabled', true);
    });
  });  
 
  // Fix up the row classes
  var rowClass = 1;
  $('tr.answers-list', thisTable).each(function(i) {
    $(this).addClass('array'+(2-(i%2)));
  });
}
 
function shuffleArray(array) {
  for (var i = array.length - 1; i > 0; i--) {
    var j = Math.floor(Math.random() * (i + 1));
    var temp = array[i];
    array[i] = array[j];
    array[j] = temp;
  }
  return array;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: zserban
The topic has been locked.
  • Matadeleo
  • Matadeleo's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
5 years 6 months ago #175409 by Matadeleo
Replied by Matadeleo on topic MaxDiff query
Thanks tpartner, I have tested it (Version 3.8.0+180522 & Version 3.13.2+180709 if that helps at all) and it's working well for me.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #175430 by DenisChenu
Replied by DenisChenu on topic MaxDiff query
It's a array by columns question type ?

If yes : maybe you can add unique(self) in manual.limesurvey.org/Question_type_-_Ar...28em_validation_q.29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
More
5 years 6 months ago #175445 by jelo
Replied by jelo on topic MaxDiff query

DenisChenu wrote: It's a array by columns question type ?

Yes. And in LS 3 the validation is working with unique(self). The older LS version had no validation on that question type.

But the different layout cannot be created via pipe | at the moment. So the workaround with JS seems to be still needed. The randomization is nice too.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago - 5 years 6 months ago #175449 by DenisChenu
Replied by DenisChenu on topic MaxDiff query
Need a question template :)

and add 'expression_validation' in question template + plugin attribute : here it's simple : it can be 'unique(self)', but need to allow it via twig file too for example (for question template)

[edit]
Maybe need 'question_validation' : usage of self, etc …
AND
'subquestion_validation' : usage of this.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 6 months ago by DenisChenu.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose