Adaptive n-back (no lures)


Author
Message
nguirre
nguirre
New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)
Group: Forum Members
Posts: 2, Visits: 9
Dear experts,

I am trying to modify the adaptive n-back task (from Jaeggi et al 2010).
In this task, stimuli are selected from a list of items. The version that I am programming includes three conditions:
1-back, where correct response is to press a button if the current stimulus is the same than the previous one
2-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented two positions before
3-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented three positions before
In the original script the stimuli selection is made using the "replace" option. However, I need a version with no lures. It means that, for example, if the participant is performing the 3-back condition, 1-back and 2-back conditions cannot appear.
I am not familiarized with Inquisit programming options, and I wonder if I could somehow specify the following conditions for stimulus selection:

//Assuming that N is the n-back condition
// Declare the following variables:
values.n1 = 0;
values.n2 = 0;
values.n3 = 0;
// Conditions for stimulus selection
if ( values.N = 1) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n2 or values.currenttarget.n3)
    
else if ( values.N = 2) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)    
else if ( values.N = 3) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)
// Update the variables after each trial        
values.n1 = currenttarget;
values.n2 = values.n1;
values.n3 = values.n3

I hope you understand this issue.
Thank you very much!

Best regards,
Naiara

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
nguirre - 5/5/2021
Dear experts,

I am trying to modify the adaptive n-back task (from Jaeggi et al 2010).
In this task, stimuli are selected from a list of items. The version that I am programming includes three conditions:
1-back, where correct response is to press a button if the current stimulus is the same than the previous one
2-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented two positions before
3-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented three positions before
In the original script the stimuli selection is made using the "replace" option. However, I need a version with no lures. It means that, for example, if the participant is performing the 3-back condition, 1-back and 2-back conditions cannot appear.
I am not familiarized with Inquisit programming options, and I wonder if I could somehow specify the following conditions for stimulus selection:

//Assuming that N is the n-back condition
// Declare the following variables:
values.n1 = 0;
values.n2 = 0;
values.n3 = 0;
// Conditions for stimulus selection
if ( values.N = 1) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n2 or values.currenttarget.n3)
    
else if ( values.N = 2) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)    
else if ( values.N = 3) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)
// Update the variables after each trial        
values.n1 = currenttarget;
values.n2 = values.n1;
values.n3 = values.n3

I hope you understand this issue.
Thank you very much!

Best regards,
Naiara

You'll want the list set to selection with replacement, but use /not attributes to exclude the item numbers you do not want.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Dave - 5/5/2021
nguirre - 5/5/2021
Dear experts,

I am trying to modify the adaptive n-back task (from Jaeggi et al 2010).
In this task, stimuli are selected from a list of items. The version that I am programming includes three conditions:
1-back, where correct response is to press a button if the current stimulus is the same than the previous one
2-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented two positions before
3-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented three positions before
In the original script the stimuli selection is made using the "replace" option. However, I need a version with no lures. It means that, for example, if the participant is performing the 3-back condition, 1-back and 2-back conditions cannot appear.
I am not familiarized with Inquisit programming options, and I wonder if I could somehow specify the following conditions for stimulus selection:

//Assuming that N is the n-back condition
// Declare the following variables:
values.n1 = 0;
values.n2 = 0;
values.n3 = 0;
// Conditions for stimulus selection
if ( values.N = 1) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n2 or values.currenttarget.n3)
    
else if ( values.N = 2) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)    
else if ( values.N = 3) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)
// Update the variables after each trial        
values.n1 = currenttarget;
values.n2 = values.n1;
values.n3 = values.n3

I hope you understand this issue.
Thank you very much!

Best regards,
Naiara

You'll want the list set to selection with replacement, but use /not attributes to exclude the item numbers you do not want.

Concretely, the following changes to the code would be among those required:

<picture startshape>
/ items = shapes
/select = noreplace
/size = (40%, 40%)
</picture>

// add variables to block selection of what would amount to a 1-back target during a 2-back block or 3-back block
// and what would amount to a 2-back target during a 3-back block
<values>
/ not1back = 0
/ not2back = 0
</values>

*list.notargetvalue selects any of the 8 numbers but the one selected for targetvalue
<list notargetvalue>
/items = (1, 2, 3, 4, 5, 6, 7, 8)
/ not = (values.currenttarget)
/ not = (values.not1back)
/ not = (values.not2back)

/ selectionrate = always
/ replace = true
</list>


