Learn R Programming

statisfactory

Statistical tools and helper functions, including back-transformation of principal component (PCA) scores, creatiion of all possible formulae from a set of terms while respecting marginality and user-specified constraints, stratified sampling, and 2-D histograms. You can install this package the usual way from CRAN or the development version (plus dependency omnibus) using:

remotes::install_github('adamlilith/omnibus', dependencies=TRUE)
remotes::install_github('adamlilith/statisfactory', dependencies=TRUE)

You may need to install package remotes first.

Functions

Utilities

  • makeFormulae: Make all possible formula

Distance

  • euclid: Euclidean distance
  • fuzzyJaccard: Fuzzy Jaccard index for non-binary values

Calculations

  • geoMean: Geometric mean
  • invLogitAdj: Probit transform robust to 0's or 1's
  • logitAdj: Logit transform robust to 0's and 1's
  • mmode: Modal value
  • psum: Element-wise sum (like pmin and pmax)
  • se: Standard error of the mean

Data transformation

  • art: Aligned rank transform for using ANOVAs on rank data
  • rankMulti: Rank values by multiple tie-breaking criteria

Principal component analysis (PCA)

*backTransPCA: "Back-transform" PCA scores to their original values

Geometry

  • countConnected: Count number of contiguous "blocks" of cells

Sampling

  • sampleAcross: Permute values across two vectors or columns in two data frames or matrices
  • sampleStrat: Sample values stratified by one or more other variables

Statistics

  • nagelR2: Nagelkerge's / Craig & Uhler's R2

Histograms

  • hist2d: Two-dimensional histogram
  • histOverlap: Histogram with overlapping or arbitrary bins

Adam B. Smith

Copy Link

Version

Install

install.packages('statisfactory')

Monthly Downloads

322

Version

1.0.4

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Adam B. Smith

Last Published

August 21st, 2023

Functions in statisfactory (1.0.4)

rankMulti

A multivariate adaptation of the rank() function
statisfactory

statisfactory: Statistical and Geometrical Tools
se

Standard error
invLogitAdj

Inverse logit is robust to cases that equal 0 or 1
logitAdj

A logit() function robust to values that equal 0 or 1
rmsd

Root-mean-square deviation (error)
backTransPCA

"Back-transform" PCA scores to their original values
sampleStrat

Stratified randomization
sampleAcross

Permute values across two vectors or columns in two data frames or matrices
.removeRedundantModels

Remove redundant model forms from a list of models
euclid

Euclidean distance
geoMean

Geometric mean
nagelR2

Nagelkerge's / Craig & Uhler's R2
fuzzyJaccard

Fuzzy Jaccard index
.removeVerbotenVariableCombos

Remove formula with unwanted combinations of variables.
countConnected

Count number of contiguous "blocks" of cells
art

Aligned rank transform of non-parametric data for further analysis using ANOVA
hist2d

Two-dimensional histogram
histOverlap

Count number of values in overlapping bins
mmode

Calculate the mode of numeric, character, or factor data
makeFormulae

Make all possible formula
psum

Element-by-element sum