【发布时间】:2017-03-19 15:35:23
【问题描述】:
我正在使用 Shapiro-Wilk 检验来拒绝正态性的原假设。
我正在使用来自 Yahoo 的代码。例如,对于标准普尔 500:
SP500 = get.hist.quote(instrument = '^GSPC',
start="2001-01-01", end = "2015-12-31",
quote = c("AdjClose"),provider = "yahoo",
compress = "d")
rSP500 = diff(log(SP500)
我在尝试运行 Shapiro-Wilk 测试时遇到错误。
例如,
> SWTestSP500 = shapiro.test(rSP500[(3000-499):3000])
Error in if (rng == 0) stop("all 'x' values are identical") :
argument is of length zero
我上网的唯一搜索是它与输入不是数字有关,但我相当肯定 rSP500 都是数字。
有人可以建议吗?谢谢!
【问题讨论】:
标签: r statistics