BioRender uses R (version 4.2.2) to compute results for all statistical analyses.
Packages and functions used for specific statistical analyses are listed below.
All R packages
- R version 4.2.2
- rstatix version 0.7.1
- multcomp version 1.4-20
- PMCMRplus version 1.9.6
- dplyr version 1.0.10
- tidyr version 1.3.0
- rjson version 0.2.21
- logger version 0.2.2
- tictoc version 1.1
- jsonlite version 1.8.4
- httr version 1.0.0
- effsize version 0.8.1
- nlraa version 1.9.3
- afex version 1.3-1
- emmeans version 1.10.1
Statistical assumption checks
Our platform automatically runs tests to verify assumptions essential for each analysis type. We suggest preselected analysis options based on these results. Hovering over 'suggested' pills in the app reveals details about these recommendations.
Shapiro-Wilk test of normality
Parametric t-test and ANOVA have the underlying assumption that your dataset is normally distributed (follows a standard bell-curve). We run the Shapiro-Wilk test of normality in the background to check if your dataset violates this assumption. If the Shapiro-Wilk test (p > 0.05) confirms normality, we recommend parametric tests. If not, we suggest nonparametric alternatives (Mann-Whitney U, Wilcoxon matched pairs, or Kruskal-Wallis). This check uses the shapiro_test function from rstatix.
Levene’s test of equal variances
Parametric t-test and ANOVA have the underlying assumption that the variance in observations in different groups in your data is approximately the same. We run Levene’s test of equal variances to check if your dataset violates this assumption. If variances differ, we recommend Welch’s correction to accommodate unequal variances in t-tests or ANOVA. This check uses the levene_test function from rstatix.
Mauchly’s test of sphericity
Mauchly’s test verifies assumptions for repeated-measures ANOVA by checking for consistent variance across factor levels. If the differences vary significantly, the Greenhouse-Geisser correction is applied to the comparisons where sphericity is violated. You can also select this correction to be applied regardless of the outcome of Mauchly’s test. We use the automatically generated correction from aov_car.
Two-sample t-test (and nonparametric tests)
Unpaired two-sample t-test
We use the function t_test from the rstatix package, passing paired=FALSE, var.equal=TRUE and detailed=TRUE to get detailed results.
Unpaired two-sample t-test with Welch’s correction (aka Welch’s t-test)
We use the function t_test from the rstatix package, passing paired=FALSE, var.equal=FALSE and detailed=TRUE to get detailed results.
Mann-Whitney U test
We use the function wilcox_test from the rstatix package, passing paired=FALSE and detailed=TRUE to get detailed results.
Paired t-test
We use the function t_test from the rstatix package, passing paired=TRUE and detailed=TRUE to get detailed results.
Wilcoxon matched-pairs signed ranks test
We use the function wilcox_test from the rstatix package, passing paired=TRUE and detailed=TRUE to get detailed results.
One-way ANOVA (and nonparametric tests) and multiple comparisons tests
One-way ANOVA
We use the aov_car function from the afex package for all variations of ANOVA. We determine the sums of squares based on the ANOVA formula; if it is an independent samples one-way ANOVA, we use type II; for all other comparisons, we use type III. For repeated measures one-way ANOVA, we specify whether to apply the Greenhouse-Geisser correction; by default, this value is set to ‘auto’ so only the comparisons where sphericity was violated are corrected.
One-way ANOVA with Welch’s correction (aka Welch’s one-way ANOVA)
We use the function welch_anova_test from the rstatix package.
Kruskal-Wallis test
We use the function kruskal_test from the rstatix package.
Friedman test
We use the function friedman_test for nonparametric one-way repeated measures analysis of variance by ranks from the rstatix package.
Tukey multiple comparisons test
We use emmeans with the Tukey method (adjust = “tukey”) for post-hoc pairwise comparisons following ANOVA. By passing the aov object to emmeans, we calculate estimated marginal means (group averages) for each level of the factor being analyzed. The Tukey method adjusts for multiple comparisons to ensure accurate control over Type I error, making it suitable for comparing every pair of group means.
Note: emmeans is conservative in how it estimates degrees of freedom for post-hoc tests, which may lead to slightly different results than other methods. This approach aims to provide robust control over Type I errors, particularly for smaller datasets or complex models.
Bonferroni multiple comparisons test
Our Bonferroni test uses the same approach as the Tukey test, passing the aov object to emmeans to calculate estimated marginal means for each group. However, we specify adjust = "bonferroni" to apply the Bonferroni correction. This adjustment is more conservative, reducing the significance level for each comparison to control for multiple testing, which helps lower the risk of false positives when comparing specific pairs of means.
Dunnett multiple comparisons test
We use the function glht from the package multcomp, and specify “Dunnett” to the multiple comparison function mcp. We calculate confidence intervals and means using confint and mean.
Games-Howell multiple comparisons test
We use the function games_howell_test from the rstatix package. We divide the standard error from the result by sqrt(0.5) as that is more common to report. We pass detailed=TRUE to get more detailed results.
Dunnett T3 multiple comparisons test
We use the dunnetT3Test function from the PMCMRplus package. We manually calculate the degrees of freedom from the sample size and variance of each group. We also calculate the standard error of the difference and confidence intervals.
Dunn multiple comparisons test
We use the function dunn_test from the rstatix package, passing p.adjust.method="bonferroni"and detailed=TRUE to get detailed results.
Two-way ANOVA and multiple comparisons tests
Two-way ANOVA
For two-way ANOVA, we follow the same approach as for one-way ANOVA, using the aov_car function from the afex package with type III sums of squares. For repeated measures two-way ANOVA, we specify the Greenhouse-Geisser correction setting as auto, so sphericity corrections are applied only when the assumption of sphericity is violated.
Tukey multiple comparisons test
For two-way ANOVA, we use the same approach with emmeans as in one-way ANOVA for post-hoc tests. We pass the two-way ANOVA model to emmeans, specifying adjust = "tukey" for Tukey’s test. This method calculates pairwise comparisons across all factor combinations, applying the Tukey correction to control for multiple comparisons.
Bonferroni multiple comparisons test
For Bonferroni adjustments, we follow the same steps but specify adjust = "bonferroni" within emmeans. This method applies the Bonferroni correction to each pairwise comparison, offering a conservative control over Type I error rates across multiple comparisons in two-way ANOVA models.
Dunnett multiple comparisons test
We use the function glht from the package multcomp, and specify “Dunnett” to the multiple comparison function mcp. We calculate confidence intervals and means using confint and mean.
Linear regression
From the base R stats library, we use the lm function to fit linear models to the data, passing in the appropriate formula based on user-defined constraints (e.g. y-intercept = 0). The residuals function is used to extract residuals from the fitted model, with df.residual used to get the degrees of freedom of those residuals. The predict function is used for predicting values at regular linear intervals based on the fitted model, enabling us to display the best-fit line in rendered graphs, along with the qt function used to get quantiles.
Note that a separate regression line is fitted for each predictor if there are multiple predictors. At the moment, only the interaction term takes into account the multiple regression model.
Dose response analysis
From the stats library, we use the nls function to fit nonlinear models to the data, passing in formulae for stimulation or inhibition as well as other parameters based on constraints the user specifies. The confint function is used to calculate confidence intervals of model parameters to 95%. Additionally, the coef function allows us to extract the coefficients of the fitted models to be displayed in the analysis results. From the nlraa library, we use the predict_nls function (with 250 simulations) for predicting responses at a linear or logarithmic interval based on the fitted models, enabling us to display the best-fit curve in rendered graphs.
Was this article helpful?
Articles in this section
- Creating heatmaps in BioRender graph
- Keeping Your Graph Data Secure in BioRender
- BioRender Graph
- Creating a new graph file
- How to enter data into the spreadsheet
- Performing a statistical analysis
- How to customize your graph
- How to change your data format
- How to plot and analyze continuous (XY) data in BioRender Graph
- Exporting your BioRender graph