| Reference | Downloads | Github

Calculate threshold for a MOCs experiment? Method of constants qn

Hello, I’m currently running a single-interval, 2-alternative forced choice depth discrimination paradigm. In each trial, a standard and a test stimulus are presented simultaneously using Method of Constant stimuli (NOT adaptive staircase due to constraints with creating the stimuli).
I have set this up in the PsychoPy Builder.
I would like to obtain PSE thresholds/ JNDs etc.
Is there an easy way to do this in PsychoPy?

I can see that you can get these values out if I were using staircase/adaptive methods. I am new to PsychoPy and also new to Python, so I am struggling with trialhandler code or adapting Quest. Just wondering if I have missed seeing a really obvious function/something to extract thresholds? Can anyone help me with this? At the moment I am thinking to send the data to Matlab to process, but this defeats the reason that I was using PsychoPy in the first place (user friendly for undergrads to run exp).

Kind regards, Kirsten.

I’m not sure I quite understand the question. If you are using the method of constant stimuli, then PsychoPy is just presenting the stimuli in the standard way, using randomisation or whatever as required, and so the TrialHandler doesn’t need to be adapted.

Extracting PSE or JND then becomes something for the analysis stage, as those calculations (unlike in an adaptive paradigm), can’t begin until all the data points are gathered. What you use for the analysis is open-ended, as the .csv output is well suited for analysis in R, Python, Matlab, or whatever you choose (even Excel).

Is the issue that you want to give on-screen feedback or something, and so some within-subject analysis needs to be done immediately? That could certainly be done, by embedding some Python code to do the calculations at the end of the experiment. But PsychoPy doesn’t know anything about the meaning and structure of your data, so you would need to implement the analysis yourself, for your specific variables and responses.

PsychoPy does provide some useful analysis functions for fitting to your data, e.g.

Thanks Michael for your fast response.
What I am after is an analysis after the experiment is complete. Ideally the participant would finish all trials and then PsychoPy would fit a curve (like the logistic you suggest). Plot a graph, present me the PSE/JND and save this info into the .csv file. So it is all done within PsychoPy.
Am I right to understand that this IS possible, but I need to code this all in Python and add it to the end of the my setup up that is in Builder?
This is where I get confused, because like you say PsychoPy doesn’t know about structure etc of what I want. How do I access the PsychoPy data to put out my variables/responses so that I can enter them into the curve fit function? I would love to see a simple example of how this would be done in Python. I’m aware I am new to Python so perhaps this is what the real problem is here…
Many thanks, Kirsten