找回密码
 注册
查看: 13800|回复: 2

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

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

                                         Choose a model by AIC in a Stepwise Algorithm
                                         选择模型,由工商行政管理机关在逐步算法

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

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

Select a formula-based model by AIC.
由AIC选择公式为基础的模式。


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


step(object, scope, scale = 0,
     direction = c("both", "backward", "forward"),
     trace = 1, keep = NULL, steps = 1000, k = 2, ...)



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

参数:object
an object representing a model of an appropriate class (mainly "lm" and "glm"). This is used as the initial model in the stepwise search.  
代表了一个合适的类模型(对象主要是"lm"和"glm")。这是用来作为初始模型中逐步搜索。


参数:scope
defines the range of models examined in the stepwise search. This should be either a single formula, or a list containing components upper and lower, both formulae.  See the details for how to specify the formulae and how they are used.  
定义的范围在逐步搜索研究模型。这应该是一个单一的公式,或一个列表,其中包含组件upper和lower,两个公式。请参阅如何指定公式和如何使用它们的详细信息。


参数:scale
used in the definition of the AIC statistic for selecting the models, currently only for lm, aov and glm models.  The default value, 0, indicates the scale should be estimated: see extractAIC.  
AIC的统计定义用于选择的车型,目前仅用于lm,aov和glm模型。默认值,0,表示规模应估计:看到extractAIC。


参数:direction
the mode of stepwise search, can be one of "both", "backward", or "forward", with a default of "both".  If the scope argument is missing the default for direction is "backward".  
逐步搜索模式,可以是一个"both","backward"或"forward",与"both"的默认。如果scope参数缺少direction的默认是"backward"。


参数:trace
if positive, information is printed during the running of step. Larger values may give more detailed information.  
如果阳性,信息打印在step运行。较大的值可能会提供更详细的信息。


参数:keep
a filter function whose input is a fitted model object and the  associated AIC statistic, and whose output is arbitrary.  Typically keep will select a subset of the components of  the object and return them. The default is not to keep anything.  
一个过滤器的功能,其输入是拟合模型对象和相关AIC统计,其输出是任意的。通常keep将选择对象的组件的一个子集,并返回它们。默认情况下是不保留任何东西。


参数:steps
the maximum number of steps to be considered.  The default is 1000 (essentially as many as required).  It is typically used to stop the process early.  
要考虑的最大数量的步骤。默认值是1000(基本上许多)。它通常用于早期停止进程。


参数:k
the multiple of the number of degrees of freedom used for the penalty. Only k = 2 gives the genuine AIC: k = log(n) is sometimes referred to as BIC or SBC.  
多用于罚款的自由度数。只k = 2给人真正的工商行政管理机关:k = log(n)有时被称为BIC或单板。


参数:...
any additional arguments to extractAIC.  
extractAIC任何额外的参数。


Details

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

step uses add1 and drop1 repeatedly; it will work for any method for which they work, and that is determined by having a valid method for extractAIC. When the additive constant can be chosen so that AIC is equal to Mallows' Cp, this is done and the tables are labelled appropriately.
step使用add1和drop1反复也将努力为他们的工作方法,确定有一个有效的方法extractAIC。当加常数等于锦葵“,使工商行政管理机关是可以选择Cp,这是做适当的标记表。

The set of models searched is determined by the scope argument. The right-hand-side of its lower component is always included in the model, and right-hand-side of the model is included in the upper component.  If scope is a single formula, it specifies the upper component, and the lower model is empty.  If scope is missing, the initial model is used as the upper model.
scope参数确定的搜索模型。 lower组件的右手端始终包含在模型中,模型的右手端包含在upper组件。 scope如果是一个公式,它指定upper组件,lower模型是空的。 scope如果丢失,被用作初始模型upper模型。

Models specified by scope can be templates to update object as used by update.formula.  So using . in a scope formula means "what is already there", with .^2 indicating all interactions of existing terms.
scope指定型号可以是模板更新objectupdate.formula的使用的。因此,使用.scope公式中的意思是“什么是已经存在,.^2说明现有的所有交互。

