Implementing conjoint analysis in LS

Mehr
3 Jahre 7 Monate her #105649 von blacknail
blacknail erstellte das Thema Implementing conjoint analysis in LS
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
Anhang:

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her - 3 Jahre 7 Monate her #105812 von blacknail
blacknail antwortete auf das Thema: Implementing conjoint analysis in LS
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>

Anhang:
Letzte Änderung: 3 Jahre 7 Monate her von blacknail.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her #105815 von holch
holch antwortete auf das Thema: Implementing conjoint analysis in LS

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... ;-)

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her - 3 Jahre 7 Monate her #105830 von blacknail
blacknail antwortete auf das Thema: Implementing conjoint analysis in LS
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
Letzte Änderung: 3 Jahre 7 Monate her von blacknail.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her #105837 von holch
holch antwortete auf das Thema: Implementing conjoint analysis in LS
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.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Folgende Benutzer bedankten sich: blacknail

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her #105843 von blacknail
blacknail antwortete auf das Thema: Implementing conjoint analysis in LS
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.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her #105934 von tpartner
tpartner antwortete auf das Thema: Implementing conjoint analysis in LS
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.
Folgende Benutzer bedankten sich: blacknail

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her - 3 Jahre 7 Monate her #106099 von blacknail
blacknail antwortete auf das Thema: Implementing conjoint analysis in LS
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

Anhang:
Letzte Änderung: 3 Jahre 7 Monate her von blacknail.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her - 3 Jahre 7 Monate her #106308 von blacknail
blacknail antwortete auf das Thema: Implementing conjoint analysis in LS
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






Anhang:
Letzte Änderung: 3 Jahre 7 Monate her von blacknail.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 7 Monate her #106352 von jelo
jelo antwortete auf das Thema: Implementing conjoint analysis in LS
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.

Bitte Anmelden um an der Konversation teilzunehmen.

Mehr
3 Jahre 6 Monate her - 3 Jahre 6 Monate her #106460 von blacknail
blacknail antwortete auf das Thema: Implementing conjoint analysis in LS
Hi jelo, concerning your question, in fact as you probably know, Sawtooth Software's SSI Web is proprietary software, and I only have a license for the MaxDiff module. That's when LimeSurvey enters the equation. Since each item is predefined to belong to a certain profile, I'm only implementing CBC in LimeSurvey for presentation purposes.

Regarding the implementation itself, I made the following changes to the layout, resulting in the image attached (cbc.png):

1. In template.css, I added the following line to the table.question class, in order to collapse the question / answer table borders:
border-collapse: collapse;

2. Then, I've right-aligned the text in the left column (first one) and set also it's right-padding to 10 pixels. Now I'll just explain how are the table's TDs and THs organized, in order to fully understand the following lines (if someone spots some wrong guessing, please feel free to correct me). Since this is an array question, I'll always have to have at least one subquestion (this is the case, with just a plain header). I believe that for that particular reason, the header in the table's first column (subquestion) is at the bottom of it, in this case in the second row (please compare to the attachment), since the first column are the headers to the subquestions, pretty much like the first row has the headers for the questions:
tdththththth
thtdtdtdtdtd

So, to right-align the text and set it's padding in the (1,1) cell, just insert this into the #limesurvey table.question thead td ID:
text-align: right;
padding-right: 10px;

3. Finally, to change the first column's color, and alternate the remaining odd / even column color's, we'll have to insert some JavaScript in the source of the question:
<script >
$(document).ready(function ()
{
    //change first column's background color and set it's text
    $("table.question thead td").css("background-color", "#FCFCFC");
    $("table.question tbody th").css("background-color", "#FCFCFC");
    $("table.question thead td").html("<h2>Nome do produto</h2> <h2>Nível de poupança</h2> <h2>Preço</h2>");
 
    // change even column's colors
    $("table.question thead th:even").css("background-color", "LightGray");
    $("table.question tbody td:even").css("background-color", "LightGray");
 
    // change odd column's colors
    $("table.question thead th:odd").css("background-color", "#F1F1F1");
    $("table.question tbody td:odd").css("background-color", "#F1F1F1");
});
</script>

Finally, I just have one question, hope someone can help me. I've tried to achieve what I did in point 3 via CSS, I was close to it, but unfortunately after some hours and a little messy code, I gave up. I was hoping to do it because I think I should use JavaScript only when needed, and prefer CSS to it whenever possible. Do you agree, or do you think this doesn't make sense. Give me your thoughts, please.


Anhang:
Letzte Änderung: 3 Jahre 6 Monate her von blacknail. Begründung: attachment missing
Folgende Benutzer bedankten sich: Jon

Bitte Anmelden um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten