Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Implementing conjoint analysis in LS

Implementing conjoint analysis in LS 7 months 6 days ago #105649

  • blacknail
  • blacknail's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 30
  • Thank you received: 1
  • Karma: 0
Hello all,

I'd like to implement a Choice-Based Conjoint (CBC) study using LimeSurvey, something that would look like this: www.sawtoothsoftware.com/images/images/s...t-cbc-golf-study.png

I understand it should be possible to implement the table with the descriptions for each answer. Of course that for me, the tricky part seems to be including the answers' own radio buttons in the table with the descriptions for each item. I also believe this can be solved with a bit of HTML /JavaScript, but since that in the "Edit question" window all I can edit is the question (and help) texts, how (or maybe better is to ask "where?") can I possibly do this? I haven't foun anything on this in the manual / forum, and I am in a kind of hurry, so the simpler the answer to this, the better.

I'm using List (radio) questions - I believe this is the more appropriated question type to my needs. By the way, I have access to Version 2.00+ Build 121017. A simple example is attached to this post.

Thanks in advance for any attention & help provided, best regards,
João Fernandes
Attachments:
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 4 weeks ago #105812

  • blacknail
  • blacknail's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 30
  • Thank you received: 1
  • Karma: 0
Hello again,

Still with the CBC survey in mind, I've started thinking on adapting the workaround for creating a MaxDiff question type ( manual.limesurvey.org/Workarounds:_Quest...axDiff_question_type ) to my needs. After searching a little more and reading more posts here in the forum, I think I can conclude you are the author of this workaround, judging by your kind answers on the threads.

My JavaScript seems to be working just fine, a simple hello world example like this works as expected:
<script type="text/javascript" charset="utf-8">
 
   alert("Test!");
 
</script>

Despite this, I'm having some trouble getting the workaround to work. When using the workaround code (replacing only the "QQ" with the question code - "Q3", in this case), the preview of the question doesn't change. i.e., the JavaScript code seems to make no effect. I've searched some other threads regarding this workaround, but I couldn't find anyone with the same problem. What can I possibly be doing wrong? I have little time left to finish this and I'm running out of options in my mind, so again, if you cane help me, I would be deeply, deeply appreciated.

Did anyone had a similar problem or have an hint on this?

Best regards,
João

P.S.: Just in case, I'll leave here the code I'm using (like I said before, it's the same from the workaround), the result is attached to this message:
<script type="text/javascript" charset="utf-8">
   $(document).ready(function(){
       maxDiff(Q3, 'You cannot select this answer twice.');
 
       function maxDiff(qID, msg) {
           // Move the cells around
           $('#question'+qID+' table.question col:eq(1)').prependTo('colgroup.col-responses');
           $('#question'+qID+' table.question thead tr:eq(0) th:eq(0)').prependTo('#question'+qID+' table.question thead tr:eq(0)');
           $('#question'+qID+' table.question tbody tr').each(function(i){
               $('td:eq(0)', this).prependTo(this);
           });
 
           // Style stuff
           $('#question'+qID+' table.question col.odd').css({ 'background-color':'transparent' });
           $('#question'+qID+' table.question tbody th').css({ 'text-align':'center' });
           $('#question'+qID+' table.question tbody tr:even td, #question'+qID+' table.question tbody tr:even th').css({ 'background-color':'#F1F1F1' });
           $('#question'+qID+' table.question tbody tr:odd td, #question'+qID+' table.question tbody tr:odd th').css({ 'background-color':'#FCFCFC' });
 
           // Prevent clicking twice in the same row
           $('#question'+qID+' input.radio').mousedown(function () {
               var clickRow = $(this).parents('tr:eq(0)');
               if ($('input.radio:checked', clickRow).length > 0) {
                   alert (msg);
                   return false;
               }
 
           });
 
           $('#question'+qID+' table.question tbody td').mousedown(function () {
               var clickRow = $(this).parents('tr:eq(0)');
               if ($('input.radio:checked', clickRow).length > 0) {
                   alert (msg);
                   return false;
               }
           });
       }
   });
</script>

maxdiff_example.png
Last Edit: 6 months 4 weeks ago by blacknail.
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 4 weeks ago #105815

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2719
  • Thank you received: 332
  • Karma: 121
After searching a little more and reading more posts here in the forum, I think I can conclude you are the author of this workaround, judging by your kind answers on the threads.
I am not sure who you are talking to... ;-)
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 4 weeks ago #105830

  • blacknail
  • blacknail's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 30
  • Thank you received: 1
  • Karma: 0
