Learn R Programming

RVAideMemoire (version 0.9-35)

perm.t.test: Permutational Student's t-test

Description

Perform a permutational Student's t-test.

Usage

perm.t.test(formula, data, alternative = c("two.sided", "less", "greater"),
  paired = FALSE, nperm = 999)

Arguments

formula
a formula of the form a ~ b where a gives the data values and b a factor with 2 levels giving the corresponding groups.
data
an optional data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).
alternative
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less".
paired
a logical indicating whether you want a paired t-test.
nperm
number of permutations.

Value

  • statistictest statistics of the parametric test.
  • permutationsnumber of permutations.
  • p.valuep-value of the permutational test.
  • estimatethe estimated mean or difference in means depending on whether it was a paired or not paired test.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string indicating what type of t-test was performed.
  • data.namea character string giving the name(s) of the data.
  • null.valuethe specified hypothesized value of the mean difference, always 0.

See Also

t.test

Examples

Run this code
response <- c(rnorm(5),rnorm(5,2,1))
fact <- gl(2,5,labels=LETTERS[1:2])

# Unpaired test
perm.t.test(response~fact)

# Paired test
perm.t.test(response~fact,paired=TRUE)

Run the code above in your browser using DataLab