0 votes
in SoSci Survey (English) by s252372 (185 points)

Dear all,

I cant understand why exactly I have a problem with my filter and I get the following warning

"The variable AV01 has not been asked on a previous page during this interview. Therefore value() cannot determine any answer, yet."

Variable AV01 is a Random generator variable, where

1 = Primed
2 = Not primed

It is asked only if conditional answering a specific thing (see below)

if (value('A019') == 1){

$returnee = true;
question('A022');
show('AV01'); // Random treatment assignment

} else {

goToPage('int1');

}

I use it to randomize the order of a certain block of questions, see below

Then I have 3 pages that have a similar code to what I have below (just different questions)

if (value('AV01') == 1) {

question('EP01');
question('EP02');
question('EP03');

} else {

goToPage('int1');

}

And at the end of the questionnaire, similarly I have this, so one randomly assigned group

if (value('AV01') == 2) {

question('EN01');
question('EN02');
question('EN03');

} else {

goToPage('end');

}

I don't have any error until the last page and everything seems to work as I intended except the warning... I can see indeed that the problem is related to the fact that the value AV01 is not defined unless if (value('A019') == 1), but I do not know how I could overcome it...

Thank you very much for your attention

by SoSci Survey (327k points)
Did you start your test on page 1 (or wherever you placed AV01)? Or did you stat on the page with the IF filter? Did you change AV01 to draw more than one code per interview?

What does the debug information say on the page that also shows the error?
by s252372 (185 points)
Did you start your test on page 1 (or wherever you placed AV01)? Yes
Or did you stat on the page with the IF filter? No
Did you change AV01 to draw more than one code per interview? I did not change AV01 to draw more than one code per interview, but AV01 is shown only if the value of another variable is 1.

if (value('A019') == 1){
$returnee = true;
question('A022');
show('AV01'); // Random treatment assignment
} else {

goToPage('int1');
}

The debug code is

[Processing]    Create page 34 in questionnaire qnr1
[Information]    value("AV01") = ???
[Processing]    Go to the end of the interview
[Processing]    Create the questionnaire's last page
by SoSci Survey (327k points)
> [Processing]    Create page 34 in questionnaire qnr1

What does the debug information above say? On what page is the random generator? What does the random generator (in the same case) say on that page?
by s252372 (185 points)
What does the debug information above say?

[Information]    Interview number 79 is to be continued
[Information]    Questionnaire qnr1 from project unilu_students_survey will be used
[Information]    Retention period on page 33 has been 3 seconds
[Processing]    Reading answers from page 33
[Information]    Answer to A404_01 = -1
[Information]    Answer to A404_02 = -1
[Information]    Answer missing for A404_03
[Information]    Answer missing for A404_04
[Information]    Answer missing for A404_05
[Information]    Answer missing for A404_06
[Information]    Answer missing for A404_07
[Information]    Answer missing for A404_08
[Information]    Answer missing for A404_09
[Information]    Answer missing for A404_10
[Information]    Answer missing for A404_11
[Information]    Answer missing for AV03_01
[Information]    Answer missing for AV03_02
[Information]    Answer missing for AV03_03
[Information]    Answer missing for AV03_04
[Information]    Answer missing for AV03_05
[Information]    Answer missing for AV03_06
[Information]    79% of the questions have been answered so far
[Processing]    Create page 34 in questionnaire qnr1
[Information]    value("AV01") = ???
[Processing]    Go to the end of the interview
[Processing]    Create the questionnaire's last page

On what page is the random generator?
On page 14

What does the random generator (in the same case) say on that page?

if (value('A019') == 1){
    $returnee = true;
    question('A022');
    show('AV01'); // Random treatment assignment
} else {
    goToPage('int1');
}

I hope I am understanding correctly the last two questions.
by SoSci Survey (327k points)
Please start on page 14, post the debug information from that page, and then jump to page 34 (use the yellow bar for that), and copy the debug information from there, as well. This should contain everything I need to track down the problem :)
by s252372 (185 points)
Sorry for the confusion, ok so if I start from page 14 and then I jump to 34 this is the debug information

