t.diff: A p-hacking tool (i)

Description Usage Arguments Value Examples

View source: R/t.diff.R

Description

it performs t.tests on numerical variables from a data frame

Usage

1
2
t.diff(dataset, group,
       bonferroni.correction = FALSE)

Arguments

dataset

A data frame that contains numeric variables. Only numeric vector are taken.

group

The group by which t.tests are performed. it must be a factor of 2 items, or a continuous numeric variable that will be coerced into a 2-item factor by median split

bonferroni.correction

If TRUE, correction for multiple tests is performed: p values are multiplied by the n of tests

Value

It gives out a data frame with descriptive statistics and t as well as var test values. Elements are ordered by effect size (Cohen's D). All elements are also plotted by effect size and p.values are reported in purple (p < .05 are below the dashed line).

Examples

1
2
3
4
swiss$Factor.2 <- as.factor(c(rep('Factor1', 20), rep('Factor2', 27)))
t.diff(dataset = swiss,
       group = swiss$Factor.2,
       bonferroni.correction = F)

alemiani/explora documentation built on May 28, 2019, 4:54 p.m.