SpawML(spacom)
SpawML()所属R语言包:spacom
Standard multilevel analysis applied to spatially weighted context data
标准多层次的分析应用空间加权上下文数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Integrates spatially weighted context data as higher-level predictors in multilevel analysis and produces conventional statistical estimates.
空间加权上下文数据集成更高级别的多层次的分析预测和生产传统的统计估计。
用法----------Usage----------
SpawML(individual.level.data,
contextual.names,
context.id,
formula,
contextual.data = NULL,
precise.data = NULL,
contextual.weight.matrices = NULL,
individual.weight.names = NULL,
aggregation.functions = "mean")
参数----------Arguments----------
参数:individual.level.data
A data.frame containing the individual level data. The data must be numeric (logical, integer, or plain numeric). There may not be any missing values, NaNs, NULLs or NAs.
Adata.frame个人层面上的数据。数据必须是数字(logical,integer,或纯numeric)。可能没有任何遗漏值,NaN,NULLs或NA的。
参数:contextual.names
A list of names of contextual variables to be weighted.
Alist进行加权的上下文变量的名称。
参数:context.id
The name of the context ID variable.
作为上下文ID的变量的名称。
参数:formula
Formula description of the model.
公式描述的模式。
参数:contextual.data
A data.frame containing the micro-level data to generate contextual indicators by aggregation. May be NULL, in which case the individual data is used. The data must be numeric (logical, integer, or plain numeric). There may not be any missing values, NaNs, NULLs or NAs. By default set to NULL.
Adata.frame包含微观层面的数据产生关联的聚集指标。可能是NULL,在这种情况下,使用单个数据。数据必须是数字(logical,integer,或纯numeric)。可能没有任何遗漏值,NaN,NULLs或NA的。默认设置为NULL。
参数:precise.data
A data.frame containing the precise contextual data. May be NULL, but may not contain any missing values, like NaNs, NULLs or NAs. By default set to NULL, except for ResampleExactSpawML which requires precise data to be specified.
Adata.frame包含精确的上下文数据。可能是NULL,但可能不包含任何遗漏值,如NaN,NULL或NA的。默认设置为NULL,除了ResampleExactSpawML这需要精确的数据来指定。
参数:contextual.weight.matrices
A list of weights to be applied to each variable specified in contextual.names. A weight may be a weights matrix as, for instance computed by WeightMatrix, or NULL, in which case the corresponding contextual variable is not weighted. If only one weight is defined (instead of a list) it is applied to all contextual variables. Defaults to NULL, which means that none of contextual indicators are weighted.
Alist权重的被应用到每个指定的变量中contextual.names。作为,例如计算WeightMatrix,或NULL,在这种情况下,相应的上下文变量的权重,权重可能是一个权重矩阵。如果只有一个重量被定义(而不是一个列表),它被应用到所有的上下文变量。默认值,以NULL,这意味着没有上下文指标的权重。
参数:individual.weight.names
A list of optional design weights at the individual level used for aggregation (for example, for a weighted mean). List must have same length as contextual.names. May contain NULLs for variables which should not be weighted at the individual level. If only one individual weight is defined (instead of a list) it is applied to all contextual variables. By default set to NULL.
Alist聚集(例如,对于一个加权平均)用于在个人层面上的可选设计重量。列表必须有相同长度的contextual.names。可能含有NULL的,不应该偏重于个人层面上的变量。如果只有一个单独的重量定义的(而不是一个列表),它被应用到所有的上下文变量。默认设置为NULL。
参数:aggregation.functions
A list of aggregation functions. Functions take either <ol> 1 argument in which case the corresponding individual design weight is NULL,
Alist的聚合函数。的函数采取任何<OL>的1参数,在这种情况下,相应的个性化的设计重量是NULL,
2 arguments in which case the second argument is taken from the corresponding individual design weight. Defaults to "mean". </ol>
在这种情况下,第二个参数是从相应的个性化设计重量两个参数。默认为"mean"的。 </ OL>
(作者)----------Author(s)----------
Till Junge, Sandra Penic, Guy Elcheroth
实例----------Examples----------
# Spatially weighted multilevel analysis, with standard estimates of[空间加权的多层次的分析,与标准估计。]
# standard errors. Model with two contextual predictors, treated as[标准误差。模型的两个上下文的预测,被视为]
# precise, predicting collective guilt acceptance. [精确,预测的集体罪责接受。]
# load individual level data, remove collective guilt assignment for the[加载个体层面的数据,除去集体罪责分配]
# data frame, and remove NA's [数据框,并删除NA]
data(traces_ind)
traces_ind <- traces_ind[,-7]
traces_ind <- na.exclude(traces_ind)
# load contextual indicator for aggregation[加载上下文聚集指标]
data(traces_event)
# load precise contextual indicator[加载精确的背景指标]
data(homog_census)
# load distance matrix and create weights[加载距离矩阵和权重]
data(d_geo)
geow_100 <- WeightMatrix(d_geo, bandwidth=100)
# perform SpawML[执行SpawML]
acc_w_homog_100 <- SpawML(individual.level.data=traces_ind,
contextual.names=c("w_all", "Homog_00"), context.id="area",
formula=cg_acc ~ victim_d + comb_d + male + age_1990 + high_school +
higher_edu + (1|area), contextual.data=traces_event,
precise.data=homog_census, contextual.weight.matrices=geow_100,
individual.weight.names="weight", aggregation.functions="weighted.mean")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|