曼肯德尔测试在不应该显着的情况下显示出显着性

问题描述 投票:0回答:1

我有一个从 1981 年到 2022 年的 R 数据框,其中包含与每年相关的最小纬度。在这个特定的数据框中,纬度在 42 年里没有发生任何变化。我对此数据运行 Mann Kendall,但它返回的 P 值小于 0.05。我是不是做错了什么?

##     My Code      ###
BF.Min <- as.ts(RangeDF4 %>% filter(Species == "Bluefish") %>% dplyr::select(Year, min) %>% arrange(Year))
MannKendall(BF.Min)                           # significant trend # tau = -0.299, 2-sided pvalue =0.00019187


##   Reproducible code   ##
#dput(BF.Min)
BF.Min <- structure(c(1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 
1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 
2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 
31.399899, 31.399899, 31.399899, 31.399899, 31.399899, 31.399899
), dim = c(42L, 2L), dimnames = list(NULL, c("Year", "min")), tsp = c(1, 
42, 1), class = c("mts", "ts", "matrix", "array"))
MannKendall(BF.Min)
r statistics
1个回答
0
投票

?MannKendall
表示输入应该是“数据向量,通常是时间序列”。您给它一个包含时间列和数据的矩阵。我认为你应该这样做:

library(Kendall)
MannKendall(BF.Min[,2])
WARNING: Error exit, tauk2. IFAULT =  12
tau = 1, 2-sided pvalue =1

我认为警告是因为它在处理常数系列时遇到困难......

© www.soinside.com 2019 - 2024. All rights reserved.