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

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

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

                                        Construct a groupedData Object
                                         构建一个groupedData对象

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

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

An object of the groupedData class is constructed from the formula and data by attaching the formula as an attribute of the data, along with any of outer, inner, labels, and units that are given.  If order.groups is TRUE the grouping factor is converted to an ordered factor with the ordering determined by FUN. Depending on the number of grouping levels and the type of primary covariate, the returned object will be of one of three classes: nfnGroupedData - numeric covariate, single level of nesting; nffGroupedData - factor covariate, single level of nesting; and nmGroupedData - multiple levels of nesting. Several modeling and plotting functions can use the formula stored with a groupedData object to construct default plots and models.
是构建groupedData类formula和data附加任何formula的outer属性数据,沿对象inner,labels,units,给出了。如果order.groups是TRUE分组因素转换的顺序由FUN确定一个有序的因素。根据分组级别的数量和主要协变量的类型,返回的对象将是三类:nfnGroupedData - 数字协变量,嵌套的单级;nffGroupedData - 协的因素,单级嵌套nmGroupedData - 多层次的嵌套。几个建模和绘图功能,可以使用公式groupedData对象存储构建默认的图和模型。


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


groupedData(formula, data, order.groups, FUN, outer, inner,
labels, units)
## S3 method for class 'groupedData'
update(object, formula, data, order.groups, FUN,
outer, inner, labels, units, ...)



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

参数:object
an object inheriting from class groupedData.
继承类groupedData对象。


参数:formula
a formula of the form resp ~ cov | group where resp is the response, cov is the primary covariate, and group is the grouping factor.  The expression 1 can be used for the primary covariate when there is no other suitable candidate.  Multiple nested grouping factors can be listed separated by the / symbol as in fact1/fact2.  In an expression like this the fact2 factor is nested within the fact1 factor.
形式的公式resp ~ cov | group其中resp响应,cov是主要的协变量,group是分组因素。表达1可以用于主协变量时,有没有其他合适人选。可以列出多个嵌套分组因素分开/fact1/fact2象征。在这样的表达式fact2因素嵌套fact1因素。


参数:data
a data frame in which the expressions in formula can be evaluated.  The resulting groupedData object will consist of the same data values in the same order but with additional attributes.
formula表达一个数据框可以评估。产生groupedData对象将包括在相同的顺序,但附加属性相同的数据值。


参数:order.groups
an optional logical value, or list of logical values, indicating if the grouping factors should be converted to ordered factors according to the function FUN applied to the response from each group. If multiple levels of grouping are present, this argument can be either a single logical value (which will be repeated for all grouping levels) or a list of logical values. If no names are assigned to the list elements, they are assumed in the same order as the group levels (outermost to innermost grouping). Ordering within a level of grouping is done within the levels of the grouping factors which are outer to it. Changing the grouping factor to an ordered factor does not affect the ordering of the rows in the data frame but it does affect the order of the panels in a trellis display of the data or models fitted to the data.  Defaults to TRUE.   
一个可选的逻辑值或逻辑值的列表,如果分组因素应该被转换为有序的因素,根据功能FUN适用于从每个组的响应。如果存在多层次的分组,这个参数可以是一个逻辑值(将所有分组级别的重复)或逻辑值的列表。如果没有名称分配给列表中的元素,他们假设在相同的顺序组水平(最外层到最内层的分组)。这是它的外部的分组因素的水平排列在一个水平的分组内完成。改变分组因素,有序的因素,不会影响在数据框的行的顺序,但不影响中的数据或数据拟合模型的网格显示面板的订单。 TRUE默认。


参数:FUN
an optional summary function that will be applied to the values of the response for each level of the grouping factor, when order.groups = TRUE, to determine the ordering.  Defaults to the max function.
一个可选的汇总函数,为每个分组因素水平将应用于响应值,当order.groups = TRUE,确定顺序。默认max的函数。


