Can't get AddObservation to work, or plague of the Type Mismatch
Micah
ucfmicah at gmail.com
Thu Mar 10 16:25:22 UTC 2011
Scratch that, I had an error in my debugging that led me to conclude
it wasn't working. The new version you provided IS working to count
aware trials! Thanks so much- I am pretty sure from here I can scale
this up to logging everything I need and providing feedback.
Karma + a billion!
On Mar 10, 5:09 pm, Micah Allen <mi... at cfin.dk> wrote:
> Hi Michiel,
>
> 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?
>
> Best,
> Micah
>
> On Thu, Mar 10, 2011 at 3:56 PM, Michiel Spape <
>
>
>
>
>
>
>
> Michiel.Sp... at nottingham.ac.uk> wrote:
> > Hiya,
> > It's a no-HTML mailinglist, sadly - some code formatting would be nice. I
> > copy-pasted it into eprime and fiddled around with it:
>
> > ------------
>
> > trialnum=trialnum+1 'this part adds total trials (moved this to
> > beginning)
>
> > 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!
> > c.SetAttrib "ogperf", 1
> > killme = 0
> > else
> > c.SetAttrib "ogperf", 0
> > killme = 1
> > end if
>
> > 'here's a debugging thingy for you:
> > Debug.Print "I'm currently getting Awaretrial= " &
> > c.GetAttrib("awaretrial") & "killme = " & cstr(killme)
> > 'However, I notice killme is undeclared up to this point (followed later,
> > now earlier)
> > 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)
> > awaretrials=awaretrials+1 'as far as i saw, this came a bit later,
> > saves a few lines
> > if TextDisplay1.RESP = "2" then
> > c.SetAttrib "ogaware", 0
> > else
> > c.SetAttrib "ogaware", 1
> > end if
> > end if
>
> > 'i did the killme above (since it is based on ogperf, it might as well be
> > done in the same loop, no?
>
> > 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
> > Debug.print trialnum
> > ----------------
>
> > 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.
> > Best,
> > Mich
>
> > Michiel Spapé
> > Research Fellow
> > Perception & Action group
> > University of Nottingham
> > School of Psychology
> >www.cognitology.eu
>
> > -----Original Message-----> From:e-prime at googlegroups.com[mailto:e-prime at googlegroups.com]On Behalf
> > Of Micah
> > Sent: 10 March 2011 14:39
> > To: E-Prime
> > Subject: Re: Can't get AddObservation to work, or plague of the Type
> > Mismatch
>
> > Hi,
>
> > I know everyone is very busy. Maybe I can get some help just by
> > narrowing the issue a bit. I'm trying to implement the counter
> > technique and have got the TrialNum working correctly. Now, I had the
> > thought that I could create another variable that adds one each time
> > there is an 'aware trial' (i.e., where the attributed awaretrial=1 and
> > the variable killme=1 (indicating an aware trial where the participant
> > failed to stop.
>
> > Globally, I declared both Trialnum and Awaretrials. I then used the
> > following inline to try and sum up the total aware trials. My thinking
> > is that if this works, I can then do the same thing for a variable
> > called 'correctaware' and easily calculate the mean % in a debug as
> > you suggested. Here is the inline (new parts in bold)
>
> > If c.GetAttrib("trialtype") = "lure" then 'this part
> > determines the inhibition accuracy, 1=successful 'stop'
> > if TextDisplay1.RT = 0 then
> > c.SetAttrib "ogperf", 1
> > else
> > c.SetAttrib "ogperf", 0
> > end if
> > end if
>
> > 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)
> > if TextDisplay1.RESP = "2" then
> > c.SetAttrib "ogaware", 0
> > else
> > c.SetAttrib "ogaware", 1
> > end if
> > end if
>
> > if c.GetAttrib("ogperf") = "0" then 'this part is
> > needed to determine when a participant has failed to stop
> > killme = 1
> > else
> > killme = 0
> > end if
>
> > if c.GetAttrib("awaretrial")="1" and killme =1 then 'these are the new
> > parts. I expect it to add one to 'awaretrials' each trial if criterion
> > are satisfied
> > awaretrials=awaretrials+1
> > end if
>
> > trialnum=trialnum+1 'this part adds total trials
>
> > 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
>
> > Debug.print trialnum
>
> > If someone can help me get the awareness counter working, I think I'll
> > be home free.
>
> > On Mar 10, 1:08 pm, Michiel Spape <Michiel.Sp... at nottingham.ac.uk>
> > wrote:
> > > Hiya,
> > > 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!
>
> > > Cheers,
> > > Mich
>
> > > Michiel Spapé
> > > Research Fellow
> > > Perception & Action group
> > > University of Nottingham
> > > School of Psychologywww.cognitology.eu
>
> > > -----OriginalMessage-----From:e-prime at googlegroups.com[mailto:>e-prime at googlegroups.com]OnBehalf Of Micah
> > > Sent: 10 March 2011 11:43
> > > To: E-Prime
> > > Subject: Re: Can't get AddObservation to work, or plague of the Type
> > Mismatch
>
> > > Hey Michiel,
>
> > > Awesome reply. My only question is how this can incorporate the
> > > specifics of my experiment where I have two 'accuracy' measures that
> > > are not actually incorporated in the Stimulus.ACC object. Both
> > > inhibition performance and error-awareness in this case are calculated
> > > by the post-trial in-line, and so I'm not sure I understand how
> > > TextDisplay1.ACC would gather any information on them. I could set it
> > > collect inhibition accuracy easily enough, but error-awareness needs
> > > the scripting to determine when there was a failed stop (there can
> > > only be awareness for errors, so there's nothing to report on
> > > successful stops). Anyway, I will poke around with your idea and see
> > > what happens.
>
> > > Best,
> > > Micah
>
> > > On Mar 9, 5:39 pm, Michiel Spape <Michiel.Sp... at nottingham.ac.uk>
> > > wrote:
> > > > Hiya,
> > > > 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.
> > > > So, every trial, I tend to have an inline with the following:
> > > > TrialNum = TrialNum + 1 'just so that number of trials is counted, also
> > useful if you want to present a break
> > > > TrialsCorrect = TrialsCorrect + myStimulus.ACC 'which saves one IF/THEN
> > object.
>
> > > > 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:
> > > > TrialNum = 30 'just as an example, 30 trials done so far
> > > > TrialsCorrect = 10 'just as an example, 10 trials correct
> > > > Debug.print cint(cstr(trialscorrect / numtrials / 0.01)) "% correct"
> > > > This returns "33% correct" (in the output).
>
> > > > So, if you would just dump that into a new attribute (don't add it to
> > the list, it confuses things sometimes):
> > > > c.SetAttrib "thismuch", cint(cstr(trialscorrect / numtrials / 0.01))
>
> > > > 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).
> > > > Cheers,
> > > > Mich
>
> > > > Michiel Spapé
> > > > Research Fellow
> > > > Perception & Action group
> > > > University of Nottingham
> > > > School of Psychologywww.cognitology.eu
>
> > > >-----OriginalMessage-----From:e-prime at googlegroups.com[mailto:>e-prime at googlegroups.com]OnBehalf Of Micah
> > > > Sent: 09 March 2011 16:06
> > > > To: E-Prime
> > > > Subject: Re: Can't get AddObservation to work, or plague of the Type
> > Mismatch
>
> > > > Hi Michiel,
>
> > > > Thanks for the useful reply! Ogperf and ogaware are actually list
> > > > objects, and the related code is designed to log stops and successful
> > > > error reports. So the first bit of code should be resolving to either
> > > > a '1' or a '0' for either accurate/inaccurate stop or correct error
> > > > report/missed error report. That being said I see your point with the
> > > > need to simplify and had wondered if I could get by without the
> > > > summation object. My worry is that, sense the accuracy data is not
> > > > generated directly by the list or procedure, I need this summation
> > > > object to collect data from the ogperf ogaware inline. The last bit
> > > > ( c.SetAttrib "errorawareness",
> > > > Format((errorawareness.Mean),"Percent")) is supposed to then format
> > > > the summation object for placement in the end of block report
> > > > ("Congratulations, you successfully inhibited on [stopaccuracy] of
> > > > trials and reported your errors [erroraware] of the time").
>
> > > > Will try to wrap my head around how to do this without the summation-
> > > > appreciate your help!
>
> > > > On Mar 9, 4:55 pm, Michiel Spape <Michiel.Sp... at nottingham.ac.uk>
> > > > wrote:
> > > > > Hiya,
> > > > > 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
>
> ...
>
> read more »
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list