<trial nontarget>
/ ontrialbegin = [
    trial.nontarget.insertstimulustime(clearscreen, parameters.stimulusPresentationtime);
    if (values.N > 0){
        values.currenttarget = list.items.item(values.N);    
    };
    if (values.N == 1){
        // no additonal constraints during 1-back;
        // unclear whether you would consider what would amount to a 2-back target during a 1-back block a "lure"
        values.not1back = 0;
        values.not2back = 0;
    } else if (values.N == 2) {
        // block what would amount to a 1-back target during 2-back block;
        // unclear whether you would consider what would amount to a 3-back target during a 2-back block a "lure"
        values.not1back = list.items.item(values.N-1);
        values.not2back = 0;
    } else if (values.N == 3){
        // block what would amount to either a 1-back or a 2-back target during a 3-back block;
        values.not1back = list.items.item(values.N-1);
        values.not2back = list.items.item(values.N-2);
    } // the adaptive n-back has no maximum n-level, so you need to decide what to do if n gets greater than 3;
     else if (values.N > 3) {
        values.not1back = 0;
        values.not2back = 0;
    };

]
/ stimulustimes = [0 = nontargetshape]
/validresponse = (noresponse, "A")
/ beginresponsetime = 0
/ correctresponse = (noresponse)
/ ontrialend = [    
    trial.nontarget.resetstimulusframes();
    list.items.insertitem(picture.nontargetshape.currentitemnumber, 1);
    list.blockACC.appenditem(trial.nontarget.correct);
    
    //summary variables:
    if (trial.nontarget.correct){
        values.responseCategory = "CorrReject";
        list.commissions.appenditem(0);
        
        if (values.N == 0){
            list.commissions_N0.appenditem(0);        
        } else if (values.N == 1){
            list.commissions_N1.appenditem(0);            
        } else if (values.N == 2){
            list.commissions_N2.appenditem(0);            
        } else if (values.N == 3){
            list.commissions_N3.appenditem(0);        
        } else if (values.N == 4){
            list.commissions_N4.appenditem(0);        
        } else if (values.N == 5){
            list.commissions_N5.appenditem(0);        
        } else if (values.N == 6){
            list.commissions_N6.appenditem(0);        
        };//if further values of N should be added, add the necessary code here
    } else {
        values.responseCategory = "Commission Error";
        list.commissions.appenditem(1);
        list.commissionsRT.appenditem(trial.nontarget.latency);    
    
        if (values.N == 0){
            list.commissions_N0.appenditem(1);
            list.commissionsRT_N0.appenditem(trial.nontarget.latency);            
        } else if (values.N == 1){
            list.commissions_N1.appenditem(1);
            list.commissionsRT_N1.appenditem(trial.nontarget.latency);            
        } else if (values.N == 2){
            list.commissions_N2.appenditem(1);
            list.commissionsRT_N2.appenditem(trial.nontarget.latency);            
        } else if (values.N == 3){
            list.commissions_N3.appenditem(1);
            list.commissionsRT_N3.appenditem(trial.nontarget.latency);            
        } else if (values.N == 4){
            list.commissions_N4.appenditem(1);
            list.commissionsRT_N4.appenditem(trial.nontarget.latency);            
        } else if (values.N == 5){
            list.commissions_N5.appenditem(1);
            list.commissionsRT_N5.appenditem(trial.nontarget.latency);            
        } else if (values.N == 6){
            list.commissions_N6.appenditem(1);
            list.commissionsRT_N6.appenditem(trial.nontarget.latency);            
        };//if further values of N should be added, add the necessary code here
    };
]
/ trialduration = parameters.SOA
</trial>
Edited 3 Years Ago by Dave
nguirre
nguirre
New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)
Group: Forum Members
Posts: 2, Visits: 9
Dave - 5/5/2021
Dave - 5/5/2021
nguirre - 5/5/2021
Dear experts,

I am trying to modify the adaptive n-back task (from Jaeggi et al 2010).
In this task, stimuli are selected from a list of items. The version that I am programming includes three conditions:
1-back, where correct response is to press a button if the current stimulus is the same than the previous one
2-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented two positions before
3-back, where correct response is to press a button if the current stimulus is the same than the stimulus presented three positions before
In the original script the stimuli selection is made using the "replace" option. However, I need a version with no lures. It means that, for example, if the participant is performing the 3-back condition, 1-back and 2-back conditions cannot appear.
I am not familiarized with Inquisit programming options, and I wonder if I could somehow specify the following conditions for stimulus selection:

//Assuming that N is the n-back condition
// Declare the following variables:
values.n1 = 0;
values.n2 = 0;
values.n3 = 0;
// Conditions for stimulus selection
if ( values.N = 1) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n2 or values.currenttarget.n3)
    
