rtclean: Function for Trimming Outlier Response Times

Description Usage Arguments Value

Description

Forthcoming

Usage

1
2
3
rtclean(rt, exclude = 1, lowerBoundary = c(0.5, 0.5, 0, 0.8),
  upperBoundary = c(5, 5, 0.3, 0.95), method = "BFGS", maxit = 5000,
  nRep = 5, alpha = 0.95, cutoff = -2.9957)

Arguments

rt

a vector of response times.

exclude

if exclude equals 1, any response time that has a relative probability less that 0.5 under the inverse gaussian distribution is trimmed. If exclude equals 2, response times are probabilistically trimmed using the relative probabilities under the inverse gaussian and uniform distribution.

lowerBoundary

a vector defining the lower boundary for the range over which the starting values are generated.

upperBoundary

a vector defining the upper boundary for the range over which the starting values are generated.

method

determines the estimation method used by R's optim function.

maxit

the maximum number of iterations to run in the optimization routine.

nRep

the number of times to repeat the optimization routine with new starting values (higher values lead to a greater chance of avoiding local maxima at the cost of longer computational times).

alpha

the width of the confidence intervals for parameter estimates.

cutoff

a cutoff for excluding observations based on their relative probability under the inverse gaussian (default is .05).

Value

rtclean returns an object of class "cleanrt".

The function summary prints a comparison between the descriptive statistics for the original and trimmed data sets, anova reports the Akaike Information Criterion (AIC) values (corrected for small samples) and their relative weights for the set of 3 models fit to the data.

An object of class "cleanrt" is a list containing the following components:

rtNew

a vector with the newly trimmed response times.

rtOld

a vector of the untrimmed response times.

M1

the optim results for the inverse gaussian model.

M2

the optim results for the shifted inverse gaussian model.

M3

the optim results for the mixture model.

M3

a list with the AICc values and relative weights.

ProbIG

a vector with the relative probabilities of each observation under the shifted inverse gaussian distribution.

exclude_1

a logical vector for the response times selected for exclusion based on having a relative probability of less than 0.5 for the shifted inverse gaussian.

exclude_2

a logical vector for the response times selected for exclusion based on probabilistic sampling using the relative probabilities for the inverse gaussian and uniform distributions.


rettopnivek/rtclean documentation built on May 27, 2019, 5:55 a.m.