Code and Obtain Customized Planned Comparisons with 'appRiori'

With 'appRiori' , users upload the research variables and the app guides them to the best set of comparisons fitting the hypotheses, for both main and interaction effects. Through a graphical explanation and empirical examples on reproducible data, it is shown that it is possible to understand both the logic behind the planned comparisons and the way to interpret them when a model is tested.


appRiori

CRAN status R-CMD-check

appRiori is a Shiny app, distributed as an R package, that helps you code and obtain customized planned comparisons (a priori contrasts). You upload or pick a dataset, choose the research variables, and the app guides you to the set of comparisons that best fits your hypotheses, for both main effects and interactions. It shows the contrast and hypothesis matrices and generates the R code (base R and hypr) to use the contrasts in your own models.

The package also provides contrasts_summary(), which extracts the estimates and tests of hypr contrasts from a fitted lm, glm or lme4 model.

Installation

Install the released version from CRAN:

install.packages("appRiori")

or the development version from GitHub:

# install.packages("remotes")
remotes::install_github("Ugranziol/appRiori")

Usage

Start the app with:

library(appRiori)
appRiori()

The app opens in your browser. A tutorial with worked examples is available inside the app. Any argument of appRiori() is passed on to shiny::runApp(), for example appRiori(launch.browser = FALSE, port = 8080).

Once the contrasts are set with hypr, contrasts_summary() reports the results labelled with the hypotheses:

library(hypr)
df <- MASS::anorexia
h <- hypr(~ 1/2 * CBT + 1/2 * FT - Cont, ~ CBT - FT,
          levels = c("CBT", "Cont", "FT"))
contrasts(df$Treat, how.many = 2) <- cmat(h)
model <- lm(Prewt ~ Treat, data = df)
contrasts_summary(model)

Citation

If you use appRiori, please cite:

Granziol, U., Rabe, M., Gallucci, M., Spoto, A., & Vidotto, G. (2025). Not another post hoc paper: A new look at contrast analysis and planned comparisons. Advances in Methods and Practices in Psychological Science, 8(1). https://doi.org/10.1177/25152459241293110

In R, citation("appRiori") gives the reference in BibTeX format too.

Bug reports

Please report problems at https://github.com/Ugranziol/appRiori/issues.

License

GPL (>= 3)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("appRiori")

0.0.7 by Umberto Granziol, 6 hours ago


https://github.com/Ugranziol/appRiori


Report a bug at https://github.com/Ugranziol/appRiori/issues


Browse source code at https://github.com/cran/appRiori


Authors: Umberto Granziol [aut, cre] , Maximilian Rabe [aut] , Andrea Spoto [aut] , Giulio Vidotto [aut] , Marcello Gallucci [aut]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports dplyr, DT, hypr, markdown, MASS, pracma, rhandsontable, shiny, shinythemes, sortable, stringr

Suggests lme4, testthat


See at CRAN