The subject line asks for "SPSS script". a) It is not a good idea to hide your question in the Subject: since some readers do not show that very prominently. b) You might get more responses by posting in the comp.soft-sys.stat.spss group.
See below for a solution. On 23 Jul 2003 08:26:06 -0700, [EMAIL PROTECTED] (Brian2828) wrote: > I'm working with a dataset for the Logan stop signal task (basically a > type of reaction time task with a random subset of trials requiring > that the particpant "stop" a prepotent response in the presence of an > auditory stop signal)and am having trouble writing script that will > analyze performance sequentially across trials. I want to know how > previous trials influence responses on the following trials. > > The data are organized in the data set below. I would like to take > the average of the React variable (reaction time)on trial N-1 where > trial N (trials where event = stop) and trial N-1 (event = Go). I > would then like to compare these reaction times to responses on trials > N + 1. > > Generally, I need to calculate an average of specific trials relative > to performance on previous trials. The location of stops are random. > Has anyone performed similar anaylses? Any suggestions/thoughts would > be greatly appreciated. > > Thanks, > Brian > > Subj Trial Cond Event React Key XX DUR > 1 14 O go 306 68 N/A 200 > 1 15 X go 432 65 N/A 200 > 1 16 X stop N/A 320 N/A 250 > 1 17 O go 393 68 N/A 250 > 1 18 O go 523 68 N/A 250 > 1 19 X go 420 65 N/A 250 > 1 20 O go 447 68 N/A 250 > 1 21 O go 528 68 N/A 250 > 1 22 X go 604 65 N/A 250 > 1 23 X go 525 65 N/A 250 > 1 24 X stop N/A 320 N/A 300 > 1 25 O go 343 68 N/A 300 > 1 26 O go 389 68 N/A 300 > 1 27 X go 403 65 N/A 300 > 1 28 X go 480 65 N/A 300 > 1 29 O stop N/A 320 N/A 350 > 1 30 O go 450 68 N/A 350 > 1 31 O go 421 68 N/A 350 > 1 32 X stop 390 65 N/A 300 > 1 33 O stop N/A 320 N/A 350 > 1 34 O go 437 68 N/A 350 I don't know what you want to do, logically, with N/A and with consecutive stops. You have to have clear definitions before you can write clear computer programs. The simple statement of your problem suggests to me that you can use the LAG() function. You can identify what happened at a period and at the one (or more) before. Drop the line if the present ID is not equal to Lag(ID). A way to 'lag' the whole record would be to write a new version of the file where you subtract 1 from Trial and assign new names; and match the new version with the old version, by Subject and Trial. Is that what you were asking? -- Rich Ulrich, [EMAIL PROTECTED] http://www.pitt.edu/~wpilib/index.html "Taxes are the price we pay for civilization." Justice Holmes. . . ================================================================= Instructions for joining and leaving this list, remarks about the problem of INAPPROPRIATE MESSAGES, and archives are available at: . http://jse.stat.ncsu.edu/ . =================================================================
