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

R语言:add1()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:24:02 | 显示全部楼层 |阅读模式
add1(stats)
add1()所属R语言包:stats

                                        Add or Drop All Possible Single Terms to a Model
                                         添加或删除一个模型的所有可能的单条款

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

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

Compute all the single terms in the scope argument that can be added to or dropped from the model, fit those models and compute a table of the changes in fit.
计算单scope参数,可以添加或下降从模型中的所有条款,适合那些模型和计算表在适当的变化。


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


add1(object, scope, ...)

## Default S3 method:[默认方法]
add1(object, scope, scale = 0, test = c("none", "Chisq"),
     k = 2, trace = FALSE, ...)

## S3 method for class 'lm'
add1(object, scope, scale = 0, test = c("none", "Chisq", "F"),
     x = NULL, k = 2, ...)

## S3 method for class 'glm'
add1(object, scope, scale = 0, test = c("none", "Rao", "LRT", "Chisq", "F"),
     x = NULL, k = 2, ...)

drop1(object, scope, ...)

## Default S3 method:[默认方法]
drop1(object, scope, scale = 0, test = c("none", "Chisq"),
      k = 2, trace = FALSE, ...)

## S3 method for class 'lm'
drop1(object, scope, scale = 0, all.cols = TRUE,
      test = c("none", "Chisq", "F"), k = 2, ...)

## S3 method for class 'glm'
drop1(object, scope, scale = 0, test = c("none", "Rao", "LRT", "Chisq", "F"),
      k = 2, ...)



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

参数:object
a fitted model object.
拟合模型对象。


参数:scope
a formula giving the terms to be considered for adding or dropping.
公式提供的条款被认为是添加或删除。


参数:scale
an estimate of the residual mean square to be used in computing Cp. Ignored if 0 or NULL.
残余的估计均方被用于计算Cp。如果0或NULL忽略。


参数:test
should the results include a test statistic relative to the original model?  The F test is only appropriate for lm and aov models or perhaps for glm fits with estimated dispersion. The Chisq test can be an exact test (lm models with known scale) or a likelihood-ratio test or a test of the reduction in scaled deviance depending on the method. For glm fits, you can also choose "LRT" and  "Rao" for likelihood ratio tests and Rao's efficient score test.  The former is synonymous with "Chisq" (although both have  an asymptotic chi-square distribution).  
结果应该包括一个测试统计,相对于原始模型? F检验是只lm和aov模型或者为glm适合估计分散。 Chisq测试可以是一个准确的测试(lm与已知规模的模型),或似然比检验或减少规模越轨取决于方法的测试。 glm配合,你也可以选择"LRT"和"Rao"似然比检验和饶的高效得分测试。前者是"Chisq"(虽然都有一个渐近卡方分布)的代名词。


参数:k
the penalty constant in AIC / Cp.
/CpAIC中的刑罚不变。


参数:trace
if TRUE, print out progress reports.
如果TRUE,打印出的进度报告。


参数:x
a model matrix containing columns for the fitted model and all terms in the upper scope.  Useful if add1 is to be called repeatedly.  Warning: no checks are done on its validity.
模型矩阵载列的拟合模型,并在范围上的所有条款。有用如果add1是被反复调用。警告:没有检查其有效性。


参数:all.cols
(Provided for compatibility with S.)  Logical to specify whether all columns of the design matrix should be used.  If FALSE then non-estimable columns are dropped, but the result is not usually statistically meaningful.
(与S的兼容性提供)逻辑来指定是否应采用的设计矩阵的所有列。如果FALSE然后被丢弃非估列,但结果是没有统计学意义。


参数:...
further arguments passed to or from other methods.
通过进一步的论据或其他方法。


Details

详情----------Details----------

For drop1 methods, a missing scope is taken to be all terms in the model. The hierarchy is respected when considering terms to be added or dropped: all main effects contained in a second-order interaction must remain, and so on.
drop1方法,缺少scope采取的是模型中的所有条款。考虑要添加或删除的条款时,被尊重的层次:在二阶互动中所有主要的影响必须保持,依此类推。

In a scope formula . means "what is already there".
scope公式.手段“什么是已经存在”。

The methods for lm and glm are more efficient in that they do not recompute the model matrix and call the fit methods directly.
lm和glm他们不重新计算模型矩阵和调用的fit方法直接更有效的方法。

The default output table gives AIC, defined as minus twice log likelihood plus 2p where p is the rank of the model (the number of effective parameters).  This is only defined up to an additive constant (like log-likelihoods).  For linear Gaussian models with fixed scale, the constant is chosen to give Mallows' Cp, RSS/scale + 2p - n.  Where Cp is used, the column is labelled as Cp rather than AIC.
默认的输出表给出了AIC的定义,减去两次记录的可能性,加上2pp模型(有效参数)的排名。这是只定义了加常数(如对数似然性)。定额线性高斯模型,常数选择给锦葵Cp,RSS/scale + 2p - n。 Cp,列标记为Cp而不是AIC。

The F tests for the "glm" methods are based on analysis of deviance tests, so if the dispersion is estimated it is based on the residual deviance, unlike the F tests of anova.glm.
"glm"方法的F测试上基于越轨测试分析,因此,如果分散估计是基于残余偏差,不像anova.glmF检验。


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

An object of class "anova" summarizing the differences in fit between the models.
一个类的对象"anova"总结在合适的模型之间的差异。


警告----------Warning----------

The model fitting must apply the models to the same dataset. Most methods will attempt to use a subset of the data with no missing values for any of the variables if na.action=na.omit, but this may give biased results.  Only use these functions with data containing missing values with great care.
模型拟合必须适用相同的数据集模型。大多数方法将尝试使用任何变量如果na.action=na.omit,但是这可能会偏向结果没有缺失值的数据的一个子集。含缺失值的数据非常谨慎,只使用这些功能。

The default methods make calls to the function nobs to check that the number of observations involved in the fitting process remained unchanged.
默认的方法使调用函数nobs检查,在装修过程中所涉及的意见的数量保持不变。


注意----------Note----------

These are not fully equivalent to the functions in S.  There is no keep argument, and the methods used are not quite so computationally efficient.
这些都不是完全等同于S中的职能有没有keep参数,使用的方法是不是这么计算效率。

Their authors' definitions of Mallows' Cp and Akaike's AIC are used, not those of the authors of the models chapter of S.
Cp和赤池的AIC作者锦葵定义“,而不是那些学模型本章作者


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



The design was inspired by the S functions of the same names described
in Chambers (1992).




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

Linear models. Chapter 4 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.

参见----------See Also----------

step, aov, lm, extractAIC, anova
step,aov,lm,extractAIC,anova


举例----------Examples----------



require(graphics); require(utils)
## following example(swiss)[#下面的例子(瑞士)]
lm1 <- lm(Fertility ~ ., data = swiss)
add1(lm1, ~ I(Education^2) + .^2)
drop1(lm1, test="F")  # So called 'type II' anova[所谓“II型”ANOVA]

## following example(glm)[#下面的例子(GLM)]

drop1(glm.D93, test="Chisq")
drop1(glm.D93, test="F")
add1(glm.D93, scope=~outcome*treatment, test="Rao") ## Pearson Chi-square [Pearson卡方#]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 15:13 , Processed in 0.023070 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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