fss_t.test: T-test via sample statistics

Description Usage Arguments Examples

Description

Perform a t-test just using sample statistics

Usage

1
2
3
fss_t.test(mean1, mean2, s1, s2, n1, n2, var.equal = FALSE,
  alternative = "two.sided", conf.level = 0.95, simulate = FALSE,
  data.names = c("x", "y"))

Arguments

mean1

Numeric. The sample mean for the first group.

mean2

Numeric. The sample mean for the second group.

s1

Numeric. The standard deviation for the first group.

s2

Numeric. The standard deviation for the second group.

n1

Numeric. The sample size for the first group.

n2

Numeric. The sample size for the second group.

var.equal

Logical. If true do an equal-variance t-test. If false use Welch–Satterthwaite to do an unequal variance t-test.

alternative

Character. Either "two.sided", "greater", or "less" specifying the direction specified in the alternative hypothesis of the t-test.

conf.level

Numeric. Value between 0 and 1 denoting the confidence level for the test. This is the same as 1-alpha.

simulate

Logical. If true simulate data that matches the sample statistics and use the build in t-test function in R. If false just use the sample statistics directly to do the test.

data.names

Character vector. A two element character vector that gives the names for the two groups.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- rnorm(20)
y <- rnorm(20, 0, 5)
m1 <- mean(x)
m2 <- mean(y)
s1 <- sd(x)
s2 <- sd(y)
n1 <- length(x)
n2 <- length(y)
o1 <- t.test(x, y, var.equal = TRUE)
o2 <- fss_t.test(m1,m2, s1,s2, 20, 20, var.equal = TRUE)
all.equal(o1, o2)

Dasonk/fss documentation built on May 6, 2019, 1:37 p.m.