Hello holch,

Thanks for pointing that out! As you might have guessed, that phrase was posted mistakenly, so I'll just edit the original post accordingly [edit: I would, but it seems it is now impossible].

Going back to the thread's topic, do you have any suggestions so that I can put the MaxDiff workaround to finally work?

Best regards, thanks again,
João
Last Edit: 6 months 4 weeks ago by blacknail.
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 4 weeks ago #105837

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2719
  • Thank you received: 332
  • Karma: 121
Well, I am not sure what you are up to, because the MaxDiff example is quite different from your CBC example that you have posted, isn't it?

So are you going for the CBC route or for the MaxDiff route?

And I am not an expert on this, so I might not be able to help.

For the CBC part I can think of a array questions with the scale headers including custom HTML or even an image with the description.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
The following user(s) said Thank You: blacknail

Implementing conjoint analysis in LS 6 months 4 weeks ago #105843

  • blacknail
  • blacknail's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 30
  • Thank you received: 1
  • Karma: 0
I'm trying to implement a CBC analysis indeed. I've only mentioned the MaxDiff workaround because it is an example I can have theoretically working, and I wasn't seeing how to achieve the CBC design I want from the start, so I was kind of trying to adapt the MaxDiff one to what I want. Meanwhile, I'll check your suggestion, maybe it is simpler than I thought.

Best regards.
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 3 weeks ago #105934

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4210
  • Thank you received: 792
  • Karma: 360
In the workaround you need to replace "QQ" with the question ID, not the question code.

However, in 2.0+, you can simply replace it with the {QID} tag which will automatically pipe in the ID.

maxDiff({QID}, 'You cannot select this answer twice.');


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: blacknail

Implementing conjoint analysis in LS 6 months 3 weeks ago #106099

  • blacknail
  • blacknail's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 30
  • Thank you received: 1
  • Karma: 0
Thanks for your tip, tpartner, it made me finally get the MaxDiff workaround to work!

I've followed holch's suggestion, I'm now using array questions for the CBC part of the study. Attached is an example of one of the prototype questions'. My problem now is how to access via HTML /JavaScript to each answer option ("cell") of the question, make its borders visible, etc... (as you can see, I've highlighted the header on the left and one of the answer options/"cells") I just need to know how can I reference each element, so I can change them to what I need (like I've written before, I'm attempting to achieve something more-or-less like this: www.sawtoothsoftware.com/images/images/s...t-cbc-golf-study.png). Can someone give a hint on this? Maybe I've searched badly here in the forums, since I haven't found anything on this.

Best regards!
João

cbc.png
Last Edit: 6 months 3 weeks ago by blacknail.
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 2 weeks ago #106308

  • blacknail
  • blacknail's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 30
  • Thank you received: 1
  • Karma: 0
After a lot of trial & error, I eventually made some progresses. I'll post here my findings, in case someone needs this in the future.

In template.css (btw, I'm using the "sherpa" one), adding
border: 1px solid black;
in ".question td", "#limesurvey table.question" and ".repeat td" styles/IDs will produce the effects portraited in cbc1.png (attached). Adding the same line to the table.question style will add the border around the question (cbc2.png). Although I would prefer to achieve this in a more tidy way (just creating a class, something like
.cbc { border: 1px solid black; }
), I think this would only be achievable in conjuction with some JavaScript (wouldn't it?). Now I'll just play a little more and style it to my needs, I need to add text or (an image) to the header, and alternate the columns' colours.

Best regards,
João



cbc1.png



cbc2.png
Last Edit: 6 months 2 weeks ago by blacknail.
The administrator has disabled public write access.

Implementing conjoint analysis in LS 6 months 2 weeks ago #106352

  • jelo
  • jelo's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 467
  • Thank you received: 52
  • Karma: 16
A freeformat question type is really missing. A workaround via CSS template and javascript tweaks is not robust enough to survive the next upgrades or a copied survey.

I really wonder what kind of CBC study will be conducted. Is the software not available? Or is there a problem to integrate the perl program generated by the software?

To conduct a CBC with Limesurvey is a lot weaker in statistical terms than doing it with the program you mentioned above. Just curious. Perhaps you can find the time to post some afterthoughts when you have finished your study.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.171 seconds
Donation Image