View source: R/tpaired.randtest.R
tpaired.randtest | R Documentation |
This function computes a permutation test of comparison of the means of two paired vectors (related samples). For each object, permutations are restricted to the two related observations.
tpaired.randtest(
vec1,
vec2,
nperm = 99,
alternative = "two.sided",
silent = FALSE
)
vec1 , vec2 |
The two data vectors to be compared. |
nperm |
Number of permutations. Use 999, 9999, or more. |
alternative |
c("two.sided", "less", "greater"). Default value: "two.sided". |
silent |
If |
A list containing the following results:
estim
: mean of the differences
t.ref
: reference value
of the t-statistic
p.param
: parametric p-value
p.perm
: permutational p-value
nperm
: number of
permutations
- Pierre Legendre pierre.legendre@umontreal.ca Permutation code improved by Guillaume Blanchet.
Zar, J. H. 1999. Biostatistical analysis. 4th edition. Prentice Hall, New Jersey.
t.test
## Deer leg length, data from Zar (1999, p. 162).
deer <- matrix(c(142,140,144,144,142,146,149,150,142,148,138,136,147,139,143,141,143,
145,136,146),10,2)
rownames(deer) <- paste("Deer",1:10,sep=".")
colnames(deer) <- c('Hind.leg', 'Fore.leg')
res <- tpaired.randtest(deer[,1], deer[,2]) # Two-tailed test by default
## Compare the results to: res2 = t.test(deer[,1], deer[,2], paired=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.