Data visualization
We've written a paper on data visualization using ggplot2 in R. It has highly commented code for a wide variety of common data visualization situations (i.e., means, proportions, relationships).
Commented R code found here: [Link]
Cite for use: Hehman, E., & Xie, S.Y. (2021). Doing better data visualization. Advances in Methods and Practices in Psychological Science, 4, 1-18.
Based on paper found here: [Link]
Written by Eric Hehman and Sally Xie
Elastic net regularization pipeline
This is a modern model selection technique that employs regularization, which helps to find a balance between overall model error and complexity (i.e., number of variables in the model). Essentially this approach helps you determine which variables to retain in a parsimonious model of a dependent variable.
Commented R code found here: [Link]
Based on paper found here: [Link]
Written by Eric Hehman
Bootstrapping confidence intervals around ICCs
Researchers may wish to compare ICCs to one another. For instance, to test whether between-target variance in appearance (i.e., target-ICC) contributes to evaluations of women more so than men. This code modifies modifies the boot() function in R to bootstrap 95% confidence intervals around ICC estimates. The 95% CIs of each ICC can then be examined for overlap to determine if they are different.
Commented R code and tutorial found here: [Link]
Cite for use: Xie, S.Y., Flake, J.K., & Hehman, E. (2019). Perceiver and target characteristics contribute to impression formation differently across race and gender. Journal of Personality and Social Psychology, 117, 364-385.
Based on paper found here: [Link]
Written by Sally Xie
Estimating ICCs in cross-classified multilevel models
Estimating ICCs can inform researchers as to what percentage of variance in their variable of interest is coming from different levels of the multilevel model. For instance, research here uses these models to estimate the percentage of variance in person perception ratings originating from between-perceiver and between-target differences.
Commented R code and tutorial found here: [Link]
Based on paper found here: [Link]
Written by Eric Hehman
Sampling from data to assess when averages are stable
Across diverse areas of research, it is common to average a series of observations, and to use these averages in subsequent analyses. Research using this approach faces the challenge of knowing when these averages are stable. Meaning, to what extent do these averages change when additional observations are included? Using averages that are not stable introduces a great deal of error into any analysis. The current research develops a tool, implemented in R, to assess when averages are stable. Using a sequential sampling approach, it determines how many observations are needed before additional observations would no longer meaningfully change an average.
Commented R code and tutorial found here: [Link]
Based on working paper found here: [Link]
Written by Gabe Nespoli, Sally Xie, Eric Hehman
Group-mean centering for multilevel models
When using multilevel models, researchers will often want to group-mean center variables to aid in interpretability. This tool, implemented in R, centers variables by group/cluster.
Commented R code available here: [Link]
Written by Doc Edge; Modified by Eric Hehman, Sally Xie
Spatial disorder analysis for mouse-tracking
When using mouse-tracking, researchers may want to compare the complexity of mouse-trajectories across conditions, discussed more here [Link]. This code calculates a measure of spatial disorder, which can be thought of as a more sophisticated metric of x-flips.
Commented Python code available here: [Link]
Cite for use: Hehman, E., Stolier, R.M., & Freeman, J.B. (2015). Advanced mouse-tracking analytic techniques for enhancing psychological science. Group Processes and Intergroup Relations, 18, 384-401.
Written by Ryan Stolier; modified by Sally Xie