compute.IxyI: Calulating the time elapsed between events in a simulation

Description Usage Arguments Details See Also Examples

Description

Given some data from either an experiment or a simulation, the time that elapsed between two kinds of specified events is computed for all instances of the pairing of the two events. The generic description of this elapsed time is the "IxyI" time, read as the "inter-x-y-interval". When x=y, and x = a time at which responses occurred, then the IxyI is an inter-response time (IRT). For another example, when x != y, x = a time at which a reinforcement delivery occurred and y = a time at which a response occured, then the IxyI is a post-reinforcement pause. Functionality is included for skipping over specific events (such as Computing IRTs, while excluding the IRTs with an intervening reinforcement delivery). Further functionality is included for adding an offset to the x_event, for example, if computing the post-reinforcement pause, it is desirable to subtract out the reinforcement delivery.

Usage

1
2
3
4
5
6
7
compute.I_xx_I.analysis_object(data, x_event, break_event, x_offset = 0)

compute.I_xx_I.sim_analysis_object(data, x_event, break_event, x_offset = 0)

## S4 method for signature 'dataset'
compute.IxyI(data, x_event, x_offset = 0,
  y_event = "NONE", break_event = "ALL")

Arguments

data

A analysis_object or simulation_analysis_object.

x_event

A character string specifying the "x" in "IxyI".

break_event

A character vector specifying the break events over which the "IxyI" or "IxxI" cannot be computed over. Defaults to "ALL" for which only the "IxyI", where "y" must immediate follow "x" is computed. Also takes "NONE" for which the "IxyI" is calculated for all "y" that follow "x" regardless of the intervening events.

x_offset

A numeric specifying the duration of the "x". Defaults to 0.

y_event

A character specifying the "y" in "IxyI". Defaults to NULL, which means the function computes the "IxxI".

Details

With respect to efficiency, the compute.IxyI method for simulation_analysis_object is anywhere between twice to five times as fast as the method for analysis_object. However, to achieve a noticible difference in actual time, the functions would need to be run on the order of 10000 times.

In cases where there is only once instance of a particular event, the value returned is a single Inf. An example is for the calculation of the inter-response times when only once response occurs during a simulation. Another example is is for the calculation of post-reinforcement pauses, but no responses follow a reinforcement delivery.

When the compute.IxyI is called for objects of class dataset.R, a list of the requested statistic is computed.

See Also

class.analysis_object For constructing arguments for data parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#Suppose "d" is your data in an "analysis_object", "resp_time" is the response time, "rft_time" is the reinforcement time
#Compute the inter-response times, including those with intervening reinforcement deliveries
irts_inc_rft = compute.IxyI( d, x_event = "resp_time" )
#Compute the IRTs excluding those with intervening rft deliveries
irts = compute.IxyI( d, x_event = "resp_time", break_event = "rft_time" )

#Compute post-rft pauses including rft duration
prp = compute.IxyI( d, x_event = "rft_time", y_event = "resp_time" )
#Compute prp excluding rft duration, if rft duration is 3
prp_less_rft = compute.IxyI( d, x_event = "rft_time", y_event = "resp_time", x_offset = -3 )

Don-Li/CAB_original documentation built on May 6, 2019, 2:53 p.m.