Timing Exercise 2 Cumulative Time

E-Prime Timing Exercises
Timing Exercises (1-3)
E-Prime 2002 Workshop
Files on My Documents\My
Experiments\Workshop\E-Prime Exercises
Copyright Psychology Software Tools Inc. 2002
These materials may be used for local educational purposes only. all
other use requires approval in writing. Please send requests to
[email protected]
Timing
1 of 35
List of Exercises
 1. Varying Probe Duration –
TimingParadigm3
 2. Cumulative Timing of a Repeating
Sequence of Events –
TimingParadigm4
 3. Continuous sequences of events at high
rate with short stimulus times –
TimingParadigm5
Timing
2 of 35
General Rule For Timing
 Set the timing of the critical event to be
equal the intended time rounded to the
nearest millisecond and set prerelease equal
to greater than the longest time to get ready
for the next display.
 Examples assume 60 Hz, 16.67ms refresh
subtract set the prerelease to 17 ms and
refresh time of
Refresh Rate Hz
Refreshes
1
2
3
Timing
60
17
33
50
72
14
28
42
3 of 35
Timing Exercise 1
This exercise presents a masking experiments presenting
displays for 1-3 refreshes (17-50ms). In this exercise you will:
 1. Open My Documents\My Experiments\Workshop\EPrime Exercises\ TimingParadigm3 and run to create an
EDAT file
 2. Verify Display.RefreshRate
 3. Use E-DataAid to arrange columns to check timing
accuracy
 4. Copy columns into Excel
 5. Perform calculations using Excel
Timing
4 of 35
Timing Exercise 1- Verify Refresh Rate
 1. Use E-DataAid to Open My
Documents\My
Experiments\Workshop\E-Prime
Exercises\ TimingParadigm3-31.EDAT (which was previously
created)
 2. Verify Display.RefreshRate
Timing
5 of 35
Timing Exercise 1 – Arrange Columns
 3. Select Arrange
Columns tools, click
Remove All.
 4. Next to the
Select button type
*.OnsetTime;
ProbeDuration;
Time* and click
Select
 5. Click Add and
click OK
Timing
6 of 35
Timing Exercise 1- Copy to Excel

5. Arrange columns move
Mask.OnsetTime after
Probe.OnsetTime. Click on
column heading to select then
click & drag to move

6. Select all columns, copy,
open Excel and paste.To
select cells
 click on Fixation.OnsetTime
heading and drag across to
TimeProbetoMask.
 Go to Edit and select Copy
 Open Excel
 Paste (Ctrl-V) the cells into
the first cell of the
spreadsheet
Timing
7 of 35
Timing Exercise 1- Calculate Results

7. Calculate the Probe
to Mask time
 Create a Probe-Mask
column
 In first cell of that
column type the formula:
=C2-B2
 Copy formula down to
last row
 Notes the times are
about 17,33, and 50 ms
 Compare to
TimeProbeToMask
column, they should be
the same
Timing
8 of 35
Timing Exercise 1- Calculate Results

8. Calculate the
Fixation to Probe time
Create a Fixation-Probe
column
 In first cell of that
column type the
formula: =B2-A2
 Copy formula down to
last row
 Note the times are
~516 ms
 Compare to
TimeFixationToProbe
column, they should be
the same
Timing
9 of 35
Timing Exercise 1- View Results

If you know how to
use Excel pivot tables,
create a pivot table by
selecting columns
ProbeDuration to MaskProbe, on Data menu,
choose pivot table, press
Next twice, choose Layout,
OR:
Copy and drag
Open My Documents\My
ProbeDuration to row and
Experiments\Workshop\E-Prime
Mask-Probe to data twice,
Exercises\TimingExercises excel
spreadsheet and select Exercise1Pivot
double click and select
Average and StdDev as on tab
View the calculated means and SD
the left
of Probe and Mask time
View the Pivot table of Probe-Mask
based on ProbeDuration
Timing
10 of 35
What would your report to a Journal?
 Have Assistant verify your “Timing Report” before
