Hi Michiel,<div><br></div><div>I'm afraid that did not fix it. I can see from the debug that if on 'no awareness' trials Awaretrial resolves to " ". I think the problem might just be my syntax, as it seems to add nothing every time. Is there a particular way to use if-then statements to add incrementally to a variable?</div>
<div><br></div><div>Best,</div><div>Micah </div><div><br><div class="gmail_quote">On Thu, Mar 10, 2011 at 3:56 PM, Michiel Spape <span dir="ltr"><<a href="mailto:Michiel.Spape@nottingham.ac.uk">Michiel.Spape@nottingham.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hiya,<br>
It's a no-HTML mailinglist, sadly - some code formatting would be nice. I copy-pasted it into eprime and fiddled around with it:<br>
<br>
------------<br>
<br>
trialnum=trialnum+1 'this part adds total trials (moved this to beginning)<br>
<br>
If c.GetAttrib("trialtype") = "lure" AND TextDisplay1.RESP = "" then'I prefer 'no response' to '0 RT', as the other suggests there's a very fast RT!<br>
c.SetAttrib "ogperf", 1<br>
killme = 0<br>
<div class="im"> else<br>
c.SetAttrib "ogperf", 0<br>
</div> killme = 1<br>
end if<br>
<br>
'here's a debugging thingy for you:<br>
Debug.Print "I'm currently getting Awaretrial= " & c.GetAttrib("awaretrial") & "killme = " & cstr(killme)<br>
'However, I notice killme is undeclared up to this point (followed later, now earlier)<br>
<div class="im">if c.GetAttrib("awaretrial") = "1" and killme = 1 then 'this part determines the awaresness, 1=aware of an error, killme=1 means participant failed to stop on an awaretrial (and hence should report)<br>
</div> awaretrials=awaretrials+1 'as far as i saw, this came a bit later, saves a few lines<br>
<div class="im"> if TextDisplay1.RESP = "2" then<br>
c.SetAttrib "ogaware", 0<br>
else<br>
c.SetAttrib "ogaware", 1<br>
end if<br>
end if<br>
<br>
</div>'i did the killme above (since it is based on ogperf, it might as well be done in the same loop, no?<br>
<div class="im"><br>
Debug.print awaretrials & " = awaretrialtotal" ' these parts should spit out a counter. the trialnum works correctly, but awaretrial just spits out a '0' over and over<br>
Debug.print trialnum<br>
</div>----------------<br>
<br>
Maybe it works now? If it doesn't, the debug.print which immediately precedes the IF statement which leads to awaretrials counter being updated should spit out exactly why not. But I think it's the killme, which was defined AFTER polling whether it's 1 or 0 (hence, presumably always 0). I've also cleaned a bit.<br>
Best,<br>
<div class="im">Mich<br>
<br>
Michiel Spapé<br>
Research Fellow<br>
Perception & Action group<br>
University of Nottingham<br>
School of Psychology<br>
<a href="http://www.cognitology.eu" target="_blank">www.cognitology.eu</a><br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a> [mailto:<a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>] On Behalf Of Micah<br>
</div><div><div></div><div class="h5">Sent: 10 March 2011 14:39<br>
To: E-Prime<br>
Subject: Re: Can't get AddObservation to work, or plague of the Type Mismatch<br>
<br>
Hi,<br>
<br>
I know everyone is very busy. Maybe I can get some help just by<br>
narrowing the issue a bit. I'm trying to implement the counter<br>
technique and have got the TrialNum working correctly. Now, I had the<br>
thought that I could create another variable that adds one each time<br>
there is an 'aware trial' (i.e., where the attributed awaretrial=1 and<br>
the variable killme=1 (indicating an aware trial where the participant<br>
failed to stop.<br>
<br>
Globally, I declared both Trialnum and Awaretrials. I then used the<br>
following inline to try and sum up the total aware trials. My thinking<br>
is that if this works, I can then do the same thing for a variable<br>
called 'correctaware' and easily calculate the mean % in a debug as<br>
you suggested. Here is the inline (new parts in bold)<br>
<br>
If c.GetAttrib("trialtype") = "lure" then 'this part<br>
determines the inhibition accuracy, 1=successful 'stop'<br>
if TextDisplay1.RT = 0 then<br>
c.SetAttrib "ogperf", 1<br>
else<br>
c.SetAttrib "ogperf", 0<br>
end if<br>
end if<br>
<br>
<br>
<br>
if c.GetAttrib("awaretrial") = "1" and killme = 1 then 'this<br>
part determines the awaresness, 1=aware of an error, killme=1 means<br>
participant failed to stop on an awaretrial (and hence should report)<br>
if TextDisplay1.RESP = "2" then<br>
c.SetAttrib "ogaware", 0<br>
else<br>
c.SetAttrib "ogaware", 1<br>
end if<br>
end if<br>
<br>
if c.GetAttrib("ogperf") = "0" then 'this part is<br>
needed to determine when a participant has failed to stop<br>
killme = 1<br>
else<br>
killme = 0<br>
end if<br>
<br>
if c.GetAttrib("awaretrial")="1" and killme =1 then 'these are the new<br>
parts. I expect it to add one to 'awaretrials' each trial if criterion<br>
are satisfied<br>
awaretrials=awaretrials+1<br>
end if<br>
<br>
trialnum=trialnum+1 'this part adds total trials<br>
<br>
Debug.print awaretrials & " = awaretrialtotal" ' these parts should<br>
spit out a counter. the trialnum works correctly, but awaretrial just<br>
spits out a '0' over and over<br>
<br>
Debug.print trialnum<br>
<br>
<br>
If someone can help me get the awareness counter working, I think I'll<br>
be home free.<br>
<br>
On Mar 10, 1:08 pm, Michiel Spape <<a href="mailto:Michiel.Sp...@nottingham.ac.uk">Michiel.Sp...@nottingham.ac.uk</a>><br>
wrote:<br>
> Hiya,<br>
> Sorry, that is indeed just bad reading on my part :) It remains a sometimes worthy suggestion for other people here though, as I've often seen "IF .....ACC = 1 then countup ELSE dontcountup" whereas count = count + ACC looks very nice and clean. For a truly suitable answer, I should really have a look at your script and see what exactly you mean, but alas, no time!<br>
><br>
> Cheers,<br>
> Mich<br>
><br>
> Michiel Spapé<br>
> Research Fellow<br>
> Perception & Action group<br>
> University of Nottingham<br>
> School of <a href="http://Psychologywww.cognitology.eu" target="_blank">Psychologywww.cognitology.eu</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> -----Original <a href="mailto:Message-----From%3Ae-prime@googlegroups.com">Message-----From:e-prime@googlegroups.com</a>[mailto:<a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>]On Behalf Of Micah<br>
> Sent: 10 March 2011 11:43<br>
> To: E-Prime<br>
> Subject: Re: Can't get AddObservation to work, or plague of the Type Mismatch<br>
><br>
> Hey Michiel,<br>
><br>
> Awesome reply. My only question is how this can incorporate the<br>
> specifics of my experiment where I have two 'accuracy' measures that<br>
> are not actually incorporated in the Stimulus.ACC object. Both<br>
> inhibition performance and error-awareness in this case are calculated<br>
> by the post-trial in-line, and so I'm not sure I understand how<br>
> TextDisplay1.ACC would gather any information on them. I could set it<br>
> collect inhibition accuracy easily enough, but error-awareness needs<br>
> the scripting to determine when there was a failed stop (there can<br>
> only be awareness for errors, so there's nothing to report on<br>
> successful stops). Anyway, I will poke around with your idea and see<br>
> what happens.<br>
><br>
> Best,<br>
> Micah<br>
><br>
> On Mar 9, 5:39 pm, Michiel Spape <<a href="mailto:Michiel.Sp...@nottingham.ac.uk">Michiel.Sp...@nottingham.ac.uk</a>><br>
> wrote:<br>
> > Hiya,<br>
> > Well, let's see how far you'll get :) I thought I might add that I generally have two global variables (i.e. declared in the User tab), one being TrialNum, which just adds one up to the trial, and one TrialsCorrect.<br>
> > So, every trial, I tend to have an inline with the following:<br>
> > TrialNum = TrialNum + 1 'just so that number of trials is counted, also useful if you want to present a break<br>
> > TrialsCorrect = TrialsCorrect + myStimulus.ACC 'which saves one IF/THEN object.<br>
><br>
> > Visual basic tends to be a bit tricky in terms of variables being converted on the spot, whether you like it or not, but if you just want to know the percentage, the following tends to work pretty well:<br>
> > TrialNum = 30 'just as an example, 30 trials done so far<br>
> > TrialsCorrect = 10 'just as an example, 10 trials correct<br>
> > Debug.print cint(cstr(trialscorrect / numtrials / 0.01)) "% correct"<br>
> > This returns "33% correct" (in the output).<br>
><br>
> > So, if you would just dump that into a new attribute (don't add it to the list, it confuses things sometimes):<br>
> > c.SetAttrib "thismuch", cint(cstr(trialscorrect / numtrials / 0.01))<br>
><br>
> > and have a slide, saying "You had [thismuch]% correct", you're basically there (just tested it). Not to say you can't do the same with summation objects, but the above, taking out my debug, takes only 3 lines of code (excluding 2 lines of user script variable declarations).<br>
> > Cheers,<br>
> > Mich<br>
><br>
> > Michiel Spapé<br>
> > Research Fellow<br>
> > Perception & Action group<br>
> > University of Nottingham<br>
> > School of <a href="http://Psychologywww.cognitology.eu" target="_blank">Psychologywww.cognitology.eu</a><br>
><br>
> > -----<a href="mailto:OriginalMessage-----From%3Ae-prime@googlegroups.com">OriginalMessage-----From:e-prime@googlegroups.com</a>[mailto:<a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>]On Behalf Of Micah<br>
> > Sent: 09 March 2011 16:06<br>
> > To: E-Prime<br>
> > Subject: Re: Can't get AddObservation to work, or plague of the Type Mismatch<br>
><br>
> > Hi Michiel,<br>
><br>
> > Thanks for the useful reply! Ogperf and ogaware are actually list<br>
> > objects, and the related code is designed to log stops and successful<br>
> > error reports. So the first bit of code should be resolving to either<br>
> > a '1' or a '0' for either accurate/inaccurate stop or correct error<br>
> > report/missed error report. That being said I see your point with the<br>
> > need to simplify and had wondered if I could get by without the<br>
> > summation object. My worry is that, sense the accuracy data is not<br>
> > generated directly by the list or procedure, I need this summation<br>
> > object to collect data from the ogperf ogaware inline. The last bit<br>
> > ( c.SetAttrib "errorawareness",<br>
> > Format((errorawareness.Mean),"Percent")) is supposed to then format<br>
> > the summation object for placement in the end of block report<br>
> > ("Congratulations, you successfully inhibited on [stopaccuracy] of<br>
> > trials and reported your errors [erroraware] of the time").<br>
><br>
> > Will try to wrap my head around how to do this without the summation-<br>
> > appreciate your help!<br>
><br>
> > On Mar 9, 4:55 pm, Michiel Spape <<a href="mailto:Michiel.Sp...@nottingham.ac.uk">Michiel.Sp...@nottingham.ac.uk</a>><br>
> > wrote:<br>
> > > Hiya,<br>
> > > Ugh, lots of code. Forgive me, like many coding people, I tend to be lazy and simply won't read long threads. I've never had any use for this "summation object" deal, but your code is really quite confusing:<br>
><br>
> > > > > dim stopaccuracy as Summation<br>
> > > > > dim erroraware as Summation<br>
> > > > > c.SetAttrib "stopaccuracy", Format((stopaccuracy.Mean),"Percent")<br>
> > > > > c.SetAttrib "errorawareness", Format((errorawareness.Mean),"Percent")<br>
> > > > > stopaccuracy.AddObservation c.GetAttrib("ogperf")<br>
> > > > > errorawareness.AddObservation c.GetAttrib("ogaware")<br>
><br>
> > > What exactly are you doing here? Stopaccuracy is both a "summation" and an "attribute in a list". Errorwareness is only semi-overlapping with this attribute, although I see no reason why you would want this. Ogperf is not even an attribute but a local variable. If you have declared it somewhere, it probably looks into a list anyway, finds a question mark, tries to put this into stopaccuracy. Thus, what you get is StopAccuracy.AddObservation ?, or, dbl(?), which doesn't work either.<br>
><br>
> > > If you want to find out what's going on with the mismatch (one of the more simpler things to solve):>stopaccuracy.AddObservation c.GetAttrib("ogperf")<br>
><br>
> > > Then try change this into:<br>
> > > stopaccuracy.AddObservation 0<br>
> > > if the latter works but the former doesn't, then c.GetAttrib("ogperf") probably receives a string instead, or, in other words, Ben would be right. See what ogperf is by doing "debug.print c.GetAttrib("ogperf"). So, try beginning simple with working code, then add - rather than the opposite.<br>
><br>
> > > So, start with as clean and working code as possible. My suggestion would be to start with getting rid of the summation stuff (after all, what more is stopaccuracy.mean then merely numberofstopaccuratetrials / numberoftrials?) and the c.getattrib/set stuff until you can get everything working on one level.<br>
> > > Cheers,<br>
> > > Mich<br>
><br>
> > > Michiel Spapé<br>
> > > Research Fellow<br>
> > > Perception & Action group<br>
> > > University of Nottingham<br>
> > > School of <a href="http://Psychologywww.cognitology.eu" target="_blank">Psychologywww.cognitology.eu</a><br>
><br>
> > >-----<a href="mailto:OriginalMessage-----From%3Ae-prime@googlegroups.com">OriginalMessage-----From:e-prime@googlegroups.com</a>[mailto:<a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>]On Behalf Of Micah<br>
> > > Sent: 09 March 2011 15:19<br>
> > > To: E-Prime<br>
> > > Subject: Re: Can't get AddObservation to work, or plague of the Type Mismatch<br>
><br>
> > > Hi Ben,<br>
><br>
> > > Sincere thanks for your suggestion. Helped me to feel like I'm getting<br>
> > > somewhere in my understanding of E-basic, as I had the same idea.<br>
> > > Sadly neither CInt or CDbl used in that way change the error. I also<br>
> > > tried declaring erroraware and stopaccuracy as doubles, and tried<br>
> > > converting them into new variables that would be numbers. I'm not sure<br>
> > > I did that correctly however.<br>
><br>
> > > Thanks for your help- i'll be really excited if we can solve this.<br>
><br>
> > > On Mar 9, 3:17 pm, ben robinson <<a href="mailto:baltimore....@gmail.com">baltimore....@gmail.com</a>> wrote:<br>
> > > > try changing them to:<br>
> > > > stopaccuracy.AddObservation CInt(c.GetAttrib("ogperf"))<br>
> > > > errorawareness.AddObservation CInt(c.GetAttrib("ogaware"))<br>
><br>
> > > > or CDbl(...) if CInt(...) isn't what you need.<br>
> > > > i think the problem might be that when you c.GetAttrib the value it pulls<br>
> > > > from the list is understood as a string, rather than some sort of number...<br>
><br>
> > > > On Wed, Mar 9, 2011 at 8:34 AM, Micah <<a href="mailto:ucfmi...@gmail.com">ucfmi...@gmail.com</a>> wrote:<br>
> > > > > Hello,<br>
><br>
> > > > > This is probably a very easy to solve problem, but it's just about<br>
> > > > > beaten me down. I am trying to make a training script for my error-<br>
> > > > > awareness paradigm that can log inhibition and error-awareness<br>
> > > > > performance and then report these to the subject at the end of the<br>
> > > > > trial. The task is very simple and works fine, as does the performance<br>
> > > > > logging. I can't seem to get my summation object to work though-<br>
> > > > > everytime it gives me a 'type mismatch'. I've tried creating a<br>
> > > > > variable from the logging vars in a double format but that does not<br>
> > > > > fix it. Can someone take a look at my code and see what's up?<br>
><br>
> > > > > I start with the following setup inline and usertab code:<br>
> > > > > 'setup inline<br>
> > > > > set stopaccuracy = New Summation<br>
> > > > > set erroraware = New Summation<br>
><br>
> > > > > 'usertab<br>
> > > > > dim killme as integer<br>
> > > > > dim stopaccuracy as Summation<br>
> > > > > dim erroraware as Summation<br>
> > > > > dim ogperf as double<br>
> > > > > dim ogaware as double<br>
><br>
> > > > > My inline that logs awareness and performance, and (is supposed to)<br>
> > > > > fill the summation object with these information for reporting to the<br>
> > > > > subject, looks like this:<br>
><br>
> > > > > If c.GetAttrib("trialtype") = "lure" then<br>
> > > > > if TextDisplay1.RT = 0 then<br>
> > > > > c.SetAttrib "ogperf", 1<br>
> > > > > else<br>
> > > > > c.SetAttrib "ogperf", 0<br>
> > > > > end if<br>
> > > > > end if<br>
><br>
> > > > > if c.GetAttrib("awaretrial") = "1" and killme = 1 then<br>
> > > > > if TextDisplay1.RESP = "2" then<br>
> > > > > c.SetAttrib "ogaware", 0<br>
> > > > > else<br>
> > > > > c.SetAttrib "ogaware", 1<br>
> > > > > end if<br>
> > > > > end if<br>
><br>
> > > > > if c.GetAttrib("ogperf") = "0" then<br>
> > > > > killme = 1<br>
> > > > > else<br>
> > > > > killme = 0<br>
> > > > > end if<br>
><br>
> > > > > stopaccuracy.AddObservation c.GetAttrib("ogperf")<br>
> > > > > errorawareness.AddObservation c.GetAttrib("ogaware")<br>
><br>
> > > > > Debug.Print stopaccuracy.Mean<br>
> > > > > Debug.Print erroraware.Mean<br>
><br>
> > > > > c.SetAttrib "stopaccuracy", Format((stopaccuracy.Mean),"Percent")<br>
> > > > > c.SetAttrib "errorawareness",<br>
><br>
> ...<br>
><br>
> read more »<br>
<br>
--<br>
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com">e-prime+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href="http://groups.google.com/group/e-prime?hl=en" target="_blank">http://groups.google.com/group/e-prime?hl=en</a>.<br>
<br>
</div></div><div class="im">This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.<br>
<br>
This message has been checked for viruses but the contents of an attachment<br>
may still contain software viruses which could damage your computer system:<br>
you are advised to perform your own checks. Email communications with the<br>
University of Nottingham may be monitored as permitted by UK legislation.<br>
<br>
--<br>
</div><div><div></div><div class="h5">You received this message because you are subscribed to the Google Groups "E-Prime" group.<br>
To post to this group, send email to <a href="mailto:e-prime@googlegroups.com">e-prime@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href="mailto:e-prime%2Bunsubscribe@googlegroups.com">e-prime+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href="http://groups.google.com/group/e-prime?hl=en" target="_blank">http://groups.google.com/group/e-prime?hl=en</a>.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Micah Allen<br>PhD Student in Cognitive Neuroscience<br>Interacting Minds Group<br>Center for Functionally Integrative Neuroscience<br>Aarhus University, Denmark<br>
Tel.: +45 89 49 99 33<br><a href="http://www.interacting-minds.net">http://www.interacting-minds.net</a><br><a href="http://au.academia.edu/MicahAllen">http://au.academia.edu/MicahAllen</a><br><br><br><br>
</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com.<br />
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.<br />