Skip to contents

Returns the p-value from a t-test with useful default parameters. Returns NA if the t-test is uncalculable (i.e. does try() handling).

Usage

get.ttest.p(x, group1, group2, paired = FALSE, var.equal = FALSE, 
    alternative = 'two.sided');

Arguments

x

Vector of numbers to analyze

group1

Vector of TRUE/FALSE indicating which are the x samples for the t-test

group2

Vector of TRUE/FALSE indicating which are the y samples for the t-test

paired

Do a paired t-test?

var.equal

Assume Welch's correction?

alternative

What's the null-hypothesis?

Value

No return value

Author

Paul C. Boutros

Examples

get.ttest.p(
  x = rnorm(100),
  group1 = c(rep(TRUE, 50), rep(FALSE, 50)),
  group2 = c(rep(FALSE, 50), rep(TRUE, 50)),
  paired = FALSE,
  var.equal = FALSE,
  alternative = 'two.sided'
  );
#> [1] 0.8509013