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

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

[复制链接]
发表于 2012-9-27 19:15:53 | 显示全部楼层 |阅读模式
sensuc(rms)
sensuc()所属R语言包:rms

                                        Sensitivity to Unmeasured Covariables
                                         对不可测协变量的敏感性

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

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

Performs an analysis of the sensitivity of a binary treatment (X) effect to an unmeasured binary confounder (U) for a fitted binary logistic or an unstratified non-time-dependent Cox survival model (the function works well for the former, not so well for the latter).  This is done by fitting a sequence of models with separately created U variables added to the original model.  The sequence of models is formed by simultaneously varying a and b, where a measures the association between U and X and b measures the association between U and Y, where Y is the outcome of interest.  For Cox models, an approximate solution is used by letting Y represent some binary classification of the event/censoring time and the event indicator.  For example, Y could be just be the event indicator, ignoring time of the event or censoring, or it could be 1 if a subject failed before one year and 0 otherwise.  When for each combination of a and b the vector of binary values U is generated, one of two methods is used to constrain the properties of U.  With either method, the overall prevalence of U is constrained to be prev.u.  With the default method (or.method="x:u y:u"), U is sampled so that the X:U odds ratio is a and the Y:U odds ratio is b.  With the second method, U is sampled according to the model logit(U=1 | X, Y) = α + β*Y + γ*X, where β=\log(b) and γ=\log(a) and α is determined so that the prevalence of U=1 is prev.u.  This second method results in the adjusted odds ratio for Y:U given X being b whereas the default method forces the unconditional (marginal) Y:U odds ratio to be b.  Rosenbaum uses the default method.
执行分析的敏感性的一个二进制治疗(X)效果不可测量的二进制混杂因素(U)的拟合二分类Logistic或不分层非时间依赖Cox生存模型(函数的工作原理以及对于前者,而不是后者的)。这是通过与单独创建U变量添加到原始模型序列的模型拟合。模型的顺序形成的同时改变a和b,其中a措施之间的关联U和X和b措施,之间的关联U和Y,其中Y是利益的结果。 Cox模型,让Y代表的二元分类的事件/审查时间和事件指示器的近似解。例如,Y可能是只是事件的指标,忽略了时间的事件或审查,或者它可能是1如果主体没有前一年,0否则。当的每个组合的a和b的二进制值的矢量U被生成时,两种方法之一的是,用于约束U的属性。无论使用哪种方法,整体U患病率被限定为prev.u。使用默认的方法(or.method="x:u y:u")U采样使X:U比值比是a和Y:U比值比是b 。使用第二种方法,U进行采样,根据该模型logit(U=1 | X, Y) = &alpha; + &beta;*Y + &gamma;*X,其中&beta;=\log(b)和&gamma;=\log(a)和&alpha;确定的患病率<X >是U=1。这第二种方法的结果,在调整后的比值比为prev.u给Y:U是X而默认的方法强制无条件的(边际)b比值比是Y:U的。罗森鲍姆使用默认的方法。

There is a plot method for plotting objects created by sensuc.  Values of a are placed on the x-axis and observed marginal odds or hazards ratios for U (unadjusted ratios) appear on the y-axis.  For Cox models, the hazard ratios will not agree exactly with X:event indicator odds ratios but they sometimes be made close through judicious choice of the event function.  The default plot uses four symbols which differentiate whether for the a,b combination the effect of X adjusted for U (and for any other covariables that were in the original model fit) is positive (usually meaning an effect ratio greater than 1) and "significant", merely positive, not positive and non significant, or not positive but significant.  There is also an option to draw the numeric value of the X effect ratio at the a,b combination along with its Z statistic underneath in smaller letters, and an option to draw the effect ratio in one of four colors depending on the significance of the Z statistic.
有一个plot绘制对象的方法创建的sensuc。 a的值中的被放置在x-轴和观察边际赔率或危害比率为U(未经调整比率)上显示的y-轴。 Cox模型的风险比不同意完全X:事件指标的比值比,但他们有时会关闭通过event功能的明智选择。默认的图形使用4个符号的效果分化是否为a,b组合,X调整U(以及任何其他协变量,在原有模型的拟合)是正的(通常是这意味着效果比大于1)和“显著”,仅仅是积极的,不积极和不显著,或不积极的,但显著。也有一个选项,得出的数值X效果比a,b随着它的Z统计,在下面的小的字母,和选项的组合画的效果比在四种颜色的Z统计的意义。


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


# fit &lt;- lrm(formula=y ~ x + other.predictors, x=TRUE, y=TRUE)  #or
# fit &lt;- cph(formula=Surv(event.time,event.indicator) ~ x + other.predictors,
#            x=TRUE, y=TRUE)

