mann_kendall: Mann Kendall

View source: R/stats.R

mann_kendallR Documentation

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 class 'mann_kendall'
test_statistic(x, ...)

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

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.

Value

object of class Mann-Kendall.

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


# 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)

litteR documentation built on Aug. 27, 2022, 1:05 a.m.