scores: Scores to be used for the test. Defaults to integers 1:length(y).
exact: Logical variable indicating whether the exact p-value should be calculate. Default is false.
sides: Integer; 1 for one sided test rejecting for large values of the statistic, and 2 for the two-sided test. Defaults to 1.
Returns
A list with components pv, the p-value obtained with the permutation tests, and tot, the total number of rearrangements of the data considred in calculating the p-value.
Details
The statistic considered here is the sum of scores corresponding to those entries in y that are positive. If exact=T, the function calls a Fortran code to cycle through all permutations. If exact=F, the expectation of the statistic is calculated as half the sum of the scores, the variance is calculated as one quarter the sum of squares of scores about their mean, and the statistic is compared to its approximating normal distribution.
Examples
symscorestat(y=c(1,-2,3,-4,5),exact=TRUE)
References
J.J. Higgins, (2004), Introduction to Modern Nonparametric Statistics, Brooks/Cole, Cengage Learning.