R: Functions to Streamline Statistical Analysis and Reporting

# Functions to Streamline Statistical Analysis and Reporting

## Documentation for package ‘colleyRstats’ version 0.2.0

- DESCRIPTION file
- User guides, package vignettes and other documentation
- Package NEWS
- Package README

## Help Pages

%!in% | Negate '%in%' membership
add_pareto_emoa_column | Add 'PARETO_EMOA' Column to a Data Frame
add_pareto_moocore_column | Add 'PARETO_MOOCORE' Column to a Data Frame
analyze_and_report | Analyze one dependent variable and produce everything a paper needs
animate_mobo2 | Animate a Multi-objective Optimization Plot
assumption_methods_text | Methods-section sentence justifying the test selection
checkAssumptionsForAnova | Check the assumptions for an ANOVA with a variable number of factors: Normality and Homogeneity of variance assumption.
check_assumptions_anova | Check the assumptions for an ANOVA with a variable number of factors: Normality and Homogeneity of variance assumption.
check_homogeneity_by_group | Check homogeneity of variances across groups
check_normality_by_group | Check normality for groups
check_questionnaire | Show how a questionnaire will be scored, before scoring it
cite_methods | Citations and methods boilerplate for the analyses used
classify_outcome | Classify the measurement scale of an outcome variable
colleyRstats_setup | Configure Global R Environment for colleyRstats
colley_theme | The colleyRstats ggplot2 theme
debug_contr_error | Debug contrast errors in ANOVA-like models
define_questionnaire | Register your own questionnaire
define_result_macro | Define a named LaTeX macro for a single result (single source of truth)
emit_name_macros | Generate \newcommand stubs for variable/factor names
emit_overleaf | Bundle an analysis into an Overleaf-ready folder
expand_latex_macros | Expand the colleyRstats LaTeX macros to plain standard LaTeX
figure_base_size | Base font size for a figure of a given width
fit_recommended | Fit the model that the data call for, and report it
generateEffectPlot | Function to define a plot, either showing the main or interaction effect in bold.
generateMoboPlot | Generate a Multi-objective Optimization Plot
generateMoboPlot2 | Generate a Multi-objective Optimization Plot
ggbetweenstatsWithPriorNormalityCheck | Check the data's distribution. If non-normal, take the non-parametric variant of _ggbetweenstats_. x and y have to be in parentheses, e.g., "ConditionID".
ggbetweenstatsWithPriorNormalityCheckAsterisk | Check the data's distribution. If non-normal, take the non-parametric variant of _ggbetweenstats_. x and y have to be in parentheses, e.g., "ConditionID".
ggwithinstatsWithPriorNormalityCheck | Check the data's distribution. If non-normal, take the non-parametric variant of _ggwithinstats_. x and y have to be in parentheses, e.g., "ConditionID".
ggwithinstatsWithPriorNormalityCheckAsterisk | Check the data's distribution. If non-normal, take the non-parametric variant of _ggwithinstats_. x and y have to be in parentheses, e.g., "ConditionID". Add Asterisks instead of p-values.
latexify_report | Transform text from 'report::report()' into LaTeX-friendly output.
latex_escape | Escape LaTeX special characters in plain text
latex_preamble | LaTeX preamble required by the report functions
list_questionnaires | List the questionnaires this package can score
na.zero | Replace NA values with zero
normalize | This function normalizes the values in a vector to the range [new_min, new_max] based on their original range [old_min, old_max].
not_empty | Ensure input is not empty
not_in | Negate '%in%' membership
n_fun | Build a median/size label for plot annotations
pathPrep | Convert Windows paths to R-friendly format
plot_between_stats | Check the data's distribution. If non-normal, take the non-parametric variant of _ggbetweenstats_. x and y have to be in parentheses, e.g., "ConditionID".
plot_between_stats_asterisk | Check the data's distribution. If non-normal, take the non-parametric variant of _ggbetweenstats_. x and y have to be in parentheses, e.g., "ConditionID".
plot_effect | Function to define a plot, either showing the main or interaction effect in bold.
plot_mobo | Generate a Multi-objective Optimization Plot
plot_mobo2 | Generate a Multi-objective Optimization Plot
plot_within_stats | Check the data's distribution. If non-normal, take the non-parametric variant of _ggwithinstats_. x and y have to be in parentheses, e.g., "ConditionID".
plot_within_stats_asterisk | Check the data's distribution. If non-normal, take the non-parametric variant of _ggwithinstats_. x and y have to be in parentheses, e.g., "ConditionID". Add Asterisks instead of p-values.
questionnaire_items | The items of one questionnaire
recommend_analysis | Recommend a principled analysis for one outcome
recommend_test | Recommend a principled analysis for one outcome
remove_outliers_REI | Flag suspicious survey responses via the Response Entropy Index (REI)
replace_values | Replace values across a data frame
reportART | Generate the Latex-text based on the ARTool (see <https://github.com/mjskay/ARTool>). The ART result must be piped into an anova(). Only significant main and interaction effects are reported. P-values are rounded for the third digit. Attention: Effect sizes are not calculated! Attention: the independent variables of the formula and the term specifying the participant must be factors (i.e., use as.factor()).
reportArtCon | Report significant ART contrasts (art.con) as LaTeX text
reportArtConTable | Report ART contrasts (art.con) as a LaTeX table. Customizable with sensible defaults. Companion to 'reportDunnTestTable()'.
reportCLMM | Report a cumulative link (mixed) model in LaTeX/APA style
reportDunnTest | Report dunnTest as text. Required commands in LaTeX: '\newcommand{\padjminor}{\textit{p$_{adj}<$}}' '\newcommand{\padj}{\textit{p$_{adj}$=}}' '\newcommand{\rankbiserial}[1]{$r_{rb} = #1$}'
reportDunnTestTable | report Dunn test as a table. Customizable with sensible defaults. Required commands in LaTeX: '\newcommand{\padjminor}{\textit{p$_{adj}<$}}' '\newcommand{\padj}{\textit{p$_{adj}$=}}' '\newcommand{\rankbiserial}[1]{$r_{rb} = #1$}'
reportggstatsplot | Report statistical details for ggstatsplot.
reportggstatsplotPostHoc | Report significant post-hoc pairwise comparisons
reportGLMM | Report a (generalized) linear mixed model in LaTeX/APA style
reportMeanAndSD | Report the mean and standard deviation of a dependent variable for all levels of an independent variable rounded to the 2nd digit.
reportNparLD | Report the model produced by nparLD. The model provided must be the model generated by the command 'nparLD' 'nparLD' (see <https://CRAN.R-project.org/package=nparLD>).
reportNPAV | Generate the Latex-text based on the NPAV by Lüpsen (see <https://www.uni-koeln.de/~luepsen/R/>). Only significant main and interaction effects are reported. P-values are rounded for the third digit and partial eta squared values are provided when possible. Attention: the independent variables of the formula and the term specifying the participant must be factors (i.e., use as.factor()).
report_all | Analyze and report several dependent variables at once
report_art | Generate the Latex-text based on the ARTool (see <https://github.com/mjskay/ARTool>). The ART result must be piped into an anova(). Only significant main and interaction effects are reported. P-values are rounded for the third digit. Attention: Effect sizes are not calculated! Attention: the independent variables of the formula and the term specifying the participant must be factors (i.e., use as.factor()).
report_art_con | Report significant ART contrasts (art.con) as LaTeX text
report_art_con_table | Report ART contrasts (art.con) as a LaTeX table. Customizable with sensible defaults. Companion to 'reportDunnTestTable()'.
report_clmm | Report a cumulative link (mixed) model in LaTeX/APA style
report_dunn_test | Report dunnTest as text. Required commands in LaTeX: '\newcommand{\padjminor}{\textit{p$_{adj}<$}}' '\newcommand{\padj}{\textit{p$_{adj}$=}}' '\newcommand{\rankbiserial}[1]{$r_{rb} = #1$}'
report_dunn_test_table | report Dunn test as a table. Customizable with sensible defaults. Required commands in LaTeX: '\newcommand{\padjminor}{\textit{p$_{adj}<$}}' '\newcommand{\padj}{\textit{p$_{adj}$=}}' '\newcommand{\rankbiserial}[1]{$r_{rb} = #1$}'
report_ggstatsplot | Report statistical details for ggstatsplot.
report_ggstatsplot_posthoc | Report significant post-hoc pairwise comparisons
report_glmm | Report a (generalized) linear mixed model in LaTeX/APA style
report_mean_sd | Report the mean and standard deviation of a dependent variable for all levels of an independent variable rounded to the 2nd digit.
report_nparld | Report the model produced by nparLD. The model provided must be the model generated by the command 'nparLD' 'nparLD' (see <https://CRAN.R-project.org/package=nparLD>).
reshape_data | Reshape Excel Data Based on Custom Markers and Include Custom ID Column
reverse_code | Reverse-code responses
rFromNPAV | Calculation based on Rosenthal's formula (1994). N stands for the _number of measurements_.
rFromWilcox | Calculation based on Rosenthal's formula (1994). N stands for the _number of measurements_.
rFromWilcoxAdjusted | rFromWilcoxAdjusted
save_paper_figure | Save a plot with publication-ready defaults
score_questionnaire | Score a standardised questionnaire
score_reliability | Internal consistency of a questionnaire's subscales
stat_sum_df | Generating the sum and adding a crossbar.
summarize_sickness | Summarise a motion-sickness time course
use_colleyrstats_sty | Write colleyRstats.sty into a project (for Overleaf)
use_study_project | Scaffold a reproducible study analysis