else if ( values.N = 2) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)    
else if ( values.N = 3) {
    do {
    values.currenttarget = list.items.item(values.N);
    } while (values.currenttarget = values.n1 or values.currenttarget.n2)
// Update the variables after each trial        
values.n1 = currenttarget;
values.n2 = values.n1;
values.n3 = values.n3

I hope you understand this issue.
Thank you very much!

Best regards,
Naiara

You'll want the list set to selection with replacement, but use /not attributes to exclude the item numbers you do not want.

Concretely, the following changes to the code would be among those required:

<picture startshape>
/ items = shapes
/select = noreplace
/size = (40%, 40%)
</picture>

// add variables to block selection of what would amount to a 1-back target during a 2-back block or 2-back block
// or what would amount to a 2-back target during a 3-back block
<values>
/ not1back = 0
/ not2back = 0
</values>

*list.notargetvalue selects any of the 8 numbers but the one selected for targetvalue
<list notargetvalue>
/items = (1, 2, 3, 4, 5, 6, 7, 8)
/ not = (values.currenttarget)
/ not = (values.not1back)
/ not = (values.not2back)

/ selectionrate = always
/ replace = true
</list>


<trial nontarget>
/ ontrialbegin = [
    trial.nontarget.insertstimulustime(clearscreen, parameters.stimulusPresentationtime);
    if (values.N > 0){
        values.currenttarget = list.items.item(values.N);    
    };
    if (values.N == 1){
        // no additonal constraints during 1-back;
        // unclear whether you would consider what would amount to a 2-back target during a 1-back block a "lure"
        values.not1back = 0;
        values.not2back = 0;
    } else if (values.N == 2) {
        // block what would amount to a 1-back target during 2-back block;
        // unclear whether you would consider what would amount to a 3-back target during a 2-back block a "lure"
        values.not1back = list.items.item(values.N-1);
        values.not2back = 0;
    } else if (values.N == 3){
        // block what would amount to either a 1-back or a 2-back target during a 3-back block;
        values.not1back = list.items.item(values.N-1);
        values.not2back = list.items.item(values.N-2);
    } // the adaptive n-back has no maximum n-level, so you need to decide what to do if n gets greater than 3;
     else if (values.N > 3) {
        values.not1back = 0;
        values.not2back = 0;
    };

]
/ stimulustimes = [0 = nontargetshape]
/validresponse = (noresponse, "A")
/ beginresponsetime = 0
/ correctresponse = (noresponse)
/ ontrialend = [    
    trial.nontarget.resetstimulusframes();
    list.items.insertitem(picture.nontargetshape.currentitemnumber, 1);
    list.blockACC.appenditem(trial.nontarget.correct);
    
    //summary variables:
    if (trial.nontarget.correct){
        values.responseCategory = "CorrReject";
        list.commissions.appenditem(0);
        
        if (values.N == 0){
            list.commissions_N0.appenditem(0);        
        } else if (values.N == 1){
            list.commissions_N1.appenditem(0);            
        } else if (values.N == 2){
            list.commissions_N2.appenditem(0);            
        } else if (values.N == 3){
            list.commissions_N3.appenditem(0);        
        } else if (values.N == 4){
            list.commissions_N4.appenditem(0);        
        } else if (values.N == 5){
            list.commissions_N5.appenditem(0);        
        } else if (values.N == 6){
            list.commissions_N6.appenditem(0);        
        };//if further values of N should be added, add the necessary code here
    } else {
        values.responseCategory = "Commission Error";
        list.commissions.appenditem(1);
        list.commissionsRT.appenditem(trial.nontarget.latency);    
    
        if (values.N == 0){
            list.commissions_N0.appenditem(1);
            list.commissionsRT_N0.appenditem(trial.nontarget.latency);            
        } else if (values.N == 1){
            list.commissions_N1.appenditem(1);
            list.commissionsRT_N1.appenditem(trial.nontarget.latency);            
        } else if (values.N == 2){
            list.commissions_N2.appenditem(1);
            list.commissionsRT_N2.appenditem(trial.nontarget.latency);            
        } else if (values.N == 3){
            list.commissions_N3.appenditem(1);
            list.commissionsRT_N3.appenditem(trial.nontarget.latency);            
        } else if (values.N == 4){
            list.commissions_N4.appenditem(1);
            list.commissionsRT_N4.appenditem(trial.nontarget.latency);            
        } else if (values.N == 5){
            list.commissions_N5.appenditem(1);
            list.commissionsRT_N5.appenditem(trial.nontarget.latency);            
        } else if (values.N == 6){
            list.commissions_N6.appenditem(1);
            list.commissionsRT_N6.appenditem(trial.nontarget.latency);            
        };//if further values of N should be added, add the necessary code here
    };
]
/ trialduration = parameters.SOA
</trial>

Thank you so much! That's exactly what I need

Bes
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search