Learn R Programming

litteR (version 1.0.0)

mann_kendall: Mann Kendall

Description

Performs Mann-Kendall non-parametric test for trend.

Usage

mann_kendall(x, t = seq_along(x), type = c("both", "increasing", "decreasing"))

# S3 method for mann_kendall test_statistic(x, ...)

# S3 method for mann_kendall p_value(x, ...)

Value

object of class Mann-Kendall.

Arguments

x

numeric vector representing a time-series.

t

time index (a numeric vector, or a vector of class Date).

type

direction to test (both, increasing, or decreasing).

...

further arguments passed to or from other methods.

Methods (by generic)

  • test_statistic(mann_kendall): Extracts Mann Kendall tau

  • p_value(mann_kendall): Extract p-value

See Also

test_statistic, p_value, cor.test, regional_kendall

Examples

Run this code

# create mann_kendall object
mk <- mann_kendall(c(9, 4, 7, 5, 3), type = "decreasing")
mk <- mann_kendall(
  x = c(9, 4, 7, 5, 3),
  t = c(1, 3, 2, 5, 9),
  type = "decreasing")

# get test statistic tau
test_statistic(mk)

# get p-value
p_value(mk)

Run the code above in your browser using DataLab