0 votes
in SoSci Survey (English) by s246912 (125 points)

Hello, already thank your for you time.

I created a survey where people have to rate 11 concepts according to how they know them.

Question 1) how well do you know these concepts (scale from 1 to 5)
Question 2) How similar are hese concepts? (selection of max 4 concepts they know from question 1, only concepts rated before >=3)
Question 3) How well are different items relevant in the definition of these concepts (selection of 3 concepts from question 2)

Is it possible to create a code that distributes more evenly the different concepts in question 2 and 3? In question 2 we select max 4 concepts and in question 3 max 3 concepts, I would like to prioritize the concepts less known by the overall participants (if concept 1 has been rated 100 times in question 2 and 3, I need the programm to show the participant the other concept he knows that have been rated less, like concept 2 rated 30 times overall)
--> to decrease the difference in frequency

I need to count how many times the concepts have been rated in question 2 and 3, and then prioritize the ones that are only rated a few times (get more data for them).

Here is the code we have for question 2:

$known = getItems('M001', 'min', 3);  // determine relevant items
$number = count($known);
shuffle($known); // shuffle list
debug($known);
registerVariable($known); 
// define questions regarding items
$questions = array(
  1 => 'M002',
  2 => 'M003',
  3 => 'M004',
  4 => 'M005',
  5 => 'M006',
  6 => 'M007', 
  7 => 'M008',
  8 => 'M009',
  9 => 'M010',
  10 => 'M011',
);

$number = count($known); // this many elements can be asked
debug($number);
registerVariable($number); 

if ($number == 0 or $number == 1) {
  goToPage('next'); // None used? Then continue!
}

if ($number > 4) {
  $number = 4; // carry out a maximum of four concepts
}

$chosen = array_slice($known, 0, $number);
debug($known);
debug($chosen);

for ($i=0; $i<$number; $i++) {
  // Create internal variable ID from question ID plus index
  $id = id('M024', $i + 1);
  // Save the value from the array here
  put($id, $known[$i]);
}


for ($i=0; $i<$number; $i++) {

  $M001_01 = $known[$i]; // one of the concepts used (1 to 11)
  if (!($M001_01==11)){
    $M002 = $questions[$M001_01];  // the corresponding question
    question($M002, $chosen);  // ask question
    debug($M001_01);
}
}

And code for question 3:

$questions = array(
  1 => 'M012',
  2 => 'M013',
  3 => 'M014',
  4 => 'M015',
  5 => 'M016',
  6 => 'M017', 
  7 => 'M018',
  8 => 'M019',
  9 => 'M020',
 10 => 'M021',
 11 => 'M022',
);

if ($number == 0) {
  goToPage('next'); // None used? Then continue!
}
if ($number > 3) {
  $number = 3; // carry out a maximum of three concepts
}

for ($i=0; $i<$number; $i++) {
  $M001_01 = $known[$i]; // one of the concepts used (1 to 11)
  $M002 = $questions[$M001_01];  // the corresponding question
  question($M002);  // ask question
}

Do you need more information?

Thank you very much :)

by SoSci Survey (305k points)
If you post code, please mark it and uise the {} button to format it as code. I did this in your answer above, so one can read the code ;)
by s246912 (125 points)
thank you :)

1 Answer

0 votes
by SoSci Survey (305k points)

Is it possible to create a code that distributes more evenly the different concepts in question 2 and 3?

Depends on what you mean by "more evenly".

We can be quite sure that some concepts are better known than others. So, if you want to map this distribution in your selection, you can simply create a list via getItems() and shuffle that, as you already do.

If you want to ask for each concept roughly the same time, you will need a random generator. You can tell the random generator which codes to take into consideratio when drawing:

show('RG01', [
    'filter' => $relevantItems
]);

The random generator will then go through these relevant items (that you know from your getItems()) and select those that have been selected less often in the past. At lest that's the random generator's default behavior unless you change it.

The statistical side effect is this:_ If someone says they know an otherwise rarely known concept, then they will most likely get this item in the follow-up question. That is necessary to get those items more often, but we're far from any "random" statistics in that case.

by s246912 (125 points)
thank you for this first answer! May I ask for more precise information on how to implement it? So I have to create a random generator, but then?
Thank you so much !
by SoSci Survey (305k points)
Then you use getItems() and the code above to draw from the random generator, limiting the possible options to those items that are allowed (rating >= 3). As soon as your random drawing works (which you can see in the debug information), we can proceed.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...