mt_check_bimodality: Assess bimodality of mouse-tracking measure distributions.

View source: R/bimodality.R

mt_check_bimodalityR Documentation

Assess bimodality of mouse-tracking measure distributions.

Description

Assess bimodality of the distribution of mouse-tracking measures using the bimodality coefficient and Hartigan's dip statistic (see Details). If bimodality should be assessed separately for different conditions, the corresponding variables can be specified under grouping_variables.

Usage

mt_check_bimodality(
  data,
  use = "measures",
  use_variables = NULL,
  methods = c("BC", "HDS"),
  B = 2000,
  grouping_variables = NULL,
  ...
)

Arguments

data

a mousetrap data object created using one of the mt_import functions (see mt_example for details).

use

a character string specifying which data should be used. By default, points to the measures data.frame created using mt_measures.

use_variables

a vector specifying for which mouse-tracking measures bimodality should be assessed.

methods

a character string (or vector) specifying which methods should be used for assessing bimodality (see Details).

B

an integer specifying the number of replicates used in the Monte Carlo test (only relevant if "HDS_sim" is included in methods, see Details).

grouping_variables

a character string (or vector) specifying one or more variables in data[["data"]]. If specified, bimodality will be assessed separately for each level of the variable. If unspecified (the default), bimodality is checked across all trials.

...

additional arguments passed on to mt_reshape (such as subset).

Details

Different methods have been suggested for assessing the bimodality of mouse-tracking measure distributions, each of which has advantages and disadvantages (see Freeman & Dale, 2013).

Hehman et al. (2015) focus on two specific methods (bimodality coefficient and Hartigan's dip statistic) which are implemented here.

If methods include BC, the bimodality coefficient is calculated using the bimodality_coefficient function in this package. According to Freeman and Ambady (2010), a distribution is considered bimodal if BC > 0.555.

Note that MouseTracker (Freeman & Ambady, 2010) standardizes variables within each subject before computing the BC. This is also possible here using mt_standardize (see Examples).

If methods include HDS, Hartigan's dip statistic is calculated using the dip.test function of the diptest package. The corresponding p value (computed via linear interpolation) is returned.

If methods include HDS_sim, Hartigan's dip statistic is calculated using the dip.test function with the additional argument simulate.p.values=TRUE. In this case, the p value is computed from a Monte Carlo simulation of a uniform distribution with B (default: 2000) replicates.

Value

A list of several data.frames. Each data.frame contains the value returned by the respective method for assessing bimodality (see Details) - separately per condition (specified in the row dimension) and measure (specified in the column dimension).

Author(s)

Pascal J. Kieslich

Felix Henninger

References

Freeman, J. B., & Ambady, N. (2010). MouseTracker: Software for studying real-time mental processing using a computer mouse-tracking method. Behavior Research Methods, 42(1), 226-241.

Freeman, J. B., & Dale, R. (2013). Assessing bimodality to detect the presence of a dual cognitive process. Behavior Research Methods, 45(1), 83-97.

Hehman, E., Stolier, R. M., & Freeman, J. B. (2015). Advanced mouse-tracking analytic techniques for enhancing psychological science. Group Processes & Intergroup Relations, 18(3), 384-401.

See Also

bimodality_coefficient for more information about the bimodality coefficient.

dip.test for more information about Hartigan's dip test.

Examples

# Calculate measures
mt_example <- mt_measures(mt_example)

# Assess bimodality for untransformed variables
mt_check_bimodality(mt_example,
  use_variables=c("MAD", "AD"))

# Standardize variables per participant
mt_example <- mt_standardize(mt_example,
  use_variables=c("MAD", "AD"), within="subject_nr")
  
# Assess bimodality for standardized variables
mt_check_bimodality(mt_example,
  use_variables=c("z_MAD", "z_AD"))

# Assess bimodality with simulated p values for HDS
mt_check_bimodality(mt_example,
  use_variables=c("z_MAD", "z_AD"),
  methods=c("BC", "HDS_sim"))
 
# Assess bimodality per condition
mt_check_bimodality(mt_example,
  use_variables=c("z_MAD", "z_AD"),
  grouping_variables="Condition")
                    

PascalKieslich/mousetrap documentation built on Jan. 31, 2024, 9:26 p.m.