merge_design.covariates(RMark)
merge_design.covariates()所属R语言包:RMark
Merge time (occasion) and/or group specific covariates into design data
合并时间(机会)和/或一组特定的协变量纳入设计数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Adds new design data fields from a dataframe into a design data list (ddl) by matching via time and/or group field in the design data.
添加新的设计数据从一个数据框领域的设计数据列表(ddl)通过在设计数据的时间和/或组字段相匹配。
用法----------Usage----------
merge_design.covariates(ddl, df, bygroup = FALSE,
bytime = TRUE)
参数----------Arguments----------
参数:ddl
current design dataframe for a specific parameter and not the entire design data list (ddl); see example below
目前的设计数据框特定参数的设计,而不是整个数据列表(DDL),见下面的例子
参数:df
dataframe with time(occasion) and/or group-specific data
数据框随着时间的推移(场合)和/或特定组的数据
参数:bygroup
logical; if TRUE, then a field named group should be in df and the values can then be group specific.
逻辑,如果为true,那么一场名为group应该是在df,然后可以组特定的值。
参数:bytime
logical; if TRUE, then a field named time should be in df and the values can then be time specific.
逻辑;如果为TRUE,那么一场名为time应在df和值可以是时间的具体。
Details
详细信息----------Details----------
Design data can be added to the parameter specific design dataframes with R commands. This function simplifies the process by enabling the merging of a dataframe with a time and/or group field and one or more time and/or group specific covariates into the design data list for a specific model parameter. This is a replacement for the older function merge.occasion.data. Unlike the older function, it uses the R function merge but before merging it makes sure all of the fields exist and that you are not merging data that already exists in the design data. It also maintains the row names in the case where design data have been deleted prior to merging the design covariate data.
设计数据可以被添加到与R命令的参数的具体设计dataframes。此功能简化了处理过程,通过使合并的时间和/或组的字段,和一个或多个时间和/或一组特定的协变量进入设计数据列表中的一个特定的模型参数的数据框。这是一个替代的功能merge.occasion.data。与旧的功能,它使用R函数merge的,但在合并之前,它可以确保所有的字段存在,你是不是合并的数据中已经存在的设计数据。它还保持的行的名称中的情况下,设计数据已被删除之前,合并的设计协变量数据。
If bytime=TRUE,the dataframe df must have a field named time that matches 1-1 for each value of time in the design data list (ddl). All fields in df (other than time/group) are added to the design data. If you set bygroup=TRUE and have a field named group in df and its values match the group fields in the design data then group-specific values can be assigned for each time if bytime=TRUE. If bygroup=TRUE and bytime=FALSE then it matches by group and not by time.
如果bytime=TRUE,的数据框df必须有一个字段名为time匹配1-1的每个值time在设计数据列表(ddl) 。 df(以外时间/组)中的所有字段添加到设计数据。如果您bygroup=TRUE有一个字段名为groupdf和它的值匹配的组领域中的设计数据,然后组特定的值,可以为每种时间<X >。如果bytime=TRUE和bygroup=TRUE那么它匹配的组,而不是由时间。
值----------Value----------
Design dataframe (for a particular parameter) with new fields added. See make.design.data for a description of the design data list structure. The return value is only one element in the list rather than the entire list as with the older function merge.occasion.data.
设计数据框(为一个特定的参数)与新的字段。请参阅make.design.data的设计数据列表结构的描述。返回值是列表,而不是与旧的功能merge.occasion.data整个列表中只有一个元素。
(作者)----------Author(s)----------
Jeff Laake
参见----------See Also----------
make.design.data, process.data, add.design.data
make.design.data,process.data,add.design.data
实例----------Examples----------
data(dipper)
dipper.proc=process.data(dipper)
ddl=make.design.data(dipper.proc)
df=data.frame(time=c(1:7),effort=c(10,5,2,8,1,2,3))
# note that the value for time 1 is superfluous for CJS but not for POPAN[注意,时间1的值是多余的CJS,但不为POPAN]
# the value 10 will not appear in the summary because there is no p for time 1[因为没有时间1 p的值10不会出现在总结]
summary(ddl$p)
ddl$p=merge_design.covariates(ddl$p,df)
summary(ddl$p)
#[]
# Assign group-specific values[分配组特定的值]
#[]
dipper.proc=process.data(dipper,groups="sex")
dipper.ddl=make.design.data(dipper.proc)
df=data.frame(group=c(rep("Female",6),rep("Male",6)),time=rep(c(2:7),2),
effort=c(10,5,2,8,1,2,3,20,10,4,16,2))
merge_design.covariates(dipper.ddl$p,df,bygroup=TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|