ALL Metrics
-
Views
-
Downloads
Get PDF
Get XML
Cite
Export
Track
Software Tool Article

rmcorrShiny: A web and standalone application for repeated measures correlation

[version 1; peer review: 2 approved]
PUBLISHED 30 Jul 2021
Author details Author details
OPEN PEER REVIEW
REVIEWER STATUS

This article is included in the RPackage gateway.

This article is included in the Software and Hardware Engineering gateway.

Abstract

We describe a web and standalone Shiny app for calculating the common, linear within-individual association for repeated assessments of paired measures with multiple individuals: repeated measures correlation (rmcorr). This tool makes rmcorr more widely accessible, providing a graphical interface for performing and visualizing the output of analysis with rmcorr. In contrast to rmcorr, most widely used correlation techniques assume paired data are independent. Incorrectly analyzing repeated measures data as independent will likely produce misleading results. Using aggregation or separate models to address the issue of independence may obscure meaningful patterns and will also tend to reduce statistical power. rmcorrShiny (repeated measures correlation Shiny) provides a simple and accessible solution for computing the repeated measures correlation. It is available at: https://lmarusich.shinyapps.io/shiny_rmcorr/.

Keywords

repeated measures correlation, statistics, multilevel modeling, Shiny, correlation, regression, repeated measures, within-participants

Introduction

The most common techniques for calculating the correlation between two variables (e.g., the Pearson correlation coefficient) assume that each pair of data points arises from an independent observation. Take, for example, a study that calculates the correlation between age and the volume of a specific brain region for a sample of people. In this example, each individual contributes a data point consisting of a brain volume and an age. However, it is not uncommon for studies to use repeated measures designs, such as a study by Raz et al.1 that collected the brain region volume and age at two different time points. Each participant in this study contributed two (repeated) data points of paired measures. Repeated measures of the same individual are no longer independent observations and should not be analyzed as such. Erroneously modeling repeated measures data as independent observations is surprisingly prevalent in published research, even though such results will generally be misleading.2-4 A common way to resolve this problem is to use aggregated data: first taking an average of the repeated measures data of each person so that every individual again contributes a single paired data point, and then calculating the correlation from these averages (between-participants). Another possibility is to use separate models to analyze each paired data point, removing the dependency. For example, the study by Raz et al.1 computed separate correlations between brain region volume and age at each of the two time points.

Instead of aggregation or separate models, an alternative solution is to calculate the repeated measures correlation,5-7 which assesses the common intra-individual (within-participants) association for paired repeated measures data. The repeated measures correlation technique is conceptually similar to a null multilevel model, with a common (fixed effect) slope but varying (random effect) intercept for each individual. Calculating the repeated measures correlation has multiple potential benefits. It is simpler and more straightforward to implement than a multilevel model, with the potential for much greater statistical power than aggregation. In addition, repeated measures correlation can provide insights into patterns within individuals that may be obscured by aggregation or use of separate models.5

We previously developed the rmcorr package8 in R9 to make the repeated measures correlation technique widely available for researchers; it has since also been adapted as a function in the Pingouin statistics package10 for Python. However, the use of both of these packages requires some facility with programming languages, which may limit accessibility.

Methods

Implementation

Here we introduce rmcorrShiny, a Shiny11 app, which provides an intuitive graphical interface for computing and plotting the repeated measures correlation. An example of the interface is shown in Figure 1.

788883f8-5984-4d2b-8418-e9e10684eb9a_figure1.gif

Figure 1. Graphical interface for rmcorrShiny.

The interface consists of two panels, corresponding roughly to input (left) and output (right), with each containing multiple subpanels or tabs. The left panel has tabs for Input: uploading data or using sample data, Data Options: selecting variables for analysis, and Plot Options: customizing labels and plot appearance. The right panel has tabs for Results: statistical output from rmcorr, Plot: corresponding visualization of the rmcorr results, R code: the custom R code generating the analysis and plot for the selected data/options, Processed Data: summary statistics on data and raw viewer, Download: buttons to download the plot and generated R code, and About: information about the app.

