Docs: merps

Introduction

Merps is a Windows utility to measure event-related potentials (ERP's) in a ERPSS datafile. The original merps (E1) program was written under Unix and was thusly designed with a commandline interface, but this new version was designed to operate under Windows using a graphical user interface (GUI) to make operation simpler and faster in certain situations. For instance, if you want to quickly measure peak-to-peak amplitudes, latencies, and such among several data files, this new version will likely provide faster and more effective results. However, if you intend to use a batch file or script to pipe output results into another program, you're looking for the original version...this new version displays results to the screen, but doesn't have a facility for saving measurement results automatically to files. The remainder of this document will focus on the new Windows version of merps.

In order to use merps, you need to have one or more valid ERPSS data files. These data files are produced by avgerps (E1), and subsequent ERPSS processing files such as normerps (E1).

Usage

Start the merps program by double-clicking the merps icon.

You should see the following window appear on the display:

Choose File->Open from the pulldown menus, or click the Open icon in the toolbar to open a new data file.

 

 

 

Currently the following measurement commands are available:

Summary of Operation

Merps reads commands from either the standard input or a measurement command file (mcf) to set various parameters pertaining to performing a measurement or to select a measurement function. Commands that set parameters are termed measurement parameter commands, while commands that actually cause measurements to be made and the values placed in the output file are termed measurement commands. Before measurements can be made, one must define the data file(s) that will be measured using one or more file commands or by using the -f option during the invocation. The particular bin(s) in each data file must also be defined using a bins command, as well as the channel(s) using a channels command, and (optionally) the processing function(s) with a procfuncs command. The window over which the measurement algorithm is applied also must be set using a window command, and, finally, the order to perform the measurements must be specified using an order command. Once these parameters are set, one or more measurement commands can be executed, yielding the output measurements.

The order in which the data files and the bins, channels, and processing functions in those files are measured during the execution of a measurement command is based on an implied, factorial model involving a number of factors and levels of those factors. Beware, however, as these factors are almost certainly not those actually being analyzed experimentally, but rather an algorithmic mechanism for succinctly representing the order in which measurements are to be made. These measurement factors are the data files, bins, processing functions, and channels. Each factor has one or more levels, and each level of a factor is indexed by a non-negative integer. The index is used to select the actual level of the corresponding factor. For example, if four bins were defined by a bins command as 3, 5, 4, and 1, then there are four levels of the bin factor with indices from zero to three, corresponding to bins 3, 5, 4, and 1. Note that the order of the bins that are selected as the bin factor index moves from 0 to 3 is the same as the order that the bins were specified in the bins command. Each of the other factors work similarly; for the files factor, the order of appearance of the file commands determines the order of the files.

This scheme is useful in thinking about the order command, which specifies the order in which the indices of the factors increment and thus the order of the measurements in the output file. For example, the order command


	order  files  channels  bins

will cause all the bins for a specific file and channel to be measured before the next level of the channel is selected. I.e., the indices for the files factor move slowest, those for the channels factor next fastest, and those for the bins factor the fastest. Usually one will perform a repeated measures analysis of variance on the measurements; if one is using ranova (E1) or anovae, files will probably need to "move fastest", and should thus be the last argument on the order command line.

Note that this internal model of factors and levels is not meant to correspond to a particular experimental design, and in most cases more than one experimental factor will be subsumed in the bins that are measured. Nonetheless, this scheme is flexible enough to allow most experimental measurement needs to be met by devising an appropriate mapping of the experimental factors and required order of output onto a sequence of merps commands.

Examples

Perhaps the best way to understand merps is to look at an example or two. Let's consider a hypothetical experiment where the effects of attending to stimuli on the ERPs are to be statistically evaluated. For concreteness, lets say we've presented three subjects with high and low pitched tone pips, and had them attend to one pitch and then the other in separate presentations of the same set of stimuli. Thus, for each subject, we have averaged the raw data and now have four bins as follows:


	Bin       Description
 	1         High Tones, attend High Tones
 	2         Low Tones, attend High Tones
 	3         High Tones, attend Low Tones
 	4         Low Tones, attend Low Tones

These data are in files named s01, s02, s03. We intend to apply a repeated measures analysis of variance to the measurements, and wish to examine the mean amplitude of the ERP at the latency from 100 to 200 msec after stimulus presentation. For various reasons, we also wish to restrict the analysis to the Cz scalp site, which happens to be channel number 3 in the data files. In the analysis, we anticipate three factors:

	Factor  # Levels        Values                  Description

   	A        2     High tone, Low tone     Pitch of eliciting stimulus
   	B        2     Attended, Unattended    Effect of Attention
   	S        3     Ss1, Ss2, Ss3           Subject

Having established this framework for the analysis, an appropriate merps command file (mcf) would be:

	file s01
	file s02
	file s03
	bins 1 3 4 2
	chans 3
	order chans bins files
	window 100 200
	meana

Some comments are perhaps in order. Note that the ordering of the data is such that the same bin and channel is measured for each subject before moving to the next bin; this is appropriate for the ranova (E1) model, since subjects "moves fastest". Also, since only one channel is being measured, the position of the chans and bins in the order command is irrelevant. Since no baseline command was included in the mcf, the entire pre-stimulus period will be used as the zero-voltage reference.

At risk of being too detailed, here is the order in which the measure will appear in the output file after merps is successfully run:


	FILE     BIN     CHAN     DESCRIPTION

 	s01      1       3       Hi Tones, Attend Hi, Subject 1
 	s02      1       3       Hi Tones, Attend Hi, Subject 2
 	s03      1       3       Hi Tones, Attend Hi, Subject 3
 	s01      3       3       Hi Tones, Attend Lo, Subject 1
 	s02      3       3       Hi Tones, Attend Lo, Subject 2
 	s03      3       3       Hi Tones, Attend Lo, Subject 3
 	s01      4       3       Lo Tones, Attend Lo, Subject 1
 	s02      4       3       Lo Tones, Attend Lo, Subject 2
 	s03      4       3       Lo Tones, Attend Lo, Subject 3
 	s01      2       3       Lo Tones, Attend Hi, Subject 1
 	s02      2       3       Lo Tones, Attend Hi, Subject 2
 	s03      2       3       Lo Tones, Attend Hi, Subject 3

One final comment - note that the experimental factors of underlying types of tones and attention are subsumed in the merps bins "measurement factor". The measurement factors, again, are only a mechanistic shorthand for ordering the measurements.

Note that one can specify additional measurements in the mcf by simply continuing the mcf. The commands are executed in the order they are encountered in the mcf, and the parameters from commands are retained until that command is again encountered in the mcf. Hence, if one had a between-subjects factor in addition to the two within-subjects factors in the above example, and the only difference between the measurements was the data files, one might employ an mcf similar to this one:


	file s01
	file s02
	file s03
	bins 1 3 4 2
	chans 3
	order bins chans files
	window 100 200
	meana
	clearfiles
	file s04
	file s05
	file s06
	meana

with the between-subjects factor "moving most slowly". Note that the same bins and channels are measured in the same order for the second meana command, but the files have been switched. This example also demonstrates the optional clearfiles command, which closes all currently open files and resets the number of open files to 0. The ranova model for this analysis might be:

	Factor  # Levels        Values              Description
	
   	A        2     Schizophrenic, Normal   Mental Competence
   	B        2     High tone, Low tone     Pitch of eliciting stimulus
   	C        2     Attended, Unattended    Effect of Attention
   	S        3     Ss1, Ss2, Ss3           Subject within Group

Errors

Errors that occur during the execution of merps are divided into two categories: hard errors, and soft measurement errors. Hard errors occur, for example, when a file cannot be opened, there is a syntactical error in the mcf, or when an insurmountable error arises during the execution of a measurement command. Soft, or measurement errors arise when a measurement command was not successful because of the nature of the data. For example, one might be looking for a negative peak but the data are all positive over the search window. Soft errors arise only during the execution of a measurement command, and are distinguished from hard errors during a measurement command in that some value, possibly useable, is calculated and printed. For example, if one is searching for a positive local peak, but no local peaks are present in the data, the maximum value of the data in the window might be placed in the output file and a soft error noted. This maximum value might be deemed acceptable by the user, in which case one could use the measurement output file "as is". However, if a hard error occurs, the output file of measurements could not be used in subsequent analyses, as non-sensical values (if that) would be present, and the output file is removed before termination of merps if not operating in interactive mode. The description of each measurement command explains the possible errors and their causes. For both hard and soft errors, a message is printed on the standard error that is intended to help diagnose the problem.

Interactive Use of merps

Merps can be used interactively by supplying "-", "none", or "stdin" as the name of the mcf in the invocation, without redirecting the standard input from another source. While not essential, "-", "none", or "stdout" will generally be specified as the output file, so that the measurements and descriptive text will appear on the standard output and can be read. In addition, one will most likely want to employ either the -s, -v, or one of the -g(e) options in the interactive mode, either to generate descriptions and diagnostic information, or to view the data as it is measured.

In the interactive mode, the standard input is used as the source of the commands, and merps behaves differently in a number of ways. Firstly, merps prompts the user for input by printing ": " on the standard output at the end of each command. Secondly, the help command is functional, and prints a summary of the data and parameter commands for merps (E1). Thirdly, interrupts, normally fatal, are caught and return the user to the command level. Finally, the occurrence of certain errors simply aborts the command execution and returns the user to the command level rather than terminating merps (e.g. the inability to open a file).


MERPS
Tutorial Introduction and Reference Manual
Matt Marlow


© 2006 UCSD ERP Lab
Please send comments and suggestions to the ERPSS Webmaster