Contains functions for the easy display of statistical tests as well as some convenience functions for data cleanup. It is meant to ease existing workflows with packages like 'sjPlot', 'dplyr', and 'ggplot2'. The primary components are the functions prefixed with 'tadaa_', which are built to work in an interactive environment, but also print tidy markdown tables powered by 'pixiedust' for the creation of 'RMarkdown' reports.
This is tadaatoolbox version 0.15.9000
(semver(ish)).
It contains helpers for data analysis and presentation focused on undergrad psychology, the target audience being students at University of Bremen.
Please consider this as a teaching project and be careful if you intend to use it for production use.
To see what's new, see NEWS.md.
Also, since this project is still in the 0.x.y
version, you should expect the API to change at any time. Once we reach 1.0.0
, API changes will be rolled out more slowly and include depracation warnings. In the meantime, the package is available on CRAN primarily for convenience, because its target audience is likely not familiar with GitHub or devtools
.
Install the current development version from GitHub (recommended):
if (!("devtools" %in% installed.packages())){
install.packages("devtools")
}
devtools::install_github("tadaadata/tadaatoolbox")
Or install the most recent stable version from CRAN:
install.packages("tadaatoolbox")
Please do! I have no idea where I'm going with this. Feel free to open issues.
Contributer | Role |
---|---|
Lukas Burk | Author & Creator |
Tobias Anton | Author |
Daniel Lüdecke | Contributor |
See the included vignette for a demonstration: browseVignettes("tadaatoolbox")
or view the pkgdown
ed version of this repo.
tadaa_aov
: For aov
with included partial η^{2} and Cohen's f.tadaa_kruskal
: A wrapper for kruskal.test
tidied and optionally pixiedust
ed.tadaa_t.test
: For t.test
with automatic homogenity of variance detection, effect size and power.tadaa_wilcoxon
: A wrapper for wilcox.test
tidied and optionally pixiedust
ed.tadaa_levene
: Wrapper for car::leveneTest
tidied and optionally pixiedust
ed.tadaa_normtest
lets you do tests for normality (4 methods) over multiple variables.tadaa_pairwise_t
, tadaa_pairwise_gh
and tadaa_pairwise_tukey
for various pairwise procedures.modus
: A simple function to extract the mode of a frequency table
nom_chisqu
: Simple wrapper for chisq.test
that produces a single value.
nom_phi
: Simple wrapper for vcd::assocstats
to extract phi.
nom_v
: Simple wrapper for vcd::assocstats
to extract Cramer's V.
nom_c
: Simple wrapper for vcd::assocstats
to extract the contingency coefficient c.
nom_lambda
: Simple wrapper for ryouready::nom.lambda
to extract appropriate lambda.
ord_gamma
: Simple wrapper for ryouready::ord.gamma
.
ord_somers_d
: Simple wrapper for ryouready::ord.somers.d
.
tadaa_nom
: All the nominal stats in one table.
tadaa_ord
: All the ordinal stats in one table.
generate_recodes
: To produce recode assignments for car::recode
for evenly sequenced clusters.interval_labels
: To produce labels for clusters created by cut
.delete_na
: Customizable way to drop NA
observations from a dataset.pval_string
: Shamelessly adapted from pixiedust::pvalString
, this will format a p-value as a character string in common p < 0.001
notation and so on. The difference from the pixiedust
version is that this function will also print p < 0.05
.mean_ci_t
: Returns a data.frame
with y
(mean
), ymin
and ymax
for the CI bounds.
confint_t
: For the underlying function to get the CI width. Returns a single value.confint_norm
: Similar, but baes on normal distribution. Returns a single value.mean_ci_sem
: Standard error and CI, you guessed it, in one table.tadaa_int
: Simple interaction plot template.tadaa_balance
: Check equality of group sizes.tadaa_mean_ci
: Plots means with 95% confidence intervals as errorbars.tadaa_plot_tukey
: For pretty TukeyHSD
visualization.I rely on these awesome package for all the things this package does, so you might want to consider checking them out.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
ord_pairs
to retrieve $N_c$, $N_d$, ties and total number of pairs for contingency tables. Internals for this function are straight up copied from this gist.etasq
in case you want to show students what $\eta^2$ is without having to explain ANOVA.ord_somers_d
not returning the correct value for symmetric = TRUE
drop_labels
because sjlabelled::zap_labels
is a thingryouready
dependency, in favor of the more versatile DescTools
package:
nom_lambda
: Use DescTools::Lambda
ord_gamma
: Use DescTools::GoodmanKruskalGamma
ord_somers_d
: Use DescTools::SomersDelta
vcd
dependency, also in favor of DescTools
.DescTools
functions are very similar to what the wrappers do, so the wrappers might be removed in the future.)lazyeval
dependency in tadaa_int
by being better at ggplot2
.dplyr
dependency by being better at R.haven
dependency by not re-exporting as_factor
anymore ¯\_(ツ)_/¯sjmisc
depencency because why did we depend on that again?sjlabelled
dependency (only used for re-exports).lsr
dependency in favor of, you guessed it, DescTools
for eta in tadaa_aov
.tadaa_one_sample
for t-teststadaa_
-test functions use tadaatoolbox::pval_string
instead of the pixiedust
versionleist
var from ngo
, as it should be computed from leistung
by students.cowplot
from Imports
to Suggests
because whe only need it in one function, sometimes.tadaa_nom
and tadaa_ord
.[tadaa_]likertize
is removed. Use sjmisc::split_var
.labels_to_factor
is removed because various as_factor
s exist.chisq.test
ord_tau
to calculate all the Taus
tadaa_ord
tadaa_chisq
for a $\chi^2$-Test with OR and effect size.sjmisc
to the new sjlabelled
(Thanks, @strengejacke!)magrittr::%$%
because it's really handy sometimes.tadaa_one_sample
tadaa_pairwise_t
as an extension of stats::pairwise.t.test
that works with two grouping factors and thereby can test interactions.
tadaa_pairwise_gh
for the Games Howell post-hoc procedure as an alternative to TukeyHSD
.
tadaa_pairwise_tukey
while we're at it. Just a thin wrapper for stats::TukeyHSD
but with tidied output and usage consistent with the previous tadaa_pairwise_*
functions.tadaa_plot_tukey
to plot Tukey HSD results as error bars because boy do I like error bars.tadaa_balance
as a replacement for tadaa_heatmap
to check equality of group sizes.%>%
from magrittr
as all the cool kids to these days.%<>%
from magrittr
because I happen to really like it.[sg]et_label[s]
and word_wrap
from sjmisc
, as they're handy.as_factor
from haven
as a replacement for the deprecated labels_to_factor
.theme_tadaa
:
theme_readthedown
, will probably become the new canonical version.x
axis title via proper margining.tadaa_aov
:
type
is now 3
, for generally safer results and consistency with SPSS.check_contrasts
option for type = 3
sums of squares, which ensures each non-ordered factor has contr.sum
contrastsmethods
, which should fix an issue during knitr
or rmarkdown
processing where the function is
couldn't be found. If not, manually library(methods)
as a workaround.sprinkle
labelling causing eta.sq
to be formatted like a p-value.show_power
argument to calculate power via pwr::pwr.f2.test
.
tadaa_t.test
:
center = "median"
for more robust results, as it should.
var.equal
to override internal Levene test.alternative = "less"
or greater
.conf.level
argument used for CI and power calculationseffect_size_t
:
paired
argument so effects for paired tests are now a thing.tadaa_wilcoxon
:
direction
argument not being honored.tadaa_int
:
print
(logical) argument to suppress printing if so desired. The output will still be returned invisibly.tadaa_one_sample
: Should make sense now.na.rm
argument from tadaa_t.test
and tadaa_wilcoxon
because it's problematic, and in case of paired = TRUE
it would have produced flat out wrong results.print = markdown
output of tadaa_aov
, tadaa_t.test
, tadaa_wilcoxon
, tadaa_one_sample
, tadaa_kruskal
. Unfortunately print = "console"
now has headers with unparsed $\LaTeX$-expressions, but who uses that anyway.labels_to_factor
: Was a wrapper around haven::as_factor
and is obsolete by now, as as_factor
can do the same thing this function was built for.tadaa_likertize
is renamed to likertize
, deprecated since sjmisc::split_var
is probably better anyway.tadaa_aov
now knows about types, uses type 1 by default and can do types 2 and 3.
lsr::etaSquared
, which also takes a type
argument.tadaa_mean_ci
: Plots means with 95% confidence intervals as errorbars (thanks Christoph for the suggestion).tadaa_one_sample
: For one-sample t-tests and finally an easy z-test.
confint_norm
: Helper to get CIs, similar to confint_t
tadaa_wilcoxon
: For when tadaa_t.test
isn't non-parametric enough. Same usage.
tadaa_kruskal
: For when tadaa_aov
isn't non-parametric enough, too.tadaa_sem
➡ mean_ci_sem
because it's more confint
than tadaa
.show_n
option to tadaa_int
: Optionally display N in subtitle.pval_string(0.05)
returned < 0.05
. Well. That was embarrassing.theme_readthedown
regarding text placement.ngo
: index
, zeng
, zdeutsch
, zmathe
.tadaa_normtest
lets you do tests for normality (4 methods) over multiple variables.tadaa_heatmap
generates a heatmap. Mhhh, heatmaps.tadaa_sem
shows the standard error of the mean and it's confidence intervalpval_string
as a modification of pixiedust::pvalString
that includes p < .05
.tadaa_aov
, tadaa_t.test
and the new tadaa_normtest
now return a data.frame
by default, allowing further shenaniganstadaa_int
:
grid = TRUE
for the two interaction plots to be printen in a grid via
cowplot::plot_grid.labels
argument.tadaa_int
plot output now also is a little tidier and optimized for smaller widths.tadaa_aov
now also shows Cohen's f for easier power calculations based on f (pwr
, G*power)reduce
to modus
, so multiple results will be concatenated to a character by default.as_character
to modus
because guessing about return value classes is no joke.generate_recodes
and interval_labels
(#1).tadaa_ord
as ordinal equivalent of tadaa_nom
.brewer_palette
option to tadaa_int
DESCRIPTION
are still experimental because of uncertainty regarding failing travis builds. I don't know what's going on there.family
tag to tadaa_
functions so their documentation is linkedtadaa_aov
, _t.test
and _nom
which did not work as I expectedDESCRIPTION
, misspelling pixiedust
. Sorry!pixiedust
depends on R (>= 3.2.1), so we might as well depend on that version, toopixiedust
, sjmisc
, and broom
, just to be safeREADME
to be less redundant compared to the usage vignetteNEWS.md
file to track changes to the package.