找回密码
 注册
查看: 1242|回复: 0

R语言 vcd包 goodfit()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 14:47:44 | 显示全部楼层 |阅读模式
goodfit(vcd)
goodfit()所属R语言包:vcd

                                        Goodness-of-fit Tests for Discrete Data
                                         离散数据的拟合优度检验

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Fits a discrete (count data) distribution for goodness-of-fit tests.
适合离散(计数资料)分布善良的拟合检验。


用法----------Usage----------


goodfit(x, type = c("poisson", "binomial", "nbinomial"),
  method = c("ML", "MinChisq"), par = NULL)
## S3 method for class 'goodfit'
predict(object, newcount = NULL, type = c("response", "prob"), ...)



参数----------Arguments----------

参数:x
either a vector of counts, a 1-way table of frequencies of counts or a data frame or matrix with frequencies in the first column and the corresponding counts in the second column.
无论是矢量的计数的计数或一个数据框或矩阵中的第一列和第二列中的相应的计数频率的频率,1路表。


参数:type
a character string indicating which distribution should be fit (for goodfit) or  indicating the type of prediction (fitted response or probabilities in predict) respectively.
一个字符的字符串,指示应符合的分布(为goodfit)或类型的预测(拟合响应或概率predict)。


参数:method
a character string indicating whether the distribution should be fit via ML (Maximum Likelihood) or Minimum Chi-squared.
一个字符串,指示是否应适当通过最大似然(ML)或最小卡方分布。


参数:par
a named list giving the distribution parameters (named as in the corresponding density function), if set to NULL, the default, the parameters are estimated.  If the parameter size is not specified if type is "binomial" it is taken to be the maximum count. If type is "nbinomial", then parameter size can be specified to fix it so that only the parameter prob will be estimated (see the examples below).
一个命名列表,给出的分布参数(在相应的密度函数的名字命名),如果设置为NULL,默认情况下,参数的估计。如果该参数size如果没有指定type是"binomial"它是最大计数。如果type是"nbinomial",然后参数size可以指定要解决它,只有参数prob将估计(见下面的例子)。


参数:object
an object of class "goodfit".
对象类"goodfit"。


参数:newcount
a vector of counts.  By default the counts stored in object are used, i.e., the fitted values are computed.  These can also be extracted by fitted(object).
计数的向量。默认情况下,计数储存在object的使用,即拟合值计算。这些也可以提取fitted(object)。


参数:...
currently not used.
目前未使用。


Details

详细信息----------Details----------

goodfit essentially computes the fitted values of a discrete distribution (either Poisson, binomial or negative binomial) to the count data given in x.  If the parameters are not specified they are estimated either by ML or Minimum Chi-squared.
goodfit基本上是在x的计数数据计算拟合值的离散分布(泊松分布,二项分布或负二项分布)。如果没有指定参数估计的ML或最小卡方检验。

To fix parameters, par should be a named list specifying the parameters lambda for "poisson" and prob and size for "binomial" or "nbinomial", respectively. If for "binomial", size is not specified it is not estimated but taken as the maximum count.
要解决参数,par应该是命名列表,指定的参数lambda"poisson"和prob和size"binomial"或<X >。如果为"nbinomial","binomial"没有指定是没有估计,但它的最大计数。

The corresponding Pearson Chi-squared or likelihood ratio statistic, respectively, is computed and given with their p values by the summary method. The summary method always prints this information and returns a matrix  with the printed information invisibly. The plot method produces a rootogram of the observed and fitted values.
Pearson卡的相应平方或似然比统计量,分别用自己的p值被计算并给出由summary方法。 summary方法总是打印此信息,并返回一个矩阵,打印的信息不可见的。 plot方法产生一个rootogram的观测值和拟合值。

In case of count distribtions (Poisson and negative binomial), the minimum Chi-squared approach is somewhat ad hoc. Strictly speaking, the Chi-squared asymptotics would only hold if the number of cells were fixed or did not increase too quickly with the sample size. However, in goodfit the number of cells is data-driven: Each count is a cell of its own. All counts larger than the maximal count are merged into the cell with the last count for computing the test statistic.
“情况数distribtions(Poisson分布和负二项分布),最低的卡方检验的方法是有些专案。严格地说,卡方渐近只会保持单元的数量是固定的,或没有增加的速度太快,样本大小。然而,在goodfit的单元数是数据驱动的:每个计数是其自己的小区。被合并到单元中的最后数计算检验统计量的所有大于最大计数的计数。


值----------Value----------

A list of class "goodfit" with elements:
类"goodfit"的元素的列表:


参数:observed
observed frequencies.
观察到的频率。


参数:count
corresponding counts.
相应的计数。


参数:fitted
expected frequencies (fitted by ML).
预期的频率(拟合ML)。


参数:type
a character string indicating the distribution fitted.
一个字符串表示的分布安装。


参数:method
a character string indicating the fitting method (can be either "ML", "MinChisq" or "fixed" if the parameters were specified).
一个字符串表示的拟合方法(可以是"ML","MinChisq"或"fixed",如果在规定的参数)。


参数:df
degrees of freedom.
自由度。


参数:par
a named list of the (estimated) distribution parameters.
(估计值)分布参数的命名列表。


(作者)----------Author(s)----------



Achim Zeileis <a href="mailto:Achim.Zeileis@R-project.org">Achim.Zeileis@R-project.org</a>




参考文献----------References----------

Visualizing Categorical Data. SAS Institute, Cary, NC.

实例----------Examples----------


## Simulated data examples:[#模拟数据的例子:]
dummy <- rnbinom(200, size = 1.5, prob = 0.8)
gf <- goodfit(dummy, type = "nbinomial", method = "MinChisq")
summary(gf)
plot(gf)

dummy <- rbinom(100, size = 6, prob = 0.5)
gf1 <- goodfit(dummy, type = "binomial", par = list(size = 6))
gf2 <- goodfit(dummy, type = "binomial", par = list(prob = 0.6, size = 6))
summary(gf1)
plot(gf1)
summary(gf2)
plot(gf2)

## Real data examples:[#实时数据的例子:]
data("HorseKicks")
HK.fit <- goodfit(HorseKicks)
summary(HK.fit)
plot(HK.fit)

data("Federalist")
## try geometric and full negative binomial distribution[#尝试几何及全负二项分布]
F.fit <- goodfit(Federalist, type = "nbinomial", par = list(size = 1))
F.fit2 <- goodfit(Federalist, type = "nbinomial")
summary(F.fit)
summary(F.fit2)
plot(F.fit)
plot(F.fit2)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-27 08:36 , Processed in 0.026736 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表