New variable that disconsiders the first error and count the subsequent errors

Hi everyone,

I am programming the Wisconsin Card Sorting Test, and I need to calculate the perseverative error which is counted after the first error is commited. So, the first error is not counted, just the subsequent errors.

Does someone know how to do it?

Thanks in advance,
Larissa

Can you share the code that does this counting?

There is no code, i need to create It.

But, I tried to do It like this:
Begin Experiment
Perseverror = -1

Each Frame:
If Ambiguity == “Unambiguous”:
Perseverror = Perseverror + 1

End Routine
thisExp.addData(“Perseverative_Error”, Perseverror)

But It does not work.

Hi,

I would have approached it in the following ways:

  1. if you need the error counter to be used somewhere in your exp e.g. feedback, to be saved in your data file, etc then just subtract 1 from the error counter before the counter/variable is used
  2. if for something else, then i would create two variables say temp_counter and final_counter. Initialise them with zero, and then
if temp_counter == 2:
    final_counter += 1 # from then on and on different code snippet every time there is an error increase the final_counter only

it is almost working rs, because the code is desconsidering every first error committed. I need it to desconsider just the first error that met the ambiguity criteria.

#First situation for scoring perseverative responses
if Ambiguity == “Unambiguous” and mouse.clicked_name != AnsCorr3:
persevprinciple = persevprinciple + 1
if Ambiguity == “Ambiguous” and mouse.clicked_name != AnsCorr3:
persevprinciple = 0
if Ambiguity == “Ambiguous” and mouse.clicked_name == AnsCorr3:
persevprinciple = 0
if Ambiguity == “Unambiguous” and mouse.clicked_name == AnsCorr3:
persevprinciple = 0

if persevprinciple >= 2:
perseverror = 1
else:
perseverror = 0

Below, part of the output:

|Perseverated_to_Principle|Perseverative_Error|resp.corr|Ambiguity|
|0|0|1|Ambiguous|
|1|0|0|Unambiguous|
|2|1|0|Unambiguous|
|0|0|0|Ambiguous|
|0|0|1|Ambiguous|
|0|0|0|Ambiguous|
|0|0|1|Ambiguous|
|1|0|0|Unambiguous|
|2|1|0|Unambiguous|
|0|0|1|Unambiguous|
|1|0|0|Unambiguous|
|0|0|1|Ambiguous|
|0|0|1|Unambiguous|
|0|0|1|Unambiguous|