t_results: Results of t-test in APA standard

Description Usage Arguments Value Author(s) Examples

View source: R/test_results.R

Description

Function to print results of a t-test in APA standard (t(df) = t; p = p)

Usage

1
2
t_results(x, y, alternative = "two.sided", mu = 0, conf.level = 0.95,
  paired = FALSE, var.equal = FALSE)

Arguments

x

a numeric vector or a factor (grouping variable)

y

a numeric vector (dependent variable)

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

mu

a number indicating the true value of the mean (or difference in means if you are performing a two sample test). Default is 0.

conf.level

Confidence level of the interval. Default is 0.95.

paired

a logical indicating whether you want a paired t-test. Default is FALSE.

var.equal

a logical variable indicating whether to treat the two variances as being equal. If TRUE then the pooled variance is used to estimate the variance otherwise the Welch (or Satterthwaite) approximation to the degrees of freedom is used. Default is FALSE.

Value

t(df) = t; p = p

Author(s)

Dominik Vogel

Examples

1
2
3
4
5
6
7
set.seed(1)
df <- data.frame(happy = c(rnorm(n = 10, mean = 3, sd = 0.5),
rnorm(n = 10, mean = 4, sd = 0.5)),
                 treatment = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                               1, 1, 1, 1, 1, 1, 1, 1, 1, 1))

t_results(y = df$happy, x = df$treatment)

DominikVogel/vogelR documentation built on May 23, 2019, 4:12 p.m.