3

I am trying to create a Q-Q plot to test if my data can be modeled by the Weibull distribution using the command

qqplot(x,'weibull')   

using the data in

x =c(3.367, 0.769,0.8,1,1.2)

I keep getting presented with with the error

 "In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion"

and cannot figure out why. Does this mean I can't fit the Weibull distribution to my data? If anyone could help point me to why this isn't working, I would be very grateful.

4

2 回答 2

1

制作一个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、一个形状参数和一个比例参数。

于 2015-12-08T22:30:20.880 回答
0

您可以使用qualityTools包和qqPlot()功能。如果你需要估计你可以使用fitdistrplus包的参数。

   fit.weibull <- fitdist(x, "weibull")
   qqplot(qweibull(ppoints(length(x), shape = fit.weibull$estimate[1], 
           scale = fit.weibull$estimate[2]), x)
于 2018-03-01T21:14:12.647 回答