'iat.score' computes the IAT score for an individual subject according to
the "improved algorithm" recommended in Table 4 of
Greenwald, A. G., Nosek, B. A., & Banaji, M. (2003).  Understanding and
using the implicit association test: I. An improved scoring algorithm.
Journal of Personality and Social Psychology, 85(2), 197-216.
'var.names' must specify the names of the latency variable
and the factor that codes for blocks of trials.
'SR.tasks' lists the levels of the blocking variable that are used
to compute the IAT score.  'SR.tasks' can be specified either as a numeric
vector of length 2*k, or as a character vector of length 2*k.  It is
assumed that k is at least equal to 1; typically k = 2.  It is assumed
that the first k levels specified by 'SR.tasks' represent data from one
stimulus/response (SR) task, and the second k levels represent the
opposite SR task (compatible SR task versus incompatible SR task).
'SR.tasks[i]' is paired with 'SR.tasks[k+i]' for i = 1, ..., k. If
'SR.tasks' is numeric and the blocking variable is a factor,
the numeric codes for the levels of the blocking factor are
extracted in order to determine which levels are specified
by 'SR.tasks'.  If 'SR.tasks' is a character vector, then the
blocking variable must be a factor, and 'SR.tasks' must name
the levels of the blocking variable to use in the computation of
the IAT score.
If 'SR.tasks' has length 2*k, the IAT score that is the mean
difference between the first k blocks and the second k blocks, after
cleaning up the data according to the procedure described below, or
in much more detail in Greenwald et al. (2003).
Greenwald et al. (2003) state that the performance of the
improved algorithm is about the same whether or not latencies below
400 ms. are dropped.  When 'drop.low = NA' (the default), these
observations are not dropped; this is the standard version of the
improved algorithm.  If 'drop.low' is a positive number, then all
latencies strictly shorter than 'drop.low' will be dropped from the
analysis (set to NA).
If 'sd.correct.only = TRUE', the pooled standard deviations (SDs)
are computed with only the latencies of correct responses.  If FALSE,
all latencies within the relevant blocks are used for computing the SDs
It is permissible for the input dataframe to have more
variables than just the latency and blocking variable, but
these variables will be ignored in the computation of the default
output (they will be included in the output if the output is a dataframe or
if they are listed in 'other.vars').
If 'other.vars' is non-null, then the values of the other
variable are included in the output.  If 'other.vars' are non-constant,
then a warning message is generated to indicate that only the first value
of 'other.vars' was used.
If 'output = iat' and 'other.vars = NULL' (default), the output
is a single number, the IAT score for the inputted data; if
'output = iat' and 'other.vars' is a vector of other variable names,
then the output is a vector or one-row dataframe that contains
the IAT score and the values of the other variables.  If `output =
'data'`, the output is a dataframe that is identical to the input dataframe
with the addition of a new variable representing the response
latencies that have been modified as specified in the improved algorithm
cited above.  The output is NA if more than 10% of trials have
latency < 300 ms.