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

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

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

                                        Parametric Survival Model
                                         参数生存模型

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

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

psm is a modification of Therneau's survreg function for fitting the accelerated failure time family of parametric survival models.  psm uses the rms class for automatic anova, fastbw, calibrate, validate, and other functions.  Hazard.psm, Survival.psm, Quantile.psm, and Mean.psm create S functions that evaluate the hazard, survival, quantile, and mean (expected value) functions analytically, as functions of time or probabilities and the linear predictor values.
psm是修改Therneau的survreg函数的参数生存模型拟合加速失效时间家庭。 psm使用rms自动anova,fastbw,calibrate,validate,和其他功能的类。 Hazard.psm,Survival.psm,Quantile.psm和Mean.psm“创建小号功能,评估危险,生存,分位数,平均(预期值)的功能解析,作为时间的函数或概率和的线性预测值。

The residuals.psm function exists mainly to compute normalized (standardized) residuals and to censor them (i.e., return them as Surv objects) just as the original failure time variable was censored.  These residuals are useful for checking the underlying distributional assumption (see the examples).  To get these residuals, the fit must have specified y=TRUE.  A lines method for these residuals automatically draws a curve with the assumed standardized survival distribution.  A survplot method runs the standardized censored residuals through survfit to get Kaplan-Meier estimates, with optional stratification (automatically grouping a continuous variable into quantiles) and then through survplot.survfit to plot them.  Then lines is invoked to show the theoretical curve.  Other types of residuals are computed by residuals using residuals.survreg.
residuals.psm函数的存在主要是为了计算归一化(标准化)残差和审查(例如,他们Surv对象返回),正如的原始故障时间变量被检察。检查的基本分布假设(见的例子),这些残留物是有用的。要获得这些残差,拟合必须指定了y=TRUE。 Alines方法,这些残留物会自动绘制曲线的假定标准化的生存分布。 Asurvplot方法运行的标准化审查的残差,通过survfitKaplan-Meier估计,与可选分层(自动分组的连续可变进位数),然后通过survplot.survfit绘制出来。然后lines被调用,以表明理论曲线。其他类型的残差计算residuals使用residuals.survreg。


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


psm(formula=formula(data),
    data=parent.frame(), weights,
    subset, na.action=na.delete, dist="weibull",
    init=NULL, scale=0,
    control=survreg.control(),
    parms=NULL,
    model=FALSE, x=FALSE, y=TRUE, time.inc, ...)

## S3 method for class 'psm'
print(x, correlation=FALSE, digits=4, coefs=TRUE,
latex=FALSE, title, ...)

Hazard(object, ...)
## S3 method for class 'psm'
Hazard(object, ...)   # for psm fit
# E.g. lambda <- Hazard(fit)

Survival(object, ...)
## S3 method for class 'psm'
Survival(object, ...) # for psm
# E.g. survival <- Survival(fit)

## S3 method for class 'psm'
Quantile(object, ...) # for psm
# E.g. quantsurv <- Quantile(fit)

## S3 method for class 'psm'
Mean(object, ...)     # for psm
# E.g. meant   <- Mean(fit)

# lambda(times, lp)   # get hazard function at t=times, xbeta=lp
# survival(times, lp) # survival function at t=times, lp
# quantsurv(q, lp)    # quantiles of survival time
# meant(lp)           # mean survival time

## S3 method for class 'psm'
residuals(object, type=c("censored.normalized",
"response", "deviance", "dfbeta",
"dfbetas", "working", "ldcase", "ldresp", "ldshape", "matrix"), ...)

## S3 method for class 'residuals.psm.censored.normalized'
survplot(fit, x, g=4, col, main, ...)

## S3 method for class 'residuals.psm.censored.normalized'
lines(x, n=100, lty=1, xlim,
lwd=3, ...)
# for type="censored.normalized"



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

参数:formula
an S statistical model formula. Interactions up to third order are supported. The left hand side must be a Surv object.  
的统计模型公式。支持相互作用三阶。左手侧必须Surv对象。


参数:object
a fit created by psm.  For survplot with residuals from psm, object is the result of residuals.psm.  
创建一个合适的psm。对于survplot残差psm,object的结果residuals.psm。


参数:fit
a fit created by psm
一个合适的创建的psm


参数:data,subset,weights,dist,scale,init,na.action,control
see survreg.
看到survreg。


参数:parms
a list of fixed parameters.  For the t-distribution this is the degrees of freedom; most of the distributions have no parameters.
固定参数列表。对于t分配的自由度,大部分分布没有任何参数。


参数:model
set to TRUE to include the model frame in the returned object  
设置为TRUE包括在返回的对象模型框架


参数:x
set to TRUE to include the design matrix in the object produced by psm.  For the survplot method, x is an optional stratification variable (character, numeric, or categorical).  For lines.residuals.psm.censored.normalized, x is the result of residuals.psm.  For print it is the result of psm.  
包括设计矩阵中的对象产生的TRUE设置为psm。 survplot方法,x是一个可选的分层变量(字符,数字或分类)。对于lines.residuals.psm.censored.normalized,x的结果residuals.psm。对于print的结果psm。


