psychopy.org | Reference | Downloads | Github

Indexing feedback after a block


#1

Hey there,

so I am trying to create an experiment, where the subjects get a feedback after each block. This was possible by using this code component explained on the psychopy website. (http://www.psychopy.org/recipes/builderFeedback.html)

The problem is, that I don’t want the feedback for every trial. In the experiment there are like two stimuli and they react on both, but should only get feedback on their performance for one stimuli.

My Idea was, to create a new variable in the excel sheet with the values 0 and 1. Every trial with a 1 should be used to compute the feedback and every trial with a 0 should be neglected. I thought I could index it like this:

nCorr = trials.data[‘Urteil.corr’ & ‘odd’ == 1].mean()

odd is the variable with the 0 and 1 and Urteil.corr are the correct or incorrect reactions of the subject. Unfortunately it doesn’t work… Do you have any idea, how to index this, so it only includes the trials I want?

I hope my question is clear and I thank everybody in advance for contribution to my problem.


#2

Hey,

I’m not sure what the .mean() is for? The way I would intuitively approach it is by having an if statement that checks for both odd==1 and Urteil.corr

So before beginning the feedback loop, you could have something like:

if (odd==1) and keyResponse==Urteil.corr[i]: #whatever format you have.
    #start running feedback 

#3

Hey Jin,

that sounds like a good approach to the problem.

.mean() just calculates the mean. You can also use .sum() oder .sd().

I’m not familiar with python, so what do you mean by “whatever format you have”? And I’m not sure, if I understand the if statement correctly… why keyResponse == Urteil.corr[i]?

Sorry for my maybe stupid questions… :smiley: