cufunctions, a package to facilitate statistical analyses in R

We have developed a comprehensive package of R functions, termed cufunctions,
      to facilitate the use of R to carry out simple as well as complex statistical analyses.
Two reasons: (1) While R is quite powerful, it is not user-friendly.
(2) Multiple R functions have to be invoked, each with little room for syntax error,
      to produce data summaries, tabulated results of analyses, and graphical output.
      With cufunctions, a single command is sufficient in place of multiple function calls.
We also provide a webtool with which to generate the R command you need for any particular analysis.
Instructions are provided to install the cufunctions package as well as the R packages it needs.
[Suggested citation: Holleran S, Ramakrishnan R (2021). cufunctions, a package to facilitate statistical analyses in R, http://biomath.net/cufunctions.html]

The following files are available for download
ctsa-stats-setup.pdf detailed instructions for setting up R, RStudio, cufunctions
R-crib-sheets.pdf summary of cufunctions, flow charts for which to use
cufun-rgen.html interactive tool to generate R commands for cufunctions
ctsa-R-flow charts.pptx Powerpoint with animation of flow charts for which cufunction to use

help (package=cufunctions) in R to list available cufunctions. Key public functions:

curead Reads the data from clipboard and returns a dataframe object for R functions
cutable1 Produces a Table 1 (summary stats for all and for subgroups, normality testing),
               with optional Box/bar/violin plots, p-values of group comparisons
cu1way continuous: One-way anova, post-hoc tests (parametric/nonparametric), bar/Box/violin graph with CLD (compact letter display)
              categorical: contingency tables, bar graph
cu2way continuous: Two-way anova (with/without interaction) and all possible post-hoc tests (parametric/nonparametric),
                    bar/Box/violin graph with CLD (compact letter display), partial F-tests vs all simpler nested models
              categorical: all possible contingency tables, bar graph
cucov1way One-way analysis of covariance (with/without interaction), all contrasts at different covariate levels,
                    scatterplot with predicted lines, partial F-tests vs all simpler nested models
cucov2way Two-way analysis of covariance (with/without interactions), all contrasts at different covariate levels,
                    scatterplot with predicted lines, partial F-tests vs all simpler nested models
cuscatter simple scatterplot with optional fitted line, not superior to Excel but provided so all plots have similar appearance
curepmeas continuous: Repeated measures one- or two-way anova (with/without interaction) and all possible post-hoc tests,
                         bar/Box/violin graphs of levels and differences, partial F-tests vs all simpler nested models
                         (optionally: additional covariates, all possible models, summary of best (or specified) model)
                   categorical: all possible contingency tables, bar graph
culinreg Multiple linear regression, all possible models ranked by Akaike, summary of best (or specified) model,
                added variable plots, likelihood ratio tests vs simpler models
cukm Kaplan-Meier survival analysis, survival or cumulative incidence curves with p-values, table of # at risk
culogist Logistic regression (first, Table of all predictors compared between dependent levels),
              all possible models ranked by Akaike, summary of best (or specified) model, ROC curve(s),
              AUC, summary table with best accuracy, likelihood ratio tests vs simpler models
cucox Cox modeling, all possible models ranked by Akaike, summary of best (or specified) model,
           ROC curves at specified times, Kaplan-Meier analysis of Cox score risk strata,
           predicted Kaplan-Meier curves for each factor, likelihood ratio tests vs simpler models

? function-name in R to get more information on using a function

Brief Instructions for installing cufunctions (greater detail in ctsa-stats-setup.pdf):
Ten CRAN packages are needed, which can be installed with two R commands:
reqpac = c("e1071","dunn.test","ggplot2","gmodels","ROCR","Hmisc","MuMIn","car","survminer","devEMF")
install.packages(reqpac, dependencies=T, type="binary", quiet=T, verbose=F)
[Exclude names of any packages you already have.]

The cufunctions package itself is installed with a single R command:
install.packages("http://biomath.net/resources/cufunctions.tar.gz",repos=NULL,type="source")

To use the cufunctions package,
require(cufunctions)
once in a session. Or, include the require command in your .Rprofile. If you don't use .Rprofile,
download.file("http://biomath.net/resources/.Rprofile", ".Rprofile", quiet=T)
just once, prior to installing cufunctions, with no need for require subsequently.

All comments and criticisms are appreciated -
Steve Holleran (retired) sfh2@columbia.edu
Sekhar Ramakrishnan sekhar@caa.columbia.edu
Pediatrics & CTSA, Columbia University, NYC