Learn R Programming

Blossom (version 1.4)

ptmp: Permutation test for matched pairs

Description

The permutation test for matched pairs (PTMP) is a special case of MRBP, univariate data in two groups and n blocks, used for paired comparisons. Options allows PTMP to perform permutation versions of paired t-tests and Wilcoxon's signed rank test (for ranked data).

Usage

ptmp(data,variables, expon = 1, exact = FALSE, number.perms, save.test)

Arguments

variables
a character string of the names to be used in the analysis. These should match names found in the data.frame.
data
the data.frame or matrix either with the first second and third columns representing the grouping variable, pairing variable and response variable respectively or a data.frame or matrix with two columns of pairs of responses.
expon
allows selection of alternative exponents in distance calculations.
exact
a logical value indicating whether to perform an exact test.
number.perms
if specified a Monte Carlo resampling procedure with number.perms permutations is to be used rather than a Pearson III approximation.
save.test
a logical which when true stores the permutation values of the test statistic. This is only a valid option when number.perms is set.

Value

ptmp returns an object of class PTMPObj.

Details

The PTMP is statistically equivalent to MRBP either command can be used when pairing is indicating by the blocking variable but only ptmp can be used when the observations are paired (next to each other) in the data set. Thus the pairing is indicated by position or by a blocking variable. The different test statistic structures produce an observed delta in PTMP that is exactly twice the observed test statistic for the same problem in MRBP. Also, data in PTMP are aligned to a median of 0 by the structure of the test statistic.

References

Mielke, P.W., Jr., and K.J. Berry. 2001. Permutation methods: A distance function approach. Springer-Verlag.

See Also

mrbp

Examples

Run this code

print(out <- ptmp(paired1,exact = TRUE))
pvalue(out)

Run the code above in your browser using DataLab