The primary features of rmcorrShiny include:

  • The ability to import data in a variety of different file formats or to use one of four included sample datasets, described below.

  • Options for bootstrapping the confidence interval (CI) for the rmcorr effect size.

  • The display of raw data and the output from rmcorr as well as formatted output for reporting scientific results.

  • Multiple options to generate and customize rmcorr plots, making use of the ggplot2 package12,13 and palettes from the RColorBrewer14 and pals15 packages.

  • Customized R code generated using the data and options chosen by the user that can be directly pasted and executed in R to produce the same output as in rmcorrShiny, or as a starting point for additional customization in R.

  • The ability to download plots (in multiple file formats) or a .zip file of all output.

Note that many features in rmcorrShiny, including the panel interface, were based on modifications of code from the Raincloud-shiny app.16

Operation

rmcorrShiny can be used in a web browser here, or the package can be installed from Github and run locally in R, using the following commands:

devtools::install_github("lmarusich/rmcorrShiny")library(rmcorrShiny)rmcorrShiny::rmcorrShiny()

Use case

As a use case, we use rmcorrShiny to compute and plot the repeated measures correlation of raz20051, one of the four included sample datasets. The right panel of Figure 2 shows the rmcorr plot for this data. Because a variety of patterns in data can produce similar or even identical statistical results for rmcorr, as well as other models, we highly recommend visualization to aid in interpreting results. In Figure 2, the x-axis is age and the y-axis is volume of a brain area, the cerebellar hemisphere. Each participant, plotted in a different color, contributes two paired data points representing two assessments of age and brain volume. Paired age and brain volume were measured twice per participant about five years apart. The corresponding lines depict the repeated measures correlation model. Note the large negative slope and close fit of the lines to many of the data points. This shows a strong pattern of a common decrease in the volume of this brain area over time, across different ages. The lower left corner of the plot shows the effect size for rmcorr and its p-value.

788883f8-5984-4d2b-8418-e9e10684eb9a_figure2.gif

Figure 2. Plot options and rmcorr plot of sample neuroscience dataset raz2005.1

As mentioned previously, the pattern of results may vary, depending on whether the analysis is within- or between-individuals.17,18 This can be observed in the current example; when the raz2005 dataset is analyzed using aggregation or separate models (between-individual analyses), the magnitude of the negative association is diminished in comparison to rmcorr (within-individual analysis; see Figure 5 in Bakdash & Marusich5).

Limitations

rmcorrShiny has the advantage of making the useful and already fairly simple-to-use rmcorr technique even more accessible and easy to implement and interpret. However, its limitations are the same as rmcorr’s: it does not have all of the capabilities of multilevel modeling and thus it is not a replacement. We recommend using multilevel modeling if: there are more than two variables of interest (in addition to participants or subjects), data with more than two levels, simultaneous modeling of within- and between-participants is needed, visual patterns suggest varying slopes by individual and/or non-linear associations, or time needs to be explicitly included in the model (i.e., modeling change over time as a separate variable; note in Figure 2 age is a measure of time, but it is not a separate variable). For more information about multilevel modeling, see Aarts et al.2 and the About tab in rmcorrShiny.

Conclusion

This paper demonstrates the rmcorrShiny app for graphing and analyzing paired, repeated measures data without requiring programming knowledge. By increasing the accessibility of the rmcorr technique, we aim to increase analyses of patterns within-participants as an alternative to other approaches. Such approaches include incorrectly modeling repeated measures data as independent, which is highly problematic, as well as analyses performed only on aggregated data or using separate models. In particular, this app may be useful for visualization and analysis of a common linear pattern across participants and could be a informative precursor complementing multilevel modeling.

Data availability

The rmcorrShiny app contains sample datasets from four previously published papers.

  • bland1995: Health science data with repeated measures, by participant, of pH (degree of base or acidity) and PaCO2 (partial pressure of carbon dioxide).6

  • gilden2010: Psychology data of reaction time and accuracy for a visual search task by participant, in four repeated blocks (both dependent measures are averaged by block).19

  • marusich2016: Psychology data of dyads working together to capture High Value Targets (lower task time is better performance) and their averaged Mission Awareness Rating Scale (MARS) score for each block, repeated three times. MARS evaluates subjective situation awareness (”knowing what is going on”), higher values indicate better situation awareness.20

  • raz2005: Neuroscience data containing the volume of a brain area (cerebellar hemisphere) measured twice per participant at two different ages, approximately 5 years apart.1

