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

R语言 simPopulation包 simRelation()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 09:14:03 | 显示全部楼层 |阅读模式
simRelation(simPopulation)
simRelation()所属R语言包:simPopulation

                                         Simulate categorical variables of population data
                                         模拟分类变量的人口数据

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

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

Simulate categorical variables of population data taking relationships  between household members into account.  The household structure of the  population data needs to be simulated beforehand.
模拟分类变量的人口数据,考虑家庭成员之间的关系。家庭结构,人口数据,需要事先要模拟的。


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


simRelation(dataS, dataP, hid = "hhid", w = "weight",
            strata = "region", basic = c("age", "sex", "hsize"),
            relation = "relate", head = "head", direct = NULL,
            additional = c("nation", "ethnic", "religion"),
            limit = NULL, censor = NULL, maxit = 500,
            MaxNWts = 2000, eps = NULL, seed)



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

参数:dataS
a data.frame containing household survey data.
data.frame包含家庭调查数据。


参数:dataP
a data.frame containing the simulated population  household structure.
data.frame包含的模拟人口家庭结构。


参数:hid
a character string specifying the columns of dataS and  dataP, respectively, that contain the household ID.
一个字符串指定dataS和dataP,分别包含家庭ID列。


参数:w
a character string specifying the column of dataS that  contains the (personal) sample weights.
指定列的dataS,包含一个字符串(个人)样本权重。


参数:strata
a character string specifying the columns of dataS and  dataP, respectively, that define strata.  The values are simulated  for each stratum separately.  Note that this is currently a required  argument and only one stratification variable is supported.
一个字符串指定的列dataS和dataP,分别确定地层。各阶层分别是模拟的值。请注意,这是目前一个必要的参数,并支持只有一个分层变量。


参数:basic
a character vector specifying the columns of dataS and  dataP, respectively, that define the household structure, typically  age, gender and household size.
字符向量指定列的dataS和dataP,分别定义家庭结构,典型的年龄,性别和家庭的大小。


参数:relation
a character string specifying the columns of dataS and  dataP, respectively, that define the relationships between the  household members.
指定的列分别dataS和dataP,一个字符串,即定义的家庭成员之间的关系。


参数:head
a character string specifying the category of the variable given   by relation that identifies the household head.
一个字符串指定类别的变量relation确定户主。


参数:direct
a character string specifying categories of the variable given  by relation.  Simulated individuals with those categories directly  inherit the values of the additional variables from the household head.   The default is NULL such that no individuals directly inherit values  from the household head.
一个字符串,指定类别的relation给出的变量。模拟与这些类别的个人直接继承户主额外的变量的值。默认值是NULL没有直接继承户主的值。


参数:additional
a character vector specifying additional categorical  variables of dataS that should be simulated for the population data.
一个字符向量确定的其他分类变量的dataS应该是模拟的人口数据。


参数:limit
this can be used to account for structural zeros.  If only  one additional variable is requested, a named list of lists should be  supplied.  The names of the list components specify the predictor variables  for which to limit the possible outcomes of the response.  For each  predictor, a list containing the possible outcomes of the response for each  category of the predictor can be supplied.  The probabilities of other  outcomes conditional on combinations that contain the specified categories  of the supplied predictors are set to 0.  If more than one additional  variable is requested, such a list of lists can be supplied for each  variable as a component of yet another list, with the component names  specifying the respective variables.
这可以用来考虑到结构的零。如果要求只有一个额外的变量,一个名为列表的列表,应提供。列表组件的名称指定预测变量的限制可能的结果的反应。对于每一个预测,可以提供一个列表,其中包含每个类别的预测可能的结果的反应。条件的组合,包含指定的类别所提供的预测变量的其他结果的概率被设置为0。如果一个以上的附加变量被请求时,这样的列表的列表可以被提供为每个变量作为又一列表的一个组件,与组件名称指定相应的变量。


参数:censor
this can be used to account for structural zeros.  If only  one additional variable is requested, a named list of lists or  data.frames should be supplied.  The names of the list components  specify the categories that should be censored.  For each of these  categories, a list or data.frame containing levels of the predictor  variables can be supplied.  The probability of the specified categories is  set to 0 for the respective predictor levels.  If more than one additional  variable is requested, such a list of lists or data.frames can be  supplied for each variable as a component of yet another list, with the  component names specifying the respective variables.
这可以用来考虑到结构的零。如果只有一个要求额外的变量,命名列表,列表或data.frame的,应提供。列表组件的名称指定的类别,应审查。对于每个类别,列表或data.frame可以提供包含预测变量的水平。指定类别的概率被设置为0的各自的预测水平。如果一个以上的附加变量被请求时,这样的列表的列表或data.frames可以为每个变量供给与组件名称指定相应的变量的又一列表,作为一个组件。


参数:maxit, MaxNWts
control parameters to be passed to  multinom and nnet.  See the help  file for nnet.
控制参数被传递到multinom和nnet。请参阅帮助文件nnet。


参数:eps
a small positive numeric value, or NULL (the default).  In  the former case, estimated probabilities smaller than this are assumed to  result from structural zeros and are set to exactly 0.
一个小的正数值,或NULL(默认值)。在前者的情况下,估计的概率小于该假定导致从结构的零,并且被设置为恰好为0。


参数:seed
optional; an integer value to be used as the seed of the random  number generator, or an integer vector containing the state of the random  number generator to be restored.
可选的,一个整数的值被用作种子的随机数发生器,或一个整数矢量包含随机数发生器的状态,以被恢复。


Details

详细信息----------Details----------

The values of a new variable are simulated in three steps, where the second  step is optional.  First, the values of the household heads are simulated  with multinomial log-linear models.  Second, individuals directly related to  the corresponding household head (as specified by the argument direct)  inherit the value of the latter.  Third, the values of the remaining  individuals are simulated with multinomial log-linear models in which the  value of the respective household head is used as an additional predictor.
模拟值的一个新的变量中的三个步骤,其中在第二步骤是可选的。首先,户主的值与多项式对数线性模型模拟。第二,个人直接关系到相应的户主(参数所指定direct)继承后者的价值。第三,其余人士的值是与多项式,其中的对数线性模型被用作一个额外的预测的值的各自的户主模拟。


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

A data.frame containing the simulated population data including the  categorical variables specified by additional.
Adata.frame模拟的人口数据,包括分类变量指定的additional。


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

The basic household structure needs to be simulated beforehand with the  function simStructure.
家庭结构的基本需要事先要模拟的功能simStructure。


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


Andreas Alfons



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

simStructure, simCategorical,  simContinuous, simComponents
simStructure,simCategorical,simContinuous,simComponents


实例----------Examples----------


## Not run: [#不运行:]

## these take some time and are not run automatically[#这需要一定的时间,并没有自动运行]
## copy & paste to the R command line[#复制和粘贴到R命令行]

set.seed(1234)  # for reproducibility[可重复性]
data(ghanaS)   # load sample data[加载示例数据]
ghanaP <- simStructure(ghanaS, hid = "hhid", w = "weight",
    strata = "region", additional = c("age", "sex", "relate"))
ghanaP <- simRelation(ghanaS, ghanaP)
summary(ghanaP)

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-24 20:23 , Processed in 0.023123 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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