参数:y
set to TRUE to include the Surv() matrix  
设置为TRUE包括Surv()矩阵


参数:time.inc
setting for default time spacing. Used in constructing time axis in survplot, and also in make confidence bars. Default is 30 if time variable has units="Day", 1 otherwise, unless maximum follow-up time < 1. Then max time/10 is used as time.inc. If time.inc is not given and max time/default time.inc is > 25, time.inc is increased.  
设置为默认的时间间隔。用于建设在时间轴survplot,也使信心条形。默认值是30如果时间变量units="Day",否则为1,除非最长随访时间< 1,。然后最大time/10是作为time.inc。 time.inc如果不和最大时间/默认time.inc是> 25,time.inc增加。


参数:correlation
set to TRUE to print the correlation matrix for parameter estimates
设置为TRUE打印参数估计值的相关性矩阵


参数:digits
number of places to print to the right of the decimal point
一些地方打印到小数点右侧的


参数:coefs
specify coefs=FALSE to suppress printing the table of model coefficients, standard errors, etc.  Specify coefs=n to print only the first n regression coefficients in the model.
指定coefs=FALSE抑制打印表格模型系数,标准误差等指定coefs=n要打印只有第一个n回归系数的模型。


参数:latex
a logical value indicating whether information should be formatted as plain text or as LaTeX markup
一逻辑值,表示信息是否应该被格式化为纯文本或乳胶标记


参数:title
a character string title to be passed to prModFit
一个字符串标题要传递给prModFit


参数:...
other arguments to fitting routines, or to pass to survplot from <br> survplot.residuals.psm.censored.normalized.  Passed to the generic lines function for lines.
其他参数拟合程序,或通过从<BR> survplot到survplot.residuals.psm.censored.normalized。传递的通用lines的功能,lines。


参数:times
a scalar or vector of times for which to evaluate survival probability or hazard  
一个标量或矢量次评估生存概率或危害


参数:lp
a scalar or vector of linear predictor values at which to evaluate survival probability or hazard.  If both times and lp are vectors, they must be of the same length.  
一个标量或向量的线性预测值,以评估生存概率或危害。如果两个times和lp是矢量,它们必须具有相同的长度。


参数:q
a scalar or vector of probabilities.  The default is .5, so just the median survival time is returned.  If q and lp are both vectors, a matrix of quantiles is returned, with rows corresponding to lp and columns to q.  
一个标量或矢量的概率。默认值是0.5,所以返回的中位生存时间。如果q和lp是两个向量,矩阵的分位数,则返回,行相应lp和列q。


参数:type
type of residual desired.  Default is censored normalized residuals, defined as (link(Y) - linear.predictors)/scale parameter, where the link function was usually the log function.  See survreg for other types.  
类型的残余所需的。默认被审查,定义归一化残差(链接(Y) -  linear.predictors)/缩放参数,其中的纽带作用通常是log功能。见survreg其他类型。


参数:n
number of points to evaluate theoretical standardized survival function for  <br> lines.residuals.psm.censored.normalized  
点,以评估理论标准化的生存函数<BR>lines.residuals.psm.censored.normalized


参数:lty
line type for lines, default is 1  
线路类型lines,默认为1


参数:xlim
range of times (or transformed times) for which to evaluate the standardized survival function.  Default is range in normalized residuals.  
的时间范围(或变换时间)来评价的标准化的生存函数。默认值是归一化残差的范围内。


参数:lwd
line width for theoretical distribution, default is 3  
理论分布线的宽度,默认值是3


参数:g
number of quantile groups to use for stratifying continuous variables having more than 5 levels  
数的位数组使用分层的连续变量,具有5级以上


参数:col
vector of colors for survplot method, corresponding to levels of x (must be a scalar if there is no x)  
矢量的颜色为survplot方法,对应的水平x(必须是一个标量,如果不存在x)


参数:main
main plot title for survplot.  If omitted, is the name or label of x if x is given.  Use main="" to suppress a title when you specify x.  </table>
主要图标题survplot。如果省略该参数,名称或标签x如果x。使用main=""抑制一个标题,当你指定x。 </ TABLE>


Details

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

The object survreg.distributions contains definitions of properties of the various survival distributions.  <br> psm does not trap singularity errors due to the way survreg.fit does matrix inversion.  It will trap non-convergence (thus returning fit$fail=TRUE) if you give the argument failure=2 inside the control list which is passed to survreg.fit.  For example, use f <- psm(S ~ x, control=list(failure=2, maxiter=20)) to allow up to 20 iterations and to set f$fail=TRUE in case of non-convergence. This is especially useful in simulation work.
的对象survreg.distributions包含的属性的各种生存分布的定义。参考psm不捕获的方式survreg.fit矩阵求逆的奇异性的错误。这将捕获不收敛(从而返回fit$fail=TRUE),如果你给的参数failure=2内的control名单传递给survreg.fit的。例如,使用f <- psm(S ~ x, control=list(failure=2, maxiter=20))允许多达20次迭代,并设置f$fail=TRUE不衔接的情况下。仿真工作中,这是特别有用的。


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

psm returns a fit object with all the information survreg would store as  well as what rms stores and units and time.inc. Hazard, Survival, and Quantile return S-functions. residuals.psm with type="censored.normalized" returns a Surv object which has a special attribute "theoretical" which is used by the lines routine.  This is the assumed standardized survival function as a function of time or transformed time.
psm返回一个合适的对象,所有的信息survreg将存储以及什么rms商店和units和time.inc。 Hazard,Survival和Quantile返回S-函数。 residuals.psmtype="censored.normalized"返回一个Surv对象,它有一个特殊的属性"theoretical"lines日常使用。这是假定的标准化存活函数的时间作为一个功能或转换时间。


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



Frank Harrell<br>
Department of Biostatistics<br>
Vanderbilt University
<br>
<a href="mailto:f.harrell@vanderbilt.edu">f.harrell@vanderbilt.edu</a>




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

rms, survreg, residuals.survreg, survreg.object,   survreg.distributions, pphsm, survplot, survest, Surv,  na.delete, na.detail.response, datadist, latex.psm, GiniMd, prModFit
rms,survreg,residuals.survreg,survreg.object,survreg.distributions,pphsm,survplot,survest,<所述>,Surv,na.delete,na.detail.response,datadist,latex.psm,GiniMd


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


n <- 400
set.seed(1)
age <- rnorm(n, 50, 12)
sex <- factor(sample(c('Female','Male'),n,TRUE))
dd <- datadist(age,sex)
options(datadist='dd')
# Population hazard function:[人口风险函数:]
h <- .02*exp(.06*(age-50)+.8*(sex=='Female'))
d.time <- -log(runif(n))/h
cens <- 15*runif(n)
death <- ifelse(d.time <= cens,1,0)
d.time <- pmin(d.time, cens)


f <- psm(Surv(d.time,death) ~ sex*pol(age,2),
         dist='lognormal')
# Log-normal model is a bad fit for proportional hazards data[对数正态模型是一个糟糕的适合比例风险数据]


anova(f)
fastbw(f)  # if deletes sex while keeping age*sex ignore the result[如果删除性,同时保持的年龄*性忽略的结果]
f &lt;- update(f, x=TRUE,y=TRUE)       # so can validate, compute certain resids[可以验证,计算某些渣油]
validate(f, dxy=TRUE, B=10)      # ordinarily use B=150 or more[通常使用B = 150或以上]
plot(Predict(f, age, sex))   # needs datadist since no explicit age, hosp.[由于没有明确的年龄,HOSP需要datadist。]
survplot(f, age=c(20,60))     # needs datadist since hospital not set here[需要datadist,因为医院没有在这里设置]
# latex(f)[胶乳(六)]


S <- Survival(f)
plot(f$linear.predictors, S(6, f$linear.predictors),
     xlab=expression(X*hat(beta)),
     ylab=expression(S(6,X*hat(beta))))
# plots 6-month survival as a function of linear predictor (X*Beta hat)[图6个月的生存函数的线性预测(X * Beta版的帽子)]


times <- seq(0,24,by=.25)
plot(times, S(times,0), type='l')   # plots survival curve at X*Beta hat=0[图生存曲线在X * Beta版帽子= 0]
lam <- Hazard(f)
plot(times, lam(times,0), type='l') # similarly for hazard function[同样,对于风险函数]


med &lt;- Quantile(f)        # new function defaults to computing median only[新功能默认只计算中位数]
lp <- seq(-3, 5, by=.1)
plot(lp, med(lp=lp), ylab="Median Survival Time")
med(c(.25,.5), f$linear.predictors)
                          # prints matrix with 2 columns[打印2列矩阵]


# fit a model with no predictors[拟合模型没有预测]
f <- psm(Surv(d.time,death) ~ 1, dist="weibull")
f
pphsm(f)          # print proportional hazards form[打印比例风险形式]
g <- survest(f)
plot(g$time, g$surv, xlab='Time', type='l',
     ylab=expression(S(t)))


f <- psm(Surv(d.time,death) ~ age,
         dist="loglogistic", y=TRUE)
r &lt;- resid(f, 'cens') # note abbreviation[注意缩写]
survplot(survfit(r ~ 1), conf='none')
                      # plot Kaplan-Meier estimate of [图Kaplan-Meier估计的]
                      # survival function of standardized residuals[生存函数的标准化残差]
survplot(survfit(r ~ cut2(age, g=2)), conf='none')  
                      # both strata should be n(0,1)[两个阶层应该是n(0,1)]
lines(r)              # add theoretical survival function[添加理论的生存功能]
#More simply:[更简单地说:]
survplot(r, age, g=2)

options(datadist=NULL)

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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