The csv files for datasets can be directly downloaded from Github (https://github.com/lmarusich/rmcorrShiny/tree/master/inst/shiny).

Software availability

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 30 Jul 2021
Comment
Author details Author details
Competing interests
Grant information
Copyright
Download
 
Export To
metrics
Views Downloads
F1000Research - -
PubMed Central
Data from PMC are received and updated monthly.
- -
Citations
CITE
how to cite this article
Marusich LR and Bakdash JZ. rmcorrShiny: A web and standalone application for repeated measures correlation [version 1; peer review: 2 approved]. F1000Research 2021, 10:697 (https://doi.org/10.12688/f1000research.55027.1)
NOTE: If applicable, it is important to ensure the information in square brackets after the title is included in all citations of this article.
track
receive updates on this article
Track an article to receive email alerts on any updates to this article.

Open Peer Review

Current Reviewer Status: ?
Key to Reviewer Statuses VIEW
ApprovedThe paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approvedFundamental flaws in the paper seriously undermine the findings and conclusions
Version 1
VERSION 1
PUBLISHED 30 Jul 2021
Views
23
Cite
Reviewer Report 21 Sep 2021
Emmeke Aarts, Department of Methodology and Statistics, Utrecht University, Utrecht, The Netherlands 
Sebastian Mildiner Moraga, Department of Methodology and Statistics Utrecht, Utrecht University, Utrecht, The Netherlands 
Approved
VIEWS 23
The authors present an online (and open source), user-friendly and very complete software tool within the R Shiny framework to infer the linear within-individual correlation for repeated observations within multiple individuals for two outcomes. The R shiny app is based ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Aarts E and Mildiner Moraga S. Reviewer Report For: rmcorrShiny: A web and standalone application for repeated measures correlation [version 1; peer review: 2 approved]. F1000Research 2021, 10:697 (https://doi.org/10.5256/f1000research.58566.r93337)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 01 Nov 2021
    Laura Marusich, U.S. Army Research Laboratory, USA
    01 Nov 2021
    Author Response
    • It is unclear what happens when the data includes missing observations. Will these cases be ignored using listwise deletion? It would be nice if the authors could provide a
    ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 01 Nov 2021
    Laura Marusich, U.S. Army Research Laboratory, USA
    01 Nov 2021
    Author Response
    • It is unclear what happens when the data includes missing observations. Will these cases be ignored using listwise deletion? It would be nice if the authors could provide a
    ... Continue reading
Views
35
Cite
Reviewer Report 10 Sep 2021
Ronan McGarrigle, Department of Psychology, University of Bradford, Bradford, UK 
Approved
VIEWS 35
The authors outline the development of a user-friendly software tool ('rmcorrShiny') for running repeated-measures correlation (rmcorr) analysis without the need for any prior programming knowledge. The paper provides a compelling rationale for the development of this novel tool and all ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
McGarrigle R. Reviewer Report For: rmcorrShiny: A web and standalone application for repeated measures correlation [version 1; peer review: 2 approved]. F1000Research 2021, 10:697 (https://doi.org/10.5256/f1000research.58566.r93336)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 08 Nov 2021
    Laura Marusich, U.S. Army Research Laboratory, USA
    08 Nov 2021
    Author Response
    • I received the following error message; 'Error: an error has occurred. Check your logs or contact the app author for clarification'. I'm sure there will be a very
    ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 08 Nov 2021
    Laura Marusich, U.S. Army Research Laboratory, USA
    08 Nov 2021
    Author Response
    • I received the following error message; 'Error: an error has occurred. Check your logs or contact the app author for clarification'. I'm sure there will be a very
    ... Continue reading

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 30 Jul 2021
Comment
Alongside their report, reviewers assign a status to the article:
Approved - the paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations - A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approved - fundamental flaws in the paper seriously undermine the findings and conclusions
Sign In
If you've forgotten your password, please enter your email address below and we'll send you instructions on how to reset your password.

The email address should be the one you originally registered with F1000.

Email address not valid, please try again

You registered with F1000 via Google, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Google account password, please click here.

You registered with F1000 via Facebook, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Facebook account password, please click here.

Code not correct, please try again
Email us for further assistance.
Server error, please try again.