sensuc(fit,  
       or.xu=seq(1, 6, by = 0.5), or.u=or.xu,
       prev.u=0.5, constrain.binary.sample=TRUE,
       or.method=c("x:u y:u","u|x,y"),
       event=function(y) if(is.matrix(y))y[,ncol(y)] else 1*y)

## S3 method for class 'sensuc'
plot(x,  ylim=c((1+trunc(min(x$effect.u)-.01))/
                   ifelse(type=='numbers',2,1),
                   1+trunc(max(x$effect.u)-.01)),
     xlab='Odds Ratio for X:U',
     ylab=if(x$type=='lrm')'Odds Ratio for Y:U' else
          'Hazard Ratio for Y:U',
     digits=2, cex.effect=.75, cex.z=.6*cex.effect,
     delta=diff(par('usr')[3:4])/40,
     type=c('symbols','numbers','colors'),
     pch=c(15,18,5,0), col=c(2,3,1,4), alpha=.05,
     impressive.effect=function(x)x &gt; 1,...)



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

参数:fit
result of lrm or cph with x=TRUE, y=TRUE.  The first variable in the right hand side of the model formula must have been the binary X variable, and it may not interact with other predictors.  
结果lrm或cphx=TRUE, y=TRUE。模型公式中的右手侧的第一可变必须已经二进制X变量,它可能不会与其他预测因子互动。


参数:x
result of sensuc  
结果sensuc


参数:or.xu
vector of possible odds ratios measuring the X:U association.  
矢量测量X:U协会可能的比值比。


参数:or.u
vector of possible odds ratios measuring the Y:U association. Default is or.xu.  
矢量测量Y:U协会可能的比值比。默认是or.xu。


参数:prev.u
desired prevalence of U=1.  Default is 0.5, which is usually a "worst case" for sensitivity analyses.  
写入流行的U=1。默认值是0.5,这通常是一个“最坏情况”的敏感性分析。


参数:constrain.binary.sample
By default, the binary U values are sampled from the appropriate distributions conditional on Y and X so that the proportions of U=1 in each sample are exactly the desired probabilities, to within the closeness of n\timesprobability to an integer.  Specify constrain.binary.sample=FALSE to sample from ordinary Bernoulli distributions, to allow proportions of U=1 to reflect sampling fluctuations.  
默认情况下,二进制U值进行采样,从适当的分布条件Y和X“这样的比例U=1每个样本中到底想要的概率,在亲密的n\times概率为整数。指定constrain.binary.sample=FALSE品尝从普通的伯努里分布,允许U=1,以反映采样波动的比例。


参数:or.method
see above  
看到以上


参数:event
a function classifying the response variable into a binary event for the purposes of constraining the association between U and Y. For binary logistic models, event is left at its default value, which is the identify function, i.e, the original Y values are taken as the events (no other choice makes any sense here).  For Cox models, the  default event function takes the last column of the Surv object stored with the fit.  For rare events (high proportion of censored observations), odds ratios approximate hazard ratios, so the default is OK.   For other cases, the survival times should be considered (probably in conjunction with the event indicators), although it may not be possible to get a high enough hazard ratio between U and Y by sampling U by temporarily making Y binary.  See the last example which is for a 2-column Surv object (first column of response variable=event time,  second=event indicator).  When dichotomizing survival time at a given point, it is advantageous to choose the cutpoint so that not many censored survival times preceed the cutpoint. Note that in fitting Cox models to examine sensitivity to U, the original non-dichotomized failure times are used.  
一个功能分类成一个二进制事件的响应变量之间的关联U和Y约束的目的。二分类Logistic模型,event留在它的默认值,这是识别功能,即原Y值的事件(没有其他选择,在这里任何意义)。 Cox模型,默认的event函数的最后一列Surv对象存储与契合。对于罕见的事件(高比例的审查意见),比值比接近危险比,所以默认情况下是OK的。对于其他情况,生存时间应考虑(可能在事件指标的结合),虽然它可能无法获得足够高的危险比之间U和Y采样<X >由暂时U二进制的。请参阅列Y对象(第一列的响应变量=事件的时间,第二个事件指示器)的最后一个例子是。二分法的生存时间时,在一个给定的点,是有利的选择分割点,所以,没有多少审查的的生存时间preceed的分割点。请注意,在嵌合Cox模型检查灵敏度Surv,使用原始的非二分法失败次数。


参数:ylim
y-axis limits for plot  
ploty轴的限制


参数:xlab
x-axis label  
X轴标签


参数:ylab
y-axis label  
Y轴标签


