Welcome to the LimeSurvey Community Forum

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

Choice Based Max-Diff Design

More
1 year 5 months ago #258688 by Joffm
Replied by Joffm on topic Choice Based Max-Diff Design
Sorry, I did not understand fully.

Send the lss export.

then store the code "1" for the hid1 as a option "1"(Selected as code 1) then similarly for code "2" contain in Set_1 then it store the code "2" and for 3 and so on upto code 8

As I showed before. In one question of type "equation" to set your "hit" variables.
{hid1_1=if(strpos(join('#',Set_1),'1')>0,"Y","")}
{hid1_2=if(strpos(join('#',Set_1),'2')>0,"Y","")}
{hid1_3=if(strpos(join('#',Set_1),'3')>0,"Y","")}
...
​​​​​​​{hid2_1=if(strpos(join('#',Set_2),'1')>0,"Y","")}
​​​​​​​...


And in my opinion this step to create new variables (hid1 to hid6) is not necessary.
What for? You have all information already in variables "Set_x". 

I have no idea what you want to do.

Then for variable hid2 it filter form Set_2 then for variable hid3 it filter form Set_3 and so on

Where and when do you want to do this?
You have your model, you show the 6 sets of each version.

And now?

Again. Send your lss export.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 5 months ago #258725 by Joffm
Replied by Joffm on topic Choice Based Max-Diff Design
1. In your other post I wrote that this does not work in array by columns.
2. I do not see any necessity.
You have a working solution, you have a solution for easy analysis.

Now I am out regarding your maxdiff.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 5 months ago #258801 by Joffm
Replied by Joffm on topic Choice Based Max-Diff Design

I just look for the best way to implemented the max-diff design
I think the below are best for me

This is not the design of the maxdiff.
These are the equations to restructure your results.

If you run this survey
 

File Attachment:

File Name: limesurvey...25_J.lss
File Size:134.25 KB


you get the following data (export to Excel)
Here displayed only the first two sets to explain, what you see
 
1. Set 1:
As you see the first respondent selected item 1 as "most" and item 2 as "least"
The first Set was "7162".
So the respondent selected object 7 as "most" and object 1 as "least".
And exactly this is stored in "RCont1_1" and "RCont1_2"

The second respondent also selected item 1 as "most" and item 2 as "least"
But here according to your model the set was "2543".
So the respondent selected object 2 as "most" and object 5 as "least".
And exactly this is stored in "RCont1_1" and "RCont1_2"

Analogue for the other sets.
2. Set 2:
As you see the first respondent selected item 2 as "most" and item 3 as "least"
The first Set was "3458".
So the respondent selected object 4 as "most" and object 5 as "least".
And exactly this is stored in "RCont2_1" and "RCont2_2"

The second respondent also selected item 2 as "most" and item 3 as "least"
But here according to your model the set was "6178".
So the respondent selected object 1 as "most" and object 7 as "least".
And exactly this is stored in "RCont1_1" and "RCont1_2"

I really do not know what else do you want.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 5 months ago #259138 by rajkumar_dms
Hi Joffm,

Thank you so much for your help

Can we random the order of Answer option in this design and i had tried the the random order on but seems not random the Answer options

Please Log in to join the conversation.

More
1 year 5 months ago #259154 by Joffm
Replied by Joffm on topic Choice Based Max-Diff Design
At the end of the script you will find this option.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 5 months ago #259158 by rajkumar_dms
Hi Joffm,
Thanks for reply

I already Yes the Random Order option but seems it's doesn't work

Please Log in to join the conversation.

More
1 year 5 months ago #259189 by rajkumar_dms
Hi Team,

Anyone can you help on this

Unable to rotate the answer option in Max-Diff design i have already YES the random order

Please Log in to join the conversation.

More
1 year 5 months ago #259194 by tpartner
As indicated in the code comments, you need to "Set the second parameter to true for randomized rows", not set to "Yes".

Code:
maxDiff({QID}, true);

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: rajkumar_dms

Please Log in to join the conversation.

More
1 year 4 months ago #259762 by rajkumar_dms
Hi,

Can you show below image in the mobile screen

Please Log in to join the conversation.

More
1 year 4 months ago - 1 year 4 months ago #259787 by tpartner
If using LS 6.x and you want to disable the stacked table view of the array-by-column on mobile devices...

 

1) Place this in your custom.js file.

Code:
function maxDiff(qID, randomize, disableMobileView) {
 
        // 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');
 
        // Disable the mobile table view
        if(disableMobileView) {
            $(thisTable).removeClass('ls-answers').addClass('disable-mobile-view');
        }
 
        // 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;
    }

2) Place this in your custom.css file.

Code:
.max-diff-array tbody th.answertext { 
    text-align: center;
    font-weight: normal;
}
 
.max-diff-array table.disable-mobile-view > tbody > tr > td {
    vertical-align: middle;
}
 
.max-diff-array table.disable-mobile-view tbody td {
    text-align: center;
}

3) Place this in the question source. Note the third parameter set to true.

Code:
<script type="text/javascript" data-author="Tony Partner">
 
    $(document).on('ready pjax:scriptcomplete',function(){
        // Call the maxDiff() function
        // Set the second parameter to true for randomized rows
        // Set the third parameter to true to disable the LS mobile table view
        maxDiff({QID}, true, true);
    });
</script>

 

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 4 months ago by tpartner.
The following user(s) said Thank You: Joffm

Please Log in to join the conversation.

More
1 year 4 months ago #259810 by rajkumar_dms
Hi,

We had change the same but it show break type of screen

Please Log in to join the conversation.

More
1 year 4 months ago - 1 year 4 months ago #259811 by tpartner
Sorry, I don't know what you are doing wrong - it works fine for me in LimeSurvey 6.x with all browsers.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 4 months ago by tpartner.

Please Log in to join the conversation.

More
1 year 4 months ago #259812 by rajkumar_dms
those things i have added in themes editor custom.css & custom.js file and last one paste in question source
I have attached the same screenshot

I have made the correctly but not working properly and is there is any other way we can fix them

Please Log in to join the conversation.

More
1 year 4 months ago #259816 by tpartner
Can you activate a test survey and give a link here?

Cheers,
Tony Partner

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

Please Log in to join the conversation.

More
1 year 4 months ago #259819 by rajkumar_dms
Here it is the link
datamatrixs.limesurvey.net/342796?lang=en

Also i need the same for all type of matrix question like 5 point ,arry etc

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose