serial.test | R Documentation |
Performs either of two nonparametric tests (Wilcoxon Rank-Sum test or runs
test) for serial correlation. Both tests compute Z, which is the product of
sequential values of x
after removing any trend and normalizing so that the
median of Z values is 0.
serial.test(x, method = "wilcoxon")
x |
the numeric vector of observations. Missing values (NAs) are not allowed. |
method |
the string "wilcoxon" or "runs," depending on which test should be used. Only the first character is necessary. See Details. |
If the method is "wilcoxon," then the Wilcoxon Rank-Sum test (Wilcoxon, 1945) is performed to compare the distribution of positive Z values to the distribution of negative Z values. Excessive numbers of positive Z values suggests positive serial correlation and excessive negative Z values suggests negative serial correlation.
If the method is "runs," then the runs test (Wald and Wolfowitz, 1940) is performed on sequences of positive and negative values of Z. If there is a larger than expected number of runs, then that suggest negative serial correlation and if fewer than the expected number of runs, then positive serial correlation.
An object of class htest containing the following components:
statistic |
the score for either test. |
p.value |
the two-sided p-value of the statistic. |
Z |
the raw data of the analysis. |
alternative |
a string "two.sided" indicating the hypothesis. |
method |
a description of the method. |
data.name |
a string containing the actual name of the input data. |
The null hypothesis is that the data are uncorrelated.
Dufour, J.M., 1981, Rank test for serial dependence: Journal of the Time Series Analysis, v. 2, no. 3, p. 117–128.
Wald, A., and Wolfowitz, J., 1940, On a test whether two samples are from the same population: Annals of Mathematical Statistics, v. 11, p. 147–162.
Wilcoxon, F., 1945, Individual comparisons by ranking methods: Biometrics, v. 1, p. 80–83.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.