参数:digits
number of digits to the right of the decimal point for drawing numbers on the plot, for type="numbers" or type="colors".  
在图上画数字的小数点右边的数字,type="numbers"或type="colors"。


参数:cex.effect
character size for drawing effect ratios  
字符大小拉丝效果比


参数:cex.z
character size for drawing Z statistics  
字符大小绘制Z统计


参数:delta
decrement in y value used to draw Z values below effect ratios  
用于绘制y值低于效果比在Z这个值递减


参数:type
specify "symbols" (the default), "numbers", or "colors" (see above)  
指定"symbols"(默认值),"numbers"或"colors"(见上文)


参数:pch
4 plotting characters corresponding to positive and significant effects for X, positive and non-significant effects, not positive and not significant, not positive but significant  
4绘制相应的积极和重要的作用X,积极的和非显着性的影响,不积极和不显着的,不积极的,但显著的字符


参数:col
4 colors as for pch  
4种颜色pch


参数:alpha
significance level  
显着性水平


参数:impressive.effect
a function of the odds or hazard ratio for X returning TRUE for a positive effect.  By default, a positive effect is taken to mean a ratio exceeding one.  
一个函数的可能性或危险比为X返回TRUE积极的作用。默认情况下,采取了积极的作用,以平均的比例超过1。


参数:...
optional arguments passed to plot  </table>
可选参数传递给plot</ TABLE>


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

sensuc returns an object of class "sensuc" with the following elements: OR.xu (vector of desired X:U odds ratios or a values), OOR.xu (observed marginal X:U odds ratios), OR.u (desired Y:U odds ratios or b values), effect.x (adjusted odds or hazards ratio for X in a model adjusted for U and all of the other predictors), effect.u (unadjusted Y:U odds or hazards ratios), effect.u.adj (adjusted Y:U odds or hazards ratios), Z (Z-statistics), prev.u (input to sensuc), cond.prev.u (matrix with one row per a,b combination, specifying prevalences of U conditional on Y and X combinations), and type ("lrm" or "cph").
sensuc返回一个对象类"sensuc"包含下列元素:OR.xu(矢量所需X:U比值比或a值),OOR.xu边际X:U比值比(观察),OR.u(期望Y:U比值比或b值),effect.x(调整后的赔率或危害比<X >X和所有其他预测),U(未经调整effect.u赔率或危害比),Y:U(调整后的effect.u.adj调整模型中的的可能性或危险的比率),Y:U(Z-统计),Z(输入到prev.u)sensuc(矩阵的一列,每cond.prev.u, a组合,指定的患病率b有条件U和Y组合),并X(type或"lrm")。


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



Frank Harrell<br>
Mark Conaway<br>
Department of Biostatistics<br>
Vanderbilt University School of Medicine<br>
f.harrell@vanderbilt.edu, mconaway@virginia.edu




参考文献----------References----------


covariate in an observational study with binary outcome.  J Roy Statist Soc B 45:212&ndash;218.
and effect-modifying potentials.  Stat in Med 30:1007-1017.

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

lrm, cph, sample
lrm,cph,sample


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


set.seed(17)
x <- sample(0:1, 500,TRUE)
y <- sample(0:1, 500,TRUE)
y[1:100] &lt;- x[1:100]  # induce an association between x and y[诱导x和y之间的关联]
x2 <- rnorm(500)


f <- lrm(y ~ x + x2, x=TRUE, y=TRUE)


#Note: in absence of U odds ratio for x is exp(2nd coefficient)[注:没有的U比值比为x是exp(第二个系数)]


g <- sensuc(f, c(1,3))


# Note: If the generated sample of U was typical, the odds ratio for[注意:如果生成的样品是典型的U,比值比为]
# x dropped had U been known, where U had an odds ratio[x下降ü被称为,其中U的胜算比]
# with x of 3 and an odds ratio with y of 3[3与x与y的比值比3]


plot(g)


# Fit a Cox model and check sensitivity to an unmeasured confounder[适合Cox模型,并检查一个不可测量的混杂因素的敏感性]


# f &lt;- cph(Surv(d.time,death) ~ treatment + pol(age,2)*sex, x=TRUE, y=TRUE)[F < -  CPH(SURV(d.time,死亡)~治疗+ POL(年龄,2)*性,X = TRUE,Y = TRUE)]
# sensuc(f, event=function(y) y[,2] &amp; y[,1] &lt; 365.25 )[sensuc(F,事件=函数(y)Y [,2],Y [,1] <365.25)]
# Event = failed, with event time before 1 year[事件=失败,与事件之前的1年时间]
# Note: Analysis uses f$y which is a 2-column Surv object[注:分析使用f $ Y这是一个两列的幸存者对象]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 11:34 , Processed in 0.021088 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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