moving on. Please put the display into this form and raise
your hand. Explain what would your put in a journal.
Assistant Initials ___
In this experiment the displays were presented with means
and standard deviations for the probe to mask times of
___________________________
Timing
11 of 35
Exercise 1a (Optional) – Use Script to
Log Time Between Stimulus Onsets
 You can add an Inline object and add script
to calculate and log the onset to onset time
for later analysis in E-DataAid.
Timing
12 of 35
 Timing Exercise 1 Study Questions
Could you at this point answer these questions?
1. What would expect if you ran this exercise on a
100 Hertz monitor if it is set up for a 60 Hertz
monitor?
2. What if the PreRelease were set to 0 what would
you expect the times to be on a 60 Hertz
monitor?
3. How might you put in code to detect if the times
were different from the intended time by more
than a millisecond and log the problem?
4. How might you put in code to be sure that the
program is running on a 60 Hertz monitor?
Short Answers are included in the Exercise Appendix
Timing
13 of 35
Timing Exercise 2
This exercise contrasts event mode and cumulative
mode timing. Cumulative mode minimizes
cumulative time error in an experiment. In this
exercise you will:
1. Run My Documents\My
Experiments\Workshop\E-Prime
Exercises\TimingParadigm4AllModes and analyze
the timing.
 2. Use E-DataAid to output graphs and table for
Excel
 3. Report the problem errors in timing
Timing
14 of 35
Timing Exercise 2 – Create or Open EDAT file
 1. Either run
TimingParadigm4AllModes.
es or use the existing file.
 2. In E-DataAid open My
Documents\My
Experiments\Workshop\EPrime
Exercises\TimingParadigm4
and run or open
TimingParadigmAllModes1001.EDAT file for data (which was
previously created) with EDataAid.
Timing
15 of 35
Get Cumulative Time Graph
 3. Click
Calculate
 4. Move over
Trial,
TimingMode,
PreRelease,
TimingCumu
lativeError to
cells
 5. Click Run
Timing
16 of 35
Examine Timing Send Excel
 6. Select Plot
 7. Click Excel Plot
Timing
17 of 35
Examine Timing Data
 8. Look at timing data note difference from
intended
Timing
18 of 35
Zoom in on Timing Error
 9. Click on Excel Graph change chart mode
to line graph.
 10. Click on the Y-axis and right click and
set max Y to 50. Note differences in errors
Timing
19 of 35
Use E-DataAid to Output Timing Table
 11. Return to EDataAid, change
Analysis
 Set Rows to
 TimingMode
 PreRelease
 Set Data to
 TimeCumulativeError
Time
 TimeFixationToProbe
 TimeProbeToMask
 TimeProbeOnsetTo
Onset mean
 Time ProbeOnsetTo
Onset SD of Sample
Timing
20 of 35
Export Table to Excel
 12. Export to Excel by selecting StatView
format and Excel Copy
Timing
21 of 35
Identify Poor Timing
 13. Identify poor timing cases (off by a refresh
cycle). Note cumulative 100 ms prerelease correct,
errors in all other cases.
Timing
22 of 35
How would your run your experiment?
How would you report it?
 Have Assistant verify your “Timing Report” for a
cumulative experimiment. In this experiment we used
______ timing mode with the stimulus to stimulus time
mean of ______ and SD of ______.
 Please put the display into this form and raise your hand.
Explain what would your put in a journal.
Assistant Initials ___
Timing
23 of 35
Timing Exercise 2a (optional) - Run Timing Paradigm4
In Cumulative Mode, Change Event, Rerun
 1. Open TimingParadigm4.es file (My Documents\My
Experiments\Workshop\E-Prime Exercises).
 2. Run the program with subject number 1.
 3. Change the Timing Mode on the TrialProc displays
(TrialInstructions, Fixation, Probe, Mask,
FeedbackDisplay1) to Event and Prereleases to “0” or load
TimingParadgim4EventTimeNoPreRelease.es.
 4. Run the experiment with subject number 2.
Timing
24 of 35
Plot Cumulative Time Errors
Cumulative Mode With PreRelease
 5. Make table and graph of
TimeCumulativeError by
Block Cumulative Run 1-1
 Open Program E-DataAid
 Open data file
