记录 R 中的正态性测试

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

我正在使用 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])
r normal-distribution hypothesis-test
© www.soinside.com 2019 - 2024. All rights reserved.