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

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

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

                                        Description of Terms Objects
                                         描述对象的条款

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

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

An object of class terms holds information about a model.  Usually the model was specified in terms of a formula and that formula was used to determine the terms object.
terms类的对象拥有一个模型的信息。通常的模式是在指定formula“公式被用来确定对象。


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

The object itself is simply the formula supplied to the call of terms.formula.  The object has a number of attributes and they are used to construct the model frame:
对象本身仅仅是提供呼叫terms.formula公式。对象具有一些属性,并用它们来构建模型框架:


参数:factors
A matrix of variables by terms showing which variables appear in which terms.  The entries are 0 if the variable does not occur in the term, 1 if it does occur and should be coded by contrasts, and 2 if it occurs and should be coded via dummy variables for all levels (as when an intercept or lower-order term is missing).  If there are no terms other than an intercept and offsets, this is numeric(0).
一个方面显示哪些变量在这方面出现的矩阵变量。条目是0,如果变量不发生在任期内,如果它不发生,应通过对比,和2编码,如果它发生,应通过各级哑变量编码(当一个拦截或低阶长期缺少)。如果有一个拦截和偏移以外的任何条款,这是numeric(0)。


参数:term.labels
A character vector containing the labels for each of the terms in the model, except for offsets.  Non-syntactic names will be quoted by backticks.  Note that these are after possible re-ordering (unless argument keep.order was false).
一个特征向量模型中的每一个方面的标签,除了抵消。非句法的名字将被引用的反引号。请注意,这些可能重新排序后(除非参数keep.order是假的)。


参数:variables
A call to list of the variables in the model.
list模型中的变量调用。


参数:intercept
Either 0, indicating no intercept is to be fit, or 1 indicating that an intercept is to be fit.
为0,表示没有拦截,是合适的,或1表示截距是要适合。


参数:order
A vector of the same length as term.labels indicating the order of interaction for each term.
一个term.labels表示为了每学期的互动相同长度的向量。


参数:response
The index of the variable (in variables) of the response (the left hand side of the formula). Zero, if there is no response.
指数响应变量(变量)(公式的左边)。零,如果没有任何反应。


参数:offset
If the model contains offset terms there is an offset attribute indicating which variable(s) are offsets
如果模型包含offset方面有一个offset属性,指示变量(S)偏移


参数:specials
If a specials argument was given to terms.formula there is a specials attribute, a pairlist of vectors (one for each specified special function) giving numeric indices of the arguments of the list returned as the variables attribute which contain these special functions.
如果specialsterms.formula参数还有specials属性,向量pairlist的(每个指定的特殊功能之一)给数字指标参数列表返回variables属性,它包含这些特殊功能。


参数:dataClasses
optional. A named character vector giving the classes (as given by .MFclass) of the variables used in a fit.
可选的。命名特征向量的类在一个合适的变量(如由.MFclass给)。

The object has class c("terms", "formula").
对象具有类c("terms", "formula")。


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

These objects are different from those found in S.  In particular there is no formula attribute, instead the object is itself a formula.  Thus, the mode of a terms object is different as well.
这些对象是S中发现,特别是那些不同,有没有formula属性,而不是对象本身是一个公式。因此,一个对象的模式是不同的。

Examples of the specials argument can be seen in the aov and coxph functions, the latter from package survival.
可以看出specials和aov功能,后者从包coxphsurvival参数的例子。


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

terms, formula.
terms,formula。


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


## use of specials (as used for gam() in packages mgcv and gam)[#特价(GAM()包mgcv和GAM)]
(tf <- terms(y ~ x + x:z + s(x), specials = "s"))
## Note that the "factors" attribute has variables as row names[#注意,“因素”属性变量作为列名]
## and term labels as column names, both as character vectors. [#长期的标签和列名,无论是作为特征向量。]
attr(tf, "specials")    # index 's' variable(s)[指数的变量(S)]
rownames(attr(tf, "factors"))[attr(tf, "specials")$s]

## we can keep the order by[#我们可以保持订单]
terms(y ~ x + x:z + s(x), specials = "s", keep.order = TRUE)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 09:27 , Processed in 0.034351 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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