Last chance! 50% off unlimited learning
Sale ends in
Performs the runs test for randomness Mendenhall_Reinmuth_1982lawstat.
Users can choose whether to plot the
correlation graph or not, and whether to test against two-sided, negative,
or positive correlation. NA
s from the data are omitted.
runs.test(
y,
plot.it = FALSE,
alternative = c("two.sided", "positive.correlated", "negative.correlated")
)
A list of class "htest"
with the following components:
the value of the standardized runs statistic.
the
a character string giving the names of the data.
a character string describing the alternative hypothesis.
a numeric vector of data values.
logical. If TRUE
, then the graph will be plotted.
If FALSE
(default), then it is not plotted.
a character string specifying the alternative hypothesis,
must be one of "two.sided"
(default), "negative.correlated"
,
or "positive.correlated"
.
Wallace Hui, Yulia R. Gel, Joseph L. Gastwirth, Weiwen Miao
On the graph, observations that are less than the sample median are represented by red letters "A", and observations that are greater or equal to the sample median are represented by blue letters "B".
bartels.test
##Simulate 100 observations from an autoregressive model
## of the first order (AR(1))
y = arima.sim(n = 100, list(ar = c(0.5)))
##Test y for randomness
runs.test(y)
Run the code above in your browser using DataLab