[Information]    Interview number 116 is to be continued
[Information]    Questionnaire qnr1 from project unilu_students_survey will be used
[Information]    Retention period on page 19 has been 58 seconds
[Processing]    Reading answers from page 14+19
[Information]    Answer missing for A101
[Information]    Invalid answer for A101
[Information]    0% of the questions have been answered so far
[Processing]    Create page 34 in questionnaire qnr1
[Information]    value("AV01") = ???
[Processing]    Go to the end of the interview
[Processing]    Create the questionnaire's last page

Thank you very much!
by SoSci Survey (327k points)
Please also include the debug information from page 14, thank you. At first glance, it looks like the variable name AV01 is wrong, or the random generator AV01 has not run (is possibly not placed) on page 14.
by s252372 (185 points)
This is debug information from page 14


[Processing]    Create page 14 in questionnaire qnr1
[Information]    value("A019") = ???
[Processing]    Go to page int1 (No. 19)
[Processing]    Create page 19 in questionnaire qnr1
[Content]    Create question A101

What I was trying to say earlier is that AV01 is shown only conditional on a specific answer to another question (A019). So, when A019 is asked I have no problems, but if that question is not shown I always get the error when the survey is finished

In the survey sometimes the question A019 is not shown because it is in turn conditional on two other questions, so intentionally, it might happen that respondents do not see A019 and therefore AV01 is not shown and there is this error that pops up in the end, and I still don't understand how to overcome this.

1 Answer

+1 vote
by SoSci Survey (327k points)

What I was trying to say earlier is that AV01 is shown only conditional on a specific answer to another question (A019).

Okay, AV01 is your random generator, and you want to draw a random code only if A019 is asked, is that correct? In that case, you would have to modify the IF filter to only read AV01 under the condition that AV01 did run ...

if (value('A019') == 1) {
    // This is your IF-filter regarding AV01,
    // it will be skipped if A019 is not 1, i.e., AV01 did not run
    if (value('AV01') == 1) {
        question('EP01');
        question('EP02');
        question('EP03');   
    } else {
        goToPage('int1');
    }
}

... or you can ignore the warning (it's not an error), because respondents won't see warnings.

by s252372 (185 points)
But this is what I want to achieve indeed, if AV01 = 2 I want the respondent to jump to the int1 page, if AV01 = 1 I want them to see the questions

if (value('AV01') == 1) {
    question('EP01');
    question('EP02');
    question('EP03');
} else {
    goToPage('int1');
}
}
}
by SoSci Survey (327k points)
So, that means that respondents with AV01 = 2 will not see anything on that page. Please take a look into the debug information to see what happens afterwards. Feel free to post the debug information here.
by s252372 (185 points)
So it draws AV01 = 1

[Information]    The random generator AV01 was run earlier in the interview. The codes, already drawn, are preserved: 1

And it jumps to the int1 page

[Information]    Interview number 440 is to be continued
[Information]    Questionnaire qnr1 from project unilu_students_survey will be used
[Information]    Retention period on page 15 has been 49 seconds
[Processing]    Reading answers from page 14+15
[Information]    Answer to A022 = -1
[Information]    Answer missing for A022s
[Information]    100% of the questions have been answered so far
[Processing]    Create page 16 in questionnaire qnr1
[Information]    value("A019") = 1
[Processing]    Go to page int1 (No. 21)
[Processing]    Create page 21 in questionnaire qnr1
[Content]    Create question A101
by s252372 (185 points)
I am still very puzzled, I have an earlier version of the questionnaire in another project with basically the same code and it seems to work as intended. The main change between the two questionnaires that I have done was addressing the warning "The variable AV01 has not been asked on a previous page...Therefore value() cannot determine any answer, yet." through the advice I got on this thread. But in general the warning was not problematic...
by s252372 (185 points)
Ok I understood the problem...

Page A
 if (value('A019') == 1){
    $returnee = true;
    question('A022');
    show('AV01'); // Random treatment assignment
} else {
    goToPage('int1');
}

Page B
if (value('A019') == 2){
    question('A025'); // currentcountry
} else {
    goToPage('int1');
}

Page C

if ((value('A004') == 1) && (value('A005') == 1)) {
if (value('A019') == 1) {
if (value('AV01') == 1) {
    question('EP01');
    question('EP02');
    question('EP03');
} else {
    goToPage('int1');
}
}
}
I have put page B in between page A and C. In page B I send people to page int1...

All clear now, thank you

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

...