risk(sparr)
risk()所属R语言包:sparr
Bivariate relative risk function
二元相对危险性功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Estimates a relative risk function based on the ratio of two bivariate kernel density estimates over identical grids and regions. In geographical epidemiology, the two densities would represent a set of disease cases (numerator) and a sample of controls illustrating the at-risk population (denominator). In epidemiological terminology, the ratio of "case" to "control" would technically be referred to as an odds ratio.
预算的比例,根据两个二元核密度函数估计的相对危险度在相同的网格和区域。在GEO流行病学,两个密度将是一组疾病的情况下(分子)和样品说明的高危人群(分母)的控制。在流行病学的术语,“案例”,“控制权”的比例在技术上被称为的比值比。
用法----------Usage----------
risk(f, g, delta = 0, log = TRUE, h = NULL, adaptive = FALSE, res = 50,
WIN = NULL, tolerate = FALSE, plotit = TRUE, comment = TRUE)
参数----------Arguments----------
参数:f
Either a pre-calculated object of class "bivden" representing the "case" density estimate, or an object of type data.frame, list, matrix, or ppp giving the observed case data. If this raw data is provided, a kernel density estimate is computed internally, with certain options available to the user in bivariate.density chosen/calculated automatically. See "Details" for further information.
无论是预先计算的类的对象"bivden"表示“情况下的密度估计或对象类型data.frame的,list,matrix或ppp 给所观察到的情况下的数据。如果该原始数据,计算内核密度估计,某些选项提供给用户在bivariate.density选择/自动计算。的详细信息,请参阅“详细信息”。
参数:g
As for argument f, but for the controls. Whatever the type, the class of g must match that of f.
至于参数f,但为控制。不管是什么类型,类g必须符合的f。
参数:delta
A single numeric scaling parameter used for an optional additive constant to the densities; occasionally used for risk surface construction (see "Details"). A negative or zero value for delta requests no additive constant (default).
一个单一的数字缩放参数用于可选的附加常数的密度,有时也用于面层施工风险(见“详细信息”)。为delta请求不加常数(默认)为负或零值。
参数:log
Boolean. Whether or not to return the (natural) log-transformed relative risk function as recommended by Kelsall and Diggle (1995a). Defaults to TRUE with the alternative being the raw density ratio.
布尔值。无论是否返回(自然)的log转化的相对危险性功能推荐Kelsall Diggle(1995年a)。默认为TRUE替代的原材料密度比。
参数:h
Ignored if f and g are already "bivden" objects. An optional numeric vector of length 1 OR 2, giving the global bandwidth(s) for internal estimation of the case and control densities if adaptive = TRUE, or the fixed bandwidth(s) if adapative = FALSE. When h is a single numeric value, this is elected as the common global/fixed bandwidth for case and control densities. When h has length 2, the values h[1] and h[2] are assigned as the case and control global/fixed bandwidths respectively. By default, a value of h = NULL tells the function to use the global/fixed smoothing parameters as outlined in "Details" below. Note that for adaptive estimation, this argument does not affect calculation of the pilot bandwiths.
如果忽略f和g已"bivden"对象。一个可选的数字矢量的长度为1或2,全局带宽(S)内部估计的情况下,控制密度adaptive = TRUE,或固定的带宽(S)如果adapative = FALSE。当h是一个单一的数值,这是当选为共同的全球/固定带宽的情况下和控制密度。当h的长度为2,值h[1]和h[2]分配的情况下,控制全球/固定带宽。默认情况下,的值为h = NULL告诉使用全球/固定的平滑参数在下面的“详细信息”。请注意,自适应估计,这种说法并不影响计算的试点窗宽。
参数:adaptive
Ignored if f and g are already "bivden" objects. A boolean value specifying whether or not to employ adaptive smoothing for internally estimating the densities. A value of FALSE (default) elects use of fixed-bandwidth estimates.
如果忽略f和g已"bivden"对象。一个布尔值,指定是否采用自适应平滑,内部估计的密度。 FALSE(默认)选择使用固定带宽的估计值。
参数:res
Ignored if f and g are already "bivden" objects. A numeric value giving the desired resolution (of one side) of the evaluation grid. Higher values increase resolution at the expense of computational efficiency. Defaults to a 50 by 50 grid.
如果忽略f和g已"bivden"对象。一个数字值,该值提供所需的分辨率(一侧)的评价网格。值越高的分辨率为代价的计算效率。 50个网格,默认为50。
参数:WIN
Ignored if f and g are already "bivden" objects OR objects of class ppp (in which case the study region is set to the value of the resident window component). A polygonal object of class owin giving the relevant study region in which the f and g data was collected.
如果f和g已经"bivden"对象或对象类ppp(在这种情况下,研究区域的居民window的价值被忽略分量)。 owin提供有关研究区域的多边形类的对象中,f和g数据收集。
参数:tolerate
Ignored if f and g are already "bivden" objects. A boolean value specifying whether or not to calculate a corresponding asymptotic p-value surface (for tolerance contours) for the estimated relative risk function. If TRUE, the p-value surface tests for elevated risk only (equivalent to setting test = "greater" in tolerance) and is evaluated over a maximum grid resolution of 50 by 50. Defaults to FALSE for computational reasons.
如果忽略f和g已"bivden"对象。一个布尔值,指定是否要计算相应的渐近p值表面(宽容轮廓)的估计相对危险性功能。如果TRUE,风险升高(相当于设置的p-值表面测试test = "greater"tolerance)和最长不超过50×50的网格分辨率进行评估。默认为FALSE计算的原因。
参数:plotit
Boolean. If TRUE (default), a heatplot of the estimated relative risk function is produced. If tolerate = TRUE, asymptotic tolerance contours are automatically added to the plot at a significance level of 5%.
布尔值。如果TRUE(默认值),估计的相对风险heatplot的功能是。 tolerate = TRUE如果,渐近公差轮廓会自动添加到图显着性水平为5%。
参数:comment
Ignored if f and g are already "bivden" objects. Boolean. Whether or not to print function progress (including starting and ending date-times) during execution. Defaults to TRUE.
如果忽略f和g已"bivden"对象。布尔值。无论打印功能在执行过程中的进展(包括起始和结束日期时间)。默认为TRUE的。
Details
详细信息----------Details----------
This function estimates a relative risk function via the density ratio method using fixed or adaptive bandwidth bivariate kernel density estimates. Both densities must be estimated using the same evaluation grid (and the same study window) in bivariate.density. In geographical epidemiology, the argument f represents the spatial distribution of the disease cases, and g the at-risk (control) population.
此功能估计相对风险的功能,通过使用固定或自适应带宽的双变量核密度估计的密度比法。两个密度必须使用相同的计算网格(和相同的学习窗口)估计,在bivariate.density。在GEO流行病学,参数f的空间分布疾病的情况下,和g的风险(控制)的人口。
The option to supply the raw case and control data is available. If this is done, the function runs bivariate.density internally, abstracting certain decisions about the density estimation away from the user. If the user sets adaptive = TRUE (and h remains at NULL), the smoothing parameters are calculated as per the approach taken in Davies and Hazelton (2010): a common global bandwidth using the pooled data from OS. Pilot bandwidths are set at half the corresponding OS values. The scaling parameter gamma is common for the case and control density estimates, set as the gamma component of the pooled estimate. If a fixed relative risk is desired (adaptive = FALSE) and no specific bandwidths are given via the argument h, the case and control densities share a common bandwidth computed from the pooled data using OS. In supplying raw data to risk, the user must also specify an evaluation grid resolution (defaulting to 50 by 50) and the study region WIN (unless f and g are objects of class ppp, in which case the resident window component overrides WIN). All other arguments are set to their defaults as in bivariate.density.
提供原料的情况下,控制数据的选项是可用的。如果这样做了,该函数在运行bivariate.density内部,抽象的密度估计,从用户的某些决定。如果用户设置adaptive = TRUE(和h保持在NULL),平滑参数计算为在戴维斯和黑泽尔顿(2010年)所采取的办法:一个共同的全球带宽汇集数据OS。试点带宽的一半相应的OS值。缩放参数gamma设置为gamma组成部分的合并估计的情况下,控制密度估计,是很常见的。如果需要一个固定的相对风险(adaptive = FALSE),并没有具体的带宽通过参数h,病例组和对照从汇集的数据使用OS,计算密度都有一个共同的带宽。 risk提供原始数据,用户也必须指定一个评价网格分辨率(默认为50×50)和研究区域WIN(除非f和g类的对象ppp,在这种情况下,居民window的组件覆盖WIN)。所有其他参数设置为默认值,如在bivariate.density。
If more flexibility is required for estimation of the case and control densities, the user must supply "pre-calculated" objects of class "bivden" (from bivariate.density) as the f and g arguments. This drastically reduces the running time of a call to risk (as the density estimation step is already complete). However, the option of internally computing the asymptotic p-value surfaces (via the argument tolerate) is unavailable in this case; the user must run the tolerance function separately if tolerance contours are desired.
如果需要更多灵活性的情况下,控制密度估计,用户必须提供“预先计算的类的对象"bivden"(bivariate.density)f和g参数。这极大地降低了运行时的密度估计的步骤是调用risk(已完成)。然而,内部计算的渐近p值表面(通过参数选择tolerate)是无法在这种情况下,用户必须运行tolerance的功能分开,如果需要宽容的轮廓。
The relative risk function is defined here as the ratio of the "case" density to the "control" (Bithell, 1990; 1991). Using kernel density estimation to model these densities (Diggle, 1985), we obtain a workable estimate thereof. This function defines the risk function r in the following fashion: <br><br> r = (f + delta*max(g))/(g + delta*max(g)) <br><br> Note the (optional) additive constants defined by delta times the maximum of each of the densities in the numerator and denominator respectively (see Bowman and Azzalini, 1997).
这里被定义为控制(Bithell,1990年,1991年)“情况下的密度比的相对风险函数。使用内核密度估计,这些密度模型(Diggle,1985年),我们得到一个可行的估计。这个函数定义的风险函数R参考参考以下方式:ŕ添加剂 = (f + delta*max(g))/(g + delta*max(g))的<BR> <BR>注意(可选)定义的常量delta倍的最大的各的分子和分母中的密度(见Bowman和Azzalini,1997)。
The log-risk function rho, given by rho = log[r], is argued to be preferable in practice as it imparts a sense of symmetry in the way the case and control densities are treated (Kelsall and Diggle, 1995a;b). The option of log-transforming the returned risk function is therefore selected by default.
该log风险的功能RHO,由Rho =log[R],被认为是最好的做法,因为它给人一种对称感的情况下,控制密度的方式处理(Kelsall Diggle,1995年,B)。log选项将返回的风险,因此默认选中的。
值----------Value----------
An object of class "rrs". This is a marked list with the following components:
对象的类"rrs"。这是显着的列表与以下组件:
参数:rsM
a numeric res*res matrix (where res is the grid resolution as specified in the calls to bivariate.density for calculation of f and g) giving the values of the risk surface over the evaluation grid. Values corresponding to grid coordinates outside the study region are assigned NA
的数字res*res矩阵(其中res是网格分辨率为在调用bivariate.density计算f和g的)给出的值在评估表的风险表面。研究区域以外的网格坐标的对应值分配NA
参数:f
the object of class "bivden" used as the numerator or "case" density estimate
类的对象"bivden"作为分子或“案例”密度估计
参数:g
the object of class "bivden" used as the denominator or "control" density estimate
类的对象"bivden"作为分母或控制的密度估计
参数:log
whether or not the returned risk function is on the log-scale
或不返回的风险函数是否是log规模
参数:pooled
the object of class "bivden" (based on the pooled data) calculated internally if f and g were raw data arguments, NA otherwise
的对象类"bivden"(根据汇总的数据)内部计算,如果f和g是原始数据参数,NA否则
参数:P
a numeric 50 by 50 matrix of the asymptotic p-value surface if tolerate = TRUE and f and g were raw data arguments, NA otherwise
50×50的数字矩阵的渐近p值如果tolerate = TRUE和f和g是原始数据参数,表面NA否则
警告----------Warning----------
If raw data is supplied to risk, as opposed to previously computed objects of class "bivden", the running time of this function will be greater. This is particularly the case if the user has also selected tolerate = TRUE. In the same fashion as bivariate.density and tolerance, setting comment = TRUE can keep the user appraised of the function progress during run-time.
如果原始数据被提供给risk,先前计算的类的对象的相对"bivden",这个函数的运行时间将是更大的。这是一个特别的情况下,如果用户还选择tolerate = TRUE。以同样的方式为bivariate.density和tolerance,设置comment = TRUE可以让用户在运行时评估的功能进步。
(作者)----------Author(s)----------
T.M. Davies, M.L. Hazelton and J.C. Marshall
参考文献----------References----------
Bithell, J.F. (1991), Estimation of relative risk functions, Statistics in Medicine, 10, 1745-1751.<br><br> Bowman, A.W. and Azzalini A. (1997), Applied Smoothing Techniques for Data Analysis: The Kernel Approach with S-Plus Illustrations, Oxford University Press Inc., New York.<br><br> Davies, T.M. and Hazelton, M.L. (2010), Adaptive kernel estimation of spatial relative risk, Statistics in Medicine, 29(23) 2423-2437.<br><br> Diggle, P.J. (1985), A kernel method for smoothing point process data, Journal of the Royal Statistical Society Series C, 34(2), 138-147.<br><br> Kelsall, J.E. and Diggle, P.J. (1995a), Kernel estimation of relative risk, Bernoulli, 1, 3-16.<br><br> Kelsall, J.E. and Diggle, P.J. (1995b), Non-parametric estimation of spatial variation in relative risk, Statistics in Medicine, 14, 2335-2342.
实例----------Examples----------
## Not run: [#不运行:]
data(PBC)
PBC.casedata <- split(PBC)[[1]]
PBC.controldata <- split(PBC)[[2]]
pbc.h <- OS(PBC, nstar = sqrt(PBC.casedata$n * PBC.controldata$n))
pbc.pool <- bivariate.density(data = PBC, pilotH = pbc.h,
adaptive = FALSE)
pbc.case <- bivariate.density(data = PBC.casedata,
pilotH = pbc.h, adaptive = FALSE)
pbc.con <- bivariate.density(data = PBC.controldata,
pilotH = pbc.h, adaptive = FALSE)
pbc.rrs <- risk(f = pbc.case, g = pbc.con, plotit = FALSE)
summary(pbc.rrs)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|