create.model.list(RMark)
create.model.list()所属R语言包:RMark
Creates a dataframe of all combinations of parameter specifications
创建一个数据框的所有组合的参数规格
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Creates a dataframe of all combinations of parameter specifications for each parameter in a particular type of MARK model. It is used together with mark.wrapper to run a series of models from sets of parameter specifications.
创建一个数据框规格参数的所有组合在特定类型的每个参数的MARKmodel。这是一起使用mark.wrapper运行的系列车型从一组参数规格。
用法----------Usage----------
create.model.list(model)
参数----------Arguments----------
参数:model
character string identifying the type of model (e.g., "CJS")
字符识别模型的类型的字符串(例如,“CJS”)
Details
详细信息----------Details----------
This function scans the frame of the calling enviroment and collects all list objects that contain a formula and have names that match parameter. where parameter is the name of a type of parameter in the model type. For example, it looks for Phi. and p. for model="CJS". Any number of characters can follow the period. Each of the named objects should specify a list that matches the structure of a parameter specification as described in make.mark.model. It only collects list objects that contain an element named formula, thus it will not collect one like Phi.fixed=list(fixed=1). If you want to do something like that, specify it as Phi.fixed=list(formula=~1,fixed=1). It is safest to use this inside a function that defines all of the parameter specifications as shown in the example below. The primary use for this function is to create a dataframe which is passed to mark.wrapper to construct and run each of the models. It was written as a separate function to provide flexibility to add/delete/modify the list prior to passing to mark.wrapper. For example, only certain combinations may make sense for some parameter specifications. Thus you could define a set to create all the combinations and then delete the ones from the dataframe that do not make sense. you want, add others and re-run the function and merge the resulting dataframes. If there are no specifications found for a particular model parameter, it is not included in the list and when it is passed to make.mark.model, the default specification will be used for that parameter.
此功能可扫描的框架调用的环境,并收集所有的列表对象,其中包含公式的名称相匹配parameter.参数是一种类型的参数model类型的名称。例如,它看起来Phi.和p.的model="CJS"。任何数目的字符可以遵循的时期。每个命名对象应指定一个列表,该列表的结构相匹配的参数规范,如描述在make.mark.model。只收集包含一个名为formula,因此它不会收集一个像Phi.fixed=list(fixed=1)元素的列表对象。如果你想要做类似的东西,将其指定为Phi.fixed=list(formula=~1,fixed=1)。最安全的方法是使用一个函数内部定义所有规格参数,如下面的例子所示。此功能的主要用途是创建一个数据框传递给mark.wrapper的模型构建和运行。它被写了作为一个独立的功能,提供灵活地添加/删除/修改前的列表传递给mark.wrapper。例如,只有某些组合可能是有意义的一些参数规格。因此,您可以定义一组创建的所有组合,然后删除那些没有任何意义的数据框。你想要的,添加和重新运行的功能和合并产生的dataframes,。如果没有找到一个特定的模型参数的规格,它不包括在列表中时,它被传递给make.mark.model,将被用于该参数的默认规范。
值----------Value----------
dataframe of all combinations of parameter specifications for a model. Each field (column) is the name of a type of parameter (e.g., p and Phi for CJS). The values are character strings identifying particular parameter specifications.
数据框的参数规格的所有组合的模型。每个字段(列)是一种类型的参数的名称(例如,p和披为CJS)。的值是字符串,确定具体的参数规格。
(作者)----------Author(s)----------
Jeff Laake
参见----------See Also----------
mark.wrapper
mark.wrapper
实例----------Examples----------
#[]
# Compare this to the run.dipper shown under ?dipper[与此相比,显示在run.dipper?瓢]
# It is only necessary to create each parameter specification and[它是只需要创建每个参数说明书和]
# create.model.list and mark.wrapper will create and run models for[create.model.list和mark.wrapper创建和运行模式]
# each combination. Notice that the naming of the parameter[每个组合。请注意,该参数的命名]
# specifications has been changed to accommodate format for[规格已被改变,以适应格式]
# create.model.list. Only a subset of the parameter specifications[create.model.list。的一个子集的参数规格]
# are used here in comparison to other run.dipper[在这里比其他run.dipper]
#[]
data(dipper)
run.dipper=function()
{
#[]
# Process data[过程数据]
#[]
dipper.processed=process.data(dipper,groups=("sex"))
#[]
# Create default design data[创建默认的设计数据]
#[]
dipper.ddl=make.design.data(dipper.processed)
#[]
# Add Flood covariates for Phi and p that have different values[加入洪水的协变量披和p有不同的价值观]
#[]
dipper.ddl$Phi$Flood=0
dipper.ddl$Phi$Flood[dipper.ddl$Phi$time==2 |
dipper.ddl$Phi$time==3]=1
dipper.ddl$p$Flood=0
dipper.ddl$p$Flood[dipper.ddl$p$time==3]=1
#[]
# Define range of models for Phi[定义范围内的车型披]
#[]
Phi.dot=list(formula=~1)
Phi.time=list(formula=~time)
Phi.sex=list(formula=~sex)
Phi.Flood=list(formula=~Flood)
#[]
# Define range of models for p[定义范围内的车型为p]
#[]
p.dot=list(formula=~1)
p.time=list(formula=~time)
p.Flood=list(formula=~Flood)
#[]
# Run all pairings of models[运行所有配对的模型]
#[]
dipper.model.list=create.model.list("CJS")
dipper.results=mark.wrapper(dipper.model.list,
data=dipper.processed,ddl=dipper.ddl)
#[]
# Return model table and list of models[回归模型的表格和列表的车型]
#[]
return(dipper.results)
}
dipper.results=run.dipper()
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|