problem with summation of responses

Michiel Spape Michiel.Spape at nottingham.ac.uk
Tue Jun 16 09:38:51 UTC 2009


Hi,
Wow, I didn't even know there was such a thing as a summation object; seems i have been writing my own mean and SD functions for no reason. Anyway, I see a couple of things wrong with the code starting with the typo: is it PresStim or Pres.Stim? You use both, and I would guess that only PresStim is correct. 
If you have difficulty with the summation, you can, of course, always do what I have been doing so far: declare a counter variable and a sum variable, and just sum the winnings.

Dim Winning1 As long
Dim Winning2 As long
Dim nWinning1 as integer
Dim nWinning2 as integer
Dim RNow As Integer
Dim RDelay As Integer
RNow = 20 'i don't quite get what you mean by "ammount of the two different proposals is recorded in the column"
RDelay = 10 'perhaps you mean it is an attribute? For the sake of the example, i've just used c

and then just after the presentation slide:

If PresStim.RESP=1 Then             'oh, and wondering: is the response a keyboard button? I'd make it "1" then.
	Winning1 = Winning1 + RNow 
	End if 
If PresStim.RESP=2 Then Winning2.AddObservation RDelay
	Winning2 = Winning2 + RDelay
	End If

'your enters were placed incorrectly. The first one missed one, so just to be clear about syntax, I changed it to the prototypical form should you have a problem with end ifs. I'd prefer this though:
IF PresStim.Resp = "1" THEN Winning1 = Winning1 + RNow ELSE Winning2 = Winning2 + RDelay.

Hope this helps.

Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology

-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of saraag
Sent: 15 June 2009 23:31
To: E-Prime
Subject: problem with summation of responses


Hi all!

I have a behavioral task that consists in series of choices (money)
between two possibilities (now or delay), the subject respond with the
mouse (1 or 2) and the response is recorded as Pres.Stim.RESP, the
ammount of the two different proposals is recorded in the column
"RNow" or "RDelay".
I would like, for each choice (1 or 2) to sum the ammounts to the
previuos ones, so that I have two summations: one for the choice 1
(Now) and one for the choice 2 (delay)
and I would like to show just after the choice,

I tried starting from the initialization of the variables:

Dim Winning1 As Summation
Dim Winning2 As Summation
Dim RNow As Integer
Dim RDelay As Integer

and then just after the presentation slide:

If PresStim.RESP=1 Then

	Winning1.AddObservation  RNow

If Pres.Stim.RESP=2 Then

                Winning2.AddObservation RDelay

End If




But this script is not working and I have no idea of what is
missing...

Can you help me?
Thank you very much!
Sara


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


--~--~---------~--~----~------------~-------~--~----~
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