我正在使用 R。我有一个特定的数据集
x
,我必须检查它是否符合对数正态分布。
我正在使用
ks.test
包中的 base
,以及具有 Chi-square、Anderson Darling、Shapiro Francia、CVM 等的 nortest
包
对于
nortest
包中的函数,我使用的是log
变换,然后检查正态性。对于 ks.test
,我使用 fitdist
,检索 meanlog
和 sdlog
参数,然后检查日志正态性。
我的做法对吗?
最小工作示例
f <- fitdist(x, 'lnorm')$estimate
a <- log(x)
ad.test.value <- nortest::ad.test(a)
cvm.test.value <- nortest::cvm.test(a)
lillie.test.value <- nortest::lillie.test(a)
pearson.test.value <- nortest::pearson.test(a, 20)
sf.test.value <- nortest::sf.test(a)
ks.test.value <- ks.test(x, 'plnorm', meanlog = f[1], sdlog = f[2])