There is a potential problem in using glm fits with a variable scale, as in that case the deviance is not simply related to the maximized log-likelihood.  The "glm" method for function extractAIC makes the appropriate adjustment for a gaussian family, but may need to be amended for other cases.  (The binomial and poisson families have fixed scale by default and do not correspond to a particular maximum-likelihood problem for variable scale.)
有一个潜在的问题,在使用glm适合用变量scale,在这种情况下,偏差不只是关系到最大化的日志的可能性。 功能"glm"方法extractAICgaussian家庭的适当调整,但其他情况下可能需要修订。 (binomial和poisson家庭有固定的scale默认情况下,不符合变量scale到一个特定的可能性最大问题。)


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

the stepwise-selected model is returned, with up to two additional components.  There is an "anova" component corresponding to the steps taken in the search, as well as a "keep" component if the keep= argument was supplied in the call. The "Resid. Dev" column of the analysis of deviance table refers to a constant minus twice the maximized log likelihood: it will be a deviance only in cases where a saturated model is well-defined (thus excluding lm, aov and survreg fits, for example).
逐步所选模型返回,最多两个附加组件。如果在呼叫提供"anova"参数,有"keep"在搜索中所采取的措施相应组件,以及一个keep=组件。 "Resid. Dev"的越轨表分析列指的是一个常数减去两次最大化日志的可能性:这将是一个只有在饱和模型定义的情况下的越轨行为(从而排除lm, aov和survreg适合的例子)。


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

The model fitting must apply the models to the same dataset. This may be a problem if there are missing values and R's default of na.action = na.omit is used.  We suggest you remove the missing values first.
模型拟合必须适用相同的数据集模型。这可能是一个问题,如果有缺失值和R的默认na.action = na.omit使用。我们建议您先删除遗漏值。

Calls to the function nobs are used to check that the number of observations involved in the fitting process remains unchanged.
调用函数nobs可以用来检查,在装修过程中所涉及的意见数目维持不变。


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

This function differs considerably from the function in S, which uses a number of approximations and does not in general compute the correct AIC.
此功能差别很大,从S中的功能,它采用了近似的数量和不是一般的计算正确的工商行政管理机关。

This is a minimal implementation.  Use stepAIC in package MASS for a wider range of object classes.
这是一个很小的实现。 stepAIC包中使用MASS更广泛的对象类。


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



B. D. Ripley: <code>step</code> is a slightly simplified version of
<code><a href="../../MASS/html/stepAIC.html">stepAIC</a></code> in package <span class="pkg">MASS</span> (Venables &amp;
Ripley, 2002 and earlier editions).

The idea of a <code>step</code> function follows that described in Hastie &amp;
Pregibon (1992); but the implementation in <font face="Courier New,Courier" color="#666666"><b>R</b></font> is more general.




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

Generalized linear models. Chapter 6 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth &amp; Brooks/Cole.
Modern Applied Statistics with S. New York: Springer (4th ed).

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

stepAIC in MASS, add1, drop1
stepAICMASS,add1,drop1


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


## following on from example(lm)[#下面就从例子(LM)]

step(lm.D9)  

summary(lm1 <- lm(Fertility ~ ., data = swiss))
slm1 <- step(lm1)
summary(slm1)
slm1$anova

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


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

使用道具 举报

发表于 2014-7-19 10:40:51 | 显示全部楼层
{:soso_e179:}
AIC:赤池信息量准则
回复 支持 反对

使用道具 举报

发表于 2015-5-3 18:41:31 | 显示全部楼层
本帖最后由 Tiramisu023 于 2015-5-3 18:46 编辑

The Akaike Information Criterion is a measure of the relative goodness of fit of a statistical model. It was developed by Hirotsugu Akaike in 1974. AIC provides a means for comparison among models, a tool for model selection.

      AIC = 2k &#8722; 2ln(L)

where k is the number of parameters in the statistical model, and L is the maximized value of the likelihood function for the estimated model.

AICc is AIC with a correction for finite sample sizes.

      AICc=AIC + 2k(k+1) / (n-k-1)

where k denotes the number of model parameters. Thus, AICc is AIC with a greater penalty for extra parameters.

AIC就是用最小的变量去解释最多的变异,从而达到最大的似然性,因此AIC值越小越好,AICc是对AIC的校正,特别是观测值较小时。当观测值越大的时候,AICc就越接近AIC.
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-22 22:05 , Processed in 0.025837 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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