TimingParadigm4-1-1.edat
 Click Calculate
 Move Block to row
 Move
TimeCumulativeErrorTime
to Data
 Click Run
 Click Plot
 Click Excel Plot
Timing
TimeCumlativeErrorTime:M
ean
 6. Note time variation within
one refresh and not not
increasing
TimeCumlativeErrorTime:Mean by Block
7.00
6.00
5.00
4.00
3.00
2.00
1.00
0.00
-1.00
-2.00
1
2
3
4
5
6
7
8
9 10 11 12 13 14 15 16
Block
25 of 35
Plot Cumulative Time Errors
Event Mode Without PreRelease
 7. Make table and graph of
TimeCumulativeError by
Block Evente Run 2-1
 8. Note time variation is
increasing with every refresh
TimeCumlativeErrorTime:Mean by Block
TimeCumlativeErrorTime:M
ean
 Close E-Data Aid Windows
 Open data file
TimingParadigm4-2-1.edat
 Click Calculate
 Move Block to row
 Move
TimeCumulativeErrorTime
to Data
 Click Run
 Click Plot
 Click Excel Plot
800.00
700.00
600.00
500.00
400.00
300.00
200.00
100.00
0.00
1
2
3
4
5
6
7
8
9 10 11 12 13 14 15 16
Block
Timing
26 of 35
Compare Results from Both Modes
TimeCumlativeErrorTime:Mean
 Cumulative mode errors
within a refresh
(maximum of 7ms no
cumulative drift)
 Event mode increase by
significant amount with
each event causing
substantial cumulative
drift (in this example an
average of 47 ms with a
maximum of 710 ms)
Cumulative Mode PreRelease
7.00
6.00
5.00
4.00
3.00
2.00
1.00
0.00
-1.00
1
2
3
4
5
6
7
8
9
10 11 12 13 14 15 16
-2.00
Block
Event Mode No PreRelease
TimeCumlativeErrorTime:Mean
 9. Note characteristics
of data
800.00
700.00
600.00
500.00
400.00
300.00
200.00
100.00
0.00
1
2
3
4
5
6
7
8
9 10 11 12 13 14 15 16
Block
Timing
27 of 35
Timing Exercise3
 1. Open My Documents\My
Experiments\Workshop\E-Prime
Exercises\TimingParadigm5 and run
 2. Note Steps involved in Caching Images
 3. Use E-DataAid to select TargetDuration and
OnsetToOnset
 4. Plot the difference between Target and Actual
Time
Timing
28 of 35
Steps to Caching Images
• Create CanvasCache
• Load Cache
• Display Cache
Timing
29 of 35
Arrange Columns
 1. Open
TimingParadigm5-3-1.edat
file
 2. Select Arrange
Columns tools, click
Remove All
 3. Select TargetDuration
and OnsetToOnset, click
Add and OK
 4. Copy two columns to
Excel
Timing
30 of 35
Chart Results in Excel
 In Excel select
both columns and
click on Graph
Wizard
 Make line chart
of time
 Note error target
versus intended
Timing
31 of 35
View Results
 Note error target versus intended
Timing
32 of 35
View Results
 Determine max speed presentation with
disk reads and caching.
Network Server Intended and Acutal Display
250
Milliseconds
200
150
TargetDuration
OnsetToOnset
100
50
379
352
325
298
271
244
217
190
163
136
109
82
55
28
1
0
Image
Timing
33 of 35
 Timing Exercise 2 Cumulative Time
Could you at this point?
1. Specify when to use Cumulative Time and Event
Time methods?
2. Analyze the timing of a cumulative experiment
and report accurately the timing precision in a
journal article?
3. Specify the disadvantage of using PreRelease and
when must you be careful about it?
Short Answers are included in the Exercise Appendix
Timing
34 of 35
 Timing Exercise 3 Caching Questions
Could you at this point?
1. Specify the range of display times in which
prerelease is sufficient for the computer to keep
up and caching is not necessary?
2. Determine the maximal rate at which you could
display images before the computer can not keep
up?
3. Add new images to TimingParadigm 5 to allow
rapid presentation of those images?
Short Answers are included in the Exercise Appendix
Timing
35 of 35