参数:outer
an optional one-sided formula, or list of one-sided formulas, indicating covariates that are outer to the grouping factor(s).  If multiple levels of grouping are present, this argument can be either a single one-sided formula, or a list of one-sided formulas. If no names are assigned to the list elements, they are assumed in the same order as the group levels (outermost to innermost grouping). An outer covariate is invariant within the sets of rows defined by the grouping factor.  Ordering of the groups is done in such a way as to preserve adjacency of groups with the same value of the outer variables.  When plotting a  groupedData object, the argument outer = TRUE causes the panels to be determined by the outer formula.  The points within the panels are  associated by level of the grouping factor. Defaults to NULL, meaning that no outer covariates are present.  
一个可选的片面的公式,或片面公式列表,说明分组因子(S),外协变量。如果存在多层次的分组,这个参数可以是一个片面的公式,或片面公式的列表。如果没有名称分配给列表中的元素,他们假设在相同的顺序组水平(最外层到最内层的分组)。外协变量是不变的定义分组因素的行集内。是在这样一种方式,保持与外部变量的值相同组邻接排列的团体。当绘制groupedData对象,参数outer = TRUE导致面板outer公式确定。面板内点水平分组因素相关。 NULL默认值,也就是说没有外协变量存在。


参数:inner
an optional one-sided formula, or list of one-sided formulas, indicating covariates that are inner to the grouping factor(s). If multiple levels of grouping are present, this argument can be either a single one-sided formula, or a list of one-sided formulas. If no names are assigned to the list elements, they are assumed in the same order as the group levels (outermost to innermost grouping). An inner covariate can change  within the sets of rows defined by the grouping factor.  An inner formula can be used to associate points in a plot of a groupedData object.  Defaults to NULL, meaning that no inner covariates are present.  
一个可选的片面的公式,或片面公式列表,说明协变量的分组因素(S)内。如果存在多层次的分组,这个参数可以是一个片面的公式,或片面公式的列表。如果没有名称分配给列表中的元素,他们假设在相同的顺序组水平(最外层到最内层的分组)。一种内在的协变量定义分组因素的行集内可以改变。一种内在的公式可以用来在剧情一个groupedData对象关联点。 NULL默认,即没有内在的协变量存在。


参数:labels
an optional list of character strings giving labels for the response and the primary covariate.  The label for the primary covariate is named x and that for the response is named y.  Either label can be omitted.
给予响应和主协变量标签的字符字符串的可选列表。主协变量的标签被命名为x“响应名为y的。要么标签可以省略。


参数:units
an optional list of character strings giving the units for the response and the primary covariate.  The units string for the primary covariate is named x and that for the response is named y.  Either units string can be omitted.
给予响应的单位和主要协变量的字符字符串的可选列表。单位为主要协变量字符串被命名为x“响应名为y的。无论是单位的字符串可以被省略。


参数:...
some methods for this generic require additional arguments.  None are used in this method.  
这个通用的一些方法需要额外的参数。没有使用这种方法。


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

an object of one of the classes nfnGroupedData, nffGroupedData, or nmGroupedData, and also inheriting from  classes groupedData and data.frame.
一个类的对象nfnGroupedData,nffGroupedData或nmGroupedData,也继承类groupedData和data.frame。


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


Douglas Bates and Jose Pinheiro



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

Data", in "Modelling Longitudinal and Spatially Correlated Data: Methods, Applications and Future Directions", T.G. Gregoire (ed.), Springer-Verlag, New York.
Mixed-Effects Software: Design of NLME 3.0" available at http://nlme.stat.wisc.edu/
in S and S-PLUS", Springer.  

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

formula, gapply, gsummary, lme, plot.nffGroupedData, plot.nfnGroupedData, plot.nmGroupedData, reStruct
formula,gapply,gsummary,lme,plot.nffGroupedData,plot.nfnGroupedData,plot.nmGroupedData,reStruct


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


Orth.new <-  # create a new copy of the groupedData object[创建一个新的groupedData对象的副本]
  groupedData( distance ~ age | Subject,
              data = as.data.frame( Orthodont ),
              FUN = mean,
              outer = ~ Sex,
              labels = list( x = "Age",
                y = "Distance from pituitary to pterygomaxillary fissure" ),
              units = list( x = "(yr)", y = "(mm)") )
## Not run: [#无法运行:]
plot( Orth.new )         # trellis plot by Subject[格子图由主题]

## End(Not run)[#结束(不运行)]
formula( Orth.new )      # extractor for the formula[提取的公式]
gsummary( Orth.new )     # apply summary by Subject[适用于除总结]
fm1 <- lme( Orth.new )   # fixed and groups formulae extracted from object[固定和群体公式从对象中提取]
Orthodont2 <- update(Orthodont, FUN = mean)

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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