Learn R Programming

sigr

Concise formatting of significances in R.

Please see Adding polished significance summaries to papers using R for some discussion.

See also:


sigr is a small package that concentrates on computing summary statistics and reporting in an appropriate format.

For example here is formatting the quality of a logistic regression.

d <- data.frame(x=c(1,2,3,4,5,6,7,7),
      y=c(TRUE,FALSE,FALSE,FALSE,TRUE,TRUE,TRUE,FALSE))
model <- glm(y~x,data=d,family=binomial)
summary(model)
## 
## Call:
## glm(formula = y ~ x, family = binomial, data = d)
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept)  -0.7455     1.6672  -0.447    0.655
## x             0.1702     0.3429   0.496    0.620
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 11.090  on 7  degrees of freedom
## Residual deviance: 10.837  on 6  degrees of freedom
## AIC: 14.837
## 
## Number of Fisher Scoring iterations: 4
library("sigr")
cat(render(wrapChiSqTest(model),
           pLargeCutoff=1, format='markdown'))

Chi-Square Test summary: pseudo-R2=0.02282 (χ2(1,N=8)=0.2531, p=0.6149).


To install, from inside R please run:

install.packages("sigr")

Copy Link

Version

Install

install.packages('sigr')

Monthly Downloads

1,124

Version

1.1.5

License

GPL-2 | GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

August 20th, 2023

Functions in sigr (1.1.5)

render.sigr_Bernoulli_diff_test

Format sigr_Bernoulli_diff_test (test of difference of Bernoulli processes).
render.sigr_aucpairtest

Format an AUC-test (quality of a probability score)
format.sigr_statistic

Format
render.sigr_aucpermtest

Format an AUC-test (quality of a probability score)
check_utility_calc

Check a few things we expect to be true for the utility frame.
model_utility

Estimate model utility
calcSSE

Calculate sum of squared error.
permTestAUC

Perform AUC permutation test.
render.sigr_ftest

Format an F-test
render.sigr_permtest

Format an empirical test (quality of categorical prediction)
render.sigr_aucresamptest

Format an AUC-test (quality of a probability score)
resampleTestAUC

Wrap AUC resampling test results.
render.sigr_cortest

Format cor.test (test of liner correlation).
add_ROC_derived_columns

Add ROC derived columns.
getRenderingFormat

Detect rendering format (using knitr).
render.sigr_cohend

Format Cohen-D (effect size between groups)
sensitivity_from_specificity_q

Compute the q-graph.
sigr-package

sigr: Format Significance Summaries for Reports
sensitivity_and_specificity_s12p12n

Compute the shape1_pos, shape2_pos, shape1_neg, shape2_neg graph.
render.sigr_emptest

Format an empirical test (quality of categorical prediction)
render.sigr_fishertest

Format fisher.test (test of categorical independence).
calcDeviance

Calculate deviance.
find_matching_conditional_betas

Find beta shape parameters matching the conditional distributions.
resampleScoreModelPair

Studentized bootstrap test of strength of scoreFn(yValues,model1Values) > scoreFn(yValues,model1Values).
resampleScoreModel

Studentized bootstrap variance estimate for scoreFn(yValues,modelValues).
estimateDifferenceZeroCrossing

Studentized estimate of how often a difference is below zero.
wrapChiSqTestImpl

Format quality of a logistic regression roughly in "APA Style" ( American Psychological Association ).
wrapCorTest.htest

Wrap cor.test (test of liner correlation).
wrapPWR

Wrap pwr test (difference in means by group).
wrapBinomTest.data.frame

Wrap binom.test (test of Binomial/Bernoulli rate).
wrapBinomTest.htest

Wrap binom.test (test of Binomial/Bernoulli rate).
wrapCohenD

Wrap Cohen's D (effect size between groups).
wrapFisherTest.table

Wrap fisher.test (test of categorical independence).
fit_beta_shapes

Fit beta parameters from data.
find_AUC_q

Find area matching polynomial curve.
permutationScoreModel

Empirical permutation test of significance of scoreFn(modelValues,yValues) >= scoreFn(modelValues,perm(yValues)).
reexports

Objects exported from other packages
wrapChiSqTest.glm

Format ChiSqTest from model.
wrapBinomTestS

Wrap binom.test (test of Binomial/Bernoulli rate) from summary.
wrapFisherTest.data.frame

Wrap fisher.test (test of categorical independence).
wrapFTest

Wrap F-test (significance identity relation).
wrapChiSqTest

Wrap quality of a categorical prediction roughly in "APA Style" ( American Psychological Association ).
wrapFisherTest.htest

Wrap fisher.test (test of categorical independence).
wrapChiSqTest.summary.glm

Format ChiSqTest from model summary.
render.sigr_significance

Format a significance
render.sigr_pwr_htest

Format a pwr-test
wrapCorTest

Wrap cor.test (test of liner correlation).
wrapBinomTest

Wrap binom.test (test of Binomial/Bernoulli rate).
testAUCpair

Test AUC pair results.
render

Format summary roughly in "APA Style" ( American Psychological Association ).
print.sigr_statistic

Print
wrapTTest.htest

Wrap t.test (difference in means by group).
wrapSignificance

Wrap a significance
wrapPWR.power.htest

Wrap pwr test.
wrapTTest.numeric

Wrap t.test (difference in means by group).
render.sigr_binomtest

Format binom.test (test of rate of a Binomial/Bernoulli experiment).
render.sigr_chisqtest

Format a chi-square test (quality of categorical prediction)
wrapCohenD.data.frame

Wrap Cohen's D (effect size between groups).
render.sigr_ttest

Format a T-test (difference in means by group)
render.sigr_tinterval

Format a Student-T tolerance-style interval around an estimate of a mean.
wrapBinomTest.logical

Wrap binom.test (test of Binomial/Bernoulli rate).
wrapFTest.htest

Wrap F-test (ratio of variances).
wrapChiSqTest.anova

Format ChiSqTest from anova of logistic model.
wrapFTest.lm

Wrap quality statistic of identity r regression.
wrapChiSqTest.data.frame

Format ChiSqTest from data.
wrapTTest.data.frame

Wrap t.test (difference in means by group).
wrapTTest

Wrap t.test (difference in means by group).
wrapBinomTest.numeric

Wrap binom.test (test of Binomial/Bernoulli rate).
wrapFTest.anova

Wrap quality statistic of a linear relation from anova.
wrapCorTest.data.frame

Wrap cor.test (test of liner correlation).
wrapFTestezANOVA

Wrap quality statistic of a linear relation from ezANOVA (package ez).
wrapCohenD.numeric

Wrap Cohen's D (effect size between groups).
wrapFTest.data.frame

Wrap quality statistic of identity relation from data.
wrapFTest.summary.lm

Wrap quality statistic of linear regression summary.
wrapFisherTest

Wrap fisher.test (test of categorical independence).
wrapFTestImpl

Wrap F-test (significance of identity relation).
as.character.sigr_statistic

as.character
Bernoulli_diff_stat

Compute the distribution of differences of replacement samples of two Binomial or Bernoulli experiments.
TInterval

Wrap TInterval (test of Binomial/Bernoulli rate).
TInterval.data.frame

Student-T tolerance-style interval around an estimate of a mean from a data.frame.
TIntervalS

Student-T tolerance-style interval around an estimate of a mean from summary.
build_ROC_curve

calculate ROC curve.
TInterval.numeric

Student-T tolerance-style interval around an estimate of a mean from observations.
calcAUC

calculate AUC.
find_matching_a1_1b

Find beta-1 shape parameters matching the conditional distributions.
find_area_q

Find area matching polynomial curve.