Feedback at the end of the block

1,246 views
Skip to first unread message

Fernanda Sais

unread,
Nov 15, 2013, 3:52:50 PM11/15/13
to e-p...@googlegroups.com
Hi,

I am trying to set a feedback to be displayed at the end of each block. It works very well for the mean reaction time with different methods, but for the average accuracy I always have the same problem - the average accuracy displayed is far lower than expected for the number of errors commited: it should display something like 90-99% but it displays something like 60-79%, so I guess there is something I'm missing about it. The accuracy information is computed correctly into the data file, it is incorrect only in the feedback display.

The code I'm using now is:

'At Block Setup:

Set CorrecTimes = New Summation
Set AverageAccuracy = New Summation

'After ResponseObject:

If ResponseObject.ACC = "1" Then
CorrectTimes.AddObservation c.GetAttrib("ResponseObject.RT")
End If

AverageAccuracy.AddObservation TempoResposta.ACC

'At the End of the Block:

c.SetAttrib"BlockRT", Format(CStr(CDbl(CorrectTimes.Mean)),"0.00)
c.SetAttrib"BlockACC", Format(CStr(CDbl(AverageAccuracy.Mean*100,"0.00")

Then there is Text Display like that:

Your results for this block:
Mean Reaction Time:
[BlockRT]ms
Average Accuracy:
[BlockACC]% Correct Responses

Thanks a lot for any comment on that - I'm really running out of ideas.

Best wishes,

Fernanda


David McFarlane

unread,
Nov 18, 2013, 3:12:40 PM11/18/13
to e-p...@googlegroups.com
Fernanda,

Your puzzle interests me, but I cannot get to the puzzle itself
because of problems in your code excerpts....


0) You did not say so, but I presume that you defined your Summation
objects as global variables in the global User Script area, thus,

Dim CorrectTimes as Summation
Dim AverageAccuracy as Summation

Did you do that?


1) At one place your code uses "CorrecTimes", and at another
"CorrectTimes". Those are two different variable names, you have to
pick one or the other (I presume you meant "CorrectTimes" for both).


2) Your code for after ResponseObject includes the line

AverageAccuracy.AddObservation TempoResposta.ACC

but you have not used TempoResposta anywhere else. I suppose you
mean AverageAccuracy.ACC here, but you should clarify that.

While I am at it, I would change the code for CorrectTimes to merely

If (ResponseObject.ACC = "1") Then CorrectTimes.AddObservation
ResponseObject.RT

or even further to just

If ResponseObject.ACC Then CorrectTimes.AddObservation ResponseObject.RT


3) Your code at the end of the block contains two syntax
errors. First, you have not closed off the quotes around the 0.00 at
the end of your first line. Second, CDbl() takes only one argument,
but on the second line you have placed the parentheses around two
arguments. For that matter, you should not need the CDbl() and
CString() conversions at all, the following should work just as well:

c.SetAttrib "BlockRT", Format( CorrectTimes.Mean, "0.00" )
c.SetAttrib "BlockACC", Format( (AverageAccuracy.Mean * 100), "0.00" )


I discovered all this merely by pasting your own code into E-Studio
and attempting to compile, at which time I got compile-time
errors. When posting code to the Group, best to copy code excerpts
directly from your E-Studio files rather than retyping into a
message. I had to give up any further exploration after running into
all these errors because I do not know if any of those might cause
your problem.

With that said, I will add one more thing that may affect your
feedback calculation. You must make sure that the code after
ResponseObject does *not* execute until after ResponseObject gets a
response! You may do that in several ways:
- Run another stimulus object between your ResponseObject and
the inline code.
- Set Duration of ResponseObject to "(infinite)" (and of course
End Action to "Terminate").
- Set PreRelease of ResponseObject to 0.
Otherwise, if your inline code runs during the presentation of
ResponseObject but before it gets a response (very easy to do with
PreRelease and a finite Duration), then the feedback calcuations will
be wrong. This has become a particular problem as users with habits
learned in older versions of E-Prime move up to EP2.0.10 (I know, I
got bit by this myself just last week!).

-----
David McFarlane
E-Prime training
online: http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
take any and all questions at https://support.pstnet.com , and they
strive to respond to all requests in 24-48 hours, so make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----

Fernanda Sais

unread,
Nov 19, 2013, 10:09:58 AM11/19/13
to e-p...@googlegroups.com
David,

I am really sorry for the type errors, I really should have copied the code. But the problem really had something to do with how E-Prime computes responses at run time, as you suggest at the end of your message. Turns out I had a no go trial, and accuracy computation was not ready when the inline needing it was executed, so no go trials for which subject correctly did not respond were computed as errors while running the program. I used an inline with the code

          Do While TempoResposta.InputMasks.IsPending()
          Loop

And  that seems to be working fine now!
Thank you very much for your help!

Best,
Fernanda
Reply all
Reply to author
Forward
0 new messages