R:尝试为 Weibull 分布创建 Q-Q 图,出现错误 "NAs Introduced by Coersion"
R: Trying to create a Q-Q plot for the Weibull Distribution, getting error "NAs Introduced by Coersion"
我正在尝试创建一个 Q-Q 图来测试我的数据是否可以使用以下命令通过 Weibull 分布建模
qqplot(x,'weibull')
使用
中的数据
x =c(3.367, 0.769,0.8,1,1.2)
我一直收到错误
"In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion"
并且无法弄清楚为什么。这是否意味着我无法将 Weibull 分布拟合到我的数据中?如果有人可以帮助我指出为什么这不起作用,我将不胜感激。
制作 qqplot
需要一些分布来比较您的数据。您需要先建立一些 Weibull 分布,然后再创建绘图。例如:
x =sort(c(3.367, 0.769,0.8,1,1.2))
dist = rweibull(5, 2, 1)
qqplot(dist, x)
您是否考虑过 Weibull 分布的参数?有关详细信息,请参阅 ?rweibull
,但它似乎需要一个 n、一个形状参数和一个比例参数。
您可以使用 qualityTools
包和 qqPlot()
函数。
如果您需要估计参数,您可以使用 fitdistrplus
包。
fit.weibull <- fitdist(x, "weibull")
qqplot(qweibull(ppoints(length(x), shape = fit.weibull$estimate[1],
scale = fit.weibull$estimate[2]), x)
我正在尝试创建一个 Q-Q 图来测试我的数据是否可以使用以下命令通过 Weibull 分布建模
qqplot(x,'weibull')
使用
中的数据x =c(3.367, 0.769,0.8,1,1.2)
我一直收到错误
"In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion"
并且无法弄清楚为什么。这是否意味着我无法将 Weibull 分布拟合到我的数据中?如果有人可以帮助我指出为什么这不起作用,我将不胜感激。
制作 qqplot
需要一些分布来比较您的数据。您需要先建立一些 Weibull 分布,然后再创建绘图。例如:
x =sort(c(3.367, 0.769,0.8,1,1.2))
dist = rweibull(5, 2, 1)
qqplot(dist, x)
您是否考虑过 Weibull 分布的参数?有关详细信息,请参阅 ?rweibull
,但它似乎需要一个 n、一个形状参数和一个比例参数。
您可以使用 qualityTools
包和 qqPlot()
函数。
如果您需要估计参数,您可以使用 fitdistrplus
包。
fit.weibull <- fitdist(x, "weibull")
qqplot(qweibull(ppoints(length(x), shape = fit.weibull$estimate[1],
scale = fit.weibull$estimate[2]), x)