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

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

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

                                        Summary of Effects in Model
                                         在模型概要

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

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

summary.rms forms a summary of the effects of each factor.  When summary is used to estimate odds or hazard ratios for continuous variables, it allows the levels of interacting factors to be easily set, as well as allowing the user to choose the interval for the effect. This method of estimating effects allows for nonlinearity in the predictor.  Factors requiring multiple parameters are handled, as summary obtains predicted values at the needed points and takes differences.  By default, inter-quartile range effects (odds ratios, hazards ratios, etc.) are printed for continuous factors, and all comparisons with the reference level are made for categorical factors. print.summary.rms prints the results, latex.summary.rms typesets the results, and plot.summary.rms plots shaded confidence bars to display the results graphically. The longest confidence bar on each page is labeled with confidence levels (unless this bar has been ignored due to clip).  By default, the following confidence levels are all shown: .7, .8, .9, .95, and .99, using  levels of gray scale (colors for Windows).
summary.rms形成各因素的影响的摘要。当summary是用来估计的连续变量的赔率或危险比,它允许水平相互作用的因素很容易地设置,以及允许用户选择的时间间隔的效果。这种方法允许在预测的非线性估计效果。处理需要多个参数的因素,summary求得在所需要的点的预测值,和需要的差异。缺省情况下,四分位数间距效果(比值比,危害比率,等)印刷的连续因素,所有与基准电平的比较作出分类因素。 print.summary.rms输出结果,latex.summary.rms排版的结果,plot.summary.rms图阴影的信心条以图形的方式显示结果。最长的信心条形的每一页上都标有信心水平(除非这个条形已被忽略,由于clip)。默认情况下,下面的信心水平都显示:0.7,0.8,0.9,0.95,和0.99,使用级灰度(颜色适用于Windows)。


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


## S3 method for class 'rms'
summary(object, ..., est.all=TRUE, antilog,
conf.int=.95, abbrev=FALSE, vnames=c("names","labels"))

## S3 method for class 'summary.rms'
print(x, ...)

## S3 method for class 'summary.rms'
latex(object, title, table.env=TRUE, ...)

## S3 method for class 'summary.rms'
plot(x, at, log=FALSE,
    q=c(0.7, 0.8, 0.9, 0.95, 0.99), xlim, nbar, cex=1, nint=10,
    cex.c=.5, cex.t=1, clip=c(-1e30,1e30), main, ...)



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

参数:object
a rms fit object.  Either options(datadist) should have been set before the fit, or datadist() and options(datadist) run before summary.  For latex is the result of summary.  
rms合适的对象。应该是options(datadist)之前设置合适,或datadist()和options(datadist)运行前summary的。 latex的结果summary。


参数:...
For summary, omit list of variables to estimate effects for all predictors. Use a list  of variables of the form age, sex to estimate using default ranges. Specify age=50 for example to adjust age to 50 when testing other factors (this will only matter for factors that interact with age). Specify e.g. age=c(40,60) to estimate the effect of increasing age from 40 to 60. Specify age=c(40,50,60) to let age range from 40 to 60 and be adjusted to 50 when testing other interacting factors. For category factors, a single value specifies the reference cell and the adjustment value. For example, if treat has levels "a", "b" and "c" and treat="b" is given to summary, treatment a will be compared to b and c will be compared to b. Treatment b will be used when estimating the effect of other factors. Category variables can have category labels listed (in quotes), or an unquoted number that is a legal level, if all levels  are numeric.  You need only use the first few letters of each variable name - enough for unique identification. For variables not defined with datadist, you must specify 3 values, none of which are NA.  Also represents other arguments to pass to latex, is ignored for print, or other optional arguments passed to confbar.  The most important of these is q, the vector of confidence levels, and col, which is a vector corresponding to q specifying the colors for the regions of the bars.  q defaults to c(.7,.8,.9,.95,.99) and col to c(1,.8,.5,.2,.065) for UNIX, so that lower confidence levels (inner regions of bars) corresponding with darker shades.  Specify for example col=1:5 to use actual colors.  For Windows, the default is col=c(1,4,3,2,5), which by default represents black, blue, green, red, yellow.  If you specify q you may have to specify col.  
对于summary,省略变量列表,估计所有的预测效果。使用一个变量列表的形式age, sex估计使用默认的范围。指定age=50比如调整到50岁进行测试时,其他因素(这只会重要的因素,随着年龄的互动)。指定例如age=c(40,60)估计年龄的增加的效果,从40到60。指定age=c(40,50,60)让年龄范围从40到60,并调整到50测试其他相互作用的因素时,。对于类别因素中,一个单一的值指定的参考单元的调整值。例如,如果treat水平"a", "b"和"c"和treat="b"给summary,,治疗a将相比<X >和b,将比较c。治疗b时,将使用估计效果的其他因素。分类变量的类别标签(在引号),或带引号的数字,这是一个法律层面上,如果各级数字。您只需要使用的每个变量名的前几个字母 - 足以唯一标识。与b没有定义的变量,你必须指定3个值,其中没有一个是datadist。同时也代表了其他参数传递给NA,被忽略latex,或其他可选参数传递给print。其中最重要的是confbar,向量的置信水平,和q,它是一个矢量对应于col指定的区域的颜色的条形。 q默认q和c(.7,.8,.9,.95,.99)colUNIX,因此,较低的置信水平(条形的内部区域)对应的暗色调。例如指定c(1,.8,.5,.2,.065)使用的实际颜色。在Windows中,默认情况下是col=1:5,默认情况下,代表黑色,蓝色,绿色,红色,黄色。如果您指定col=c(1,4,3,2,5),“你可能必须指定q。


参数:est.all
Set to FALSE to only estimate effects of variables listed. Default is TRUE.  
设置为FALSE只列出的变量估计的影响。默认是TRUE。


参数:antilog
Set to FALSE to suppress printing of anti-logged effects. Default is TRUE if the model was fitted by lrm or cph. Antilogged effects will be odds ratios for logistic models and hazard ratios for proportional hazards models.  
设置为FALSE抑制抗登录的效果的印刷。默认是TRUE如果模型拟合lrm或cph,。 Antilogged的影响将是logistic模型比例风险模型和风险比的比值比。


参数:conf.int
Defaults to .95 for 95% confidence intervals of effects.  
默认为.95的95%的置信区间的影响。


参数:abbrev
Set to TRUE to use the abbreviate function to shorten factor levels for categorical variables in the model.  
设置为TRUE使用abbreviate功能,缩短因子水平的分类变量在模型中。


参数:vnames
Set to "labels" to use variable labels to label effects. Default is "names" to use variable names.
设置为"labels"使用变量标签,标签的影响。默认是"names"使用的变量名。


参数:x
result of summary
结果summary


参数:title
title to pass to latex.  Default is name of fit object passed to summary prefixed with "summary".
title,传递给latex。默认情况下是合适的对象传递给summary前缀"summary"的名称。


参数:table.env
see latex
看到latex


参数:at
vector of coordinates at which to put tick mark labels on the main axis.  If log=TRUE, at should be in anti-log units.  
向量的坐标把在主轴上的刻度标记标签。如果log=TRUE,at应在反log单位。


参数:log
Set to TRUE to plot on X beta scale but labeled with anti-logs.   
设置TRUE绘制X beta规模,但标有防log。


参数:q
scalar or vector of confidence coefficients to depict
置信系数来描述的标量或矢量


参数:xlim
X-axis limits for plot in units of the linear predictors (log scale if log=TRUE).  If at is specified and xlim is omitted, xlim is derived from the range of at.  
X-轴限制plot单位的线性预测(对数刻度如果log=TRUE)。如果at指定xlim被省略,xlim来自范围at。


参数:nbar
Sets up plot to leave room for nbar horizontal bars.  Default is the number of non-interaction factors in the model.  Set nbar to a larger value to keep too much surrounding space from appearing around horizontal bars.  If nbar is smaller than the number of bars, the plot is divided into multiple pages with up to nbar bars on each page.  
设置的图nbar单杠离开房间。默认值是模型中的非相互作用的因素。 nbar一个较大的值设置太多周围的空间从周围出现的横条。如果nbar是小于的条数,该图被分成多页nbar条形的每一页上。


参数:cex
cex parameter for factor labels.  
cex参数为因数标签。


参数:nint
Number of tick mark numbers for pretty.  
数刻度线号码pretty。


参数:cex.c
cex parameter for confbar, for quantile labels.  
cex参数confbar,分位数的标签。


参数:cex.t
cex parameter for main title.  Set to 0 to suppress the title.  
cex参数的主标题。设置为0抑制的标题。


参数:clip
confidence limits outside the interval c(clip[1], clip[2]) will be ignored, and clip also be respected when computing xlim when xlim is not specified.  clip should be in the units of fun(x).  If log=TRUE, clip should be in X   beta units.   
的置信区间外的时间间隔c(clip[1], clip[2])将被忽略,和clip也可以尊重计算xlimxlim不指定。 clip应该是单位fun(x)。如果log=TRUE,clip应该是在X   beta单位。


参数:main
main title.  Default is inferred from the model and value of log, e.g., "log Odds Ratio".  
主标题。默认是推断,从模式和价值的log,例如,"log Odds Ratio"。


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

For summary.rms, a matrix of class summary.rms  with rows corresponding to factors in the model and columns containing the low and high values for the effects, the range for the effects, the effect point estimates (difference in predicted values for high and low factor values), the standard error of this effect estimate, and the lower and upper confidence limits. If fit$scale.pred has a second level, two rows appear for each factor, the second corresponding to anti&ndash;logged effects. Non&ndash;categorical factors are stored first, and effects for any categorical factors are stored at the end of the returned matrix.  scale.pred and adjust.  adjust is a character string containing levels of adjustment variables, if there are any interactions.  Otherwise it is "". latex.summary.rms returns an object of class c("latex","file"). It requires the latex function in Hmisc.
对于summary.rms,一个矩阵类summary.rms行相应的模型中的因素和列中包含的低和高的值的效果,效果的范围内,的效果的点估计(在不同的预测为高和低的因素值的值),此效应估计的标准误差,并且下部和上部的置信界限。如果fit$scale.pred具有第二电平,显示两行的每个因素,第二个对应于反记录的效果。存储的第一非类别因素,存储结束时的返回的矩阵和的任何类别的因素的影响。 scale.pred和adjust。 adjust是一个字符串,其中包含调节变量的水平,如果有任何互动。否则,它是“”。 latex.summary.rms返回一个对象类c("latex","file")。需要latex的函数,Hmisc。


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



Frank Harrell<br>
Department of Biostatistics, Vanderbilt University<br>
f.harrell@vanderbilt.edu




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

datadist, rms, rms.trans, rmsMisc, Misc, pretty, contrast.rms
datadist,rms,rms.trans,rmsMisc,Misc,pretty,contrast.rms


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


n &lt;- 1000    # define sample size[确定样本量]
set.seed(17) # so can reproduce the results[所以可以重现的结果]
age            <- rnorm(n, 50, 10)
blood.pressure <- rnorm(n, 120, 15)
cholesterol    <- rnorm(n, 200, 25)
sex            <- factor(sample(c('female','male'), n,TRUE))
label(age)            &lt;- 'Age'      # label is in Hmisc[标签是在Hmisc]
label(cholesterol)    <- 'Total Cholesterol'
label(blood.pressure) <- 'Systolic Blood Pressure'
label(sex)            <- 'Sex'
units(cholesterol)    &lt;- 'mg/dl'   # uses units.default in Hmisc[使用units.default在Hmisc]
units(blood.pressure) <- 'mmHg'


# Specify population model for log odds that Y=1[指定的log几率的人口模型Y = 1]
L <- .4*(sex=='male') + .045*(age-50) +
  (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))
# Simulate binary y to have Prob(y=1) = 1/[1+exp(-L)][模拟二进制y以有PROB(y = 1时)= 1 / [1 +(-L)]]
y <- ifelse(runif(n) < plogis(L), 1, 0)


ddist <- datadist(age, blood.pressure, cholesterol, sex)
options(datadist='ddist')


fit <- lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)))


s &lt;- summary(fit)                # Estimate effects using default ranges[使用默认的范围估算的影响]
                                 # Gets odds ratio for age=3rd quartile[获取年龄=第三个四分位数的比值比为]
                                 # compared to 1st quartile[第一四分位数相比,]
## Not run: [#不运行:]
latex(s)                         # Use LaTeX to print nice version[使用LaTeX来打印漂亮的版本]
latex(s, file="")                # Just write LaTeX code to screen[只要写LaTeX代码屏幕]

## End(Not run)[#(不执行)]
summary(fit, sex='male', age=60) # Specify ref. cell and adjustment val[指定参考。单元和调整VAL的]
summary(fit, age=c(50,70))       # Estimate effect of increasing age from[年龄的增加,估计效果]
                                 # 50 to 70[50到第70]
s <- summary(fit, age=c(50,60,70))
                                 # Increase age from 50 to 70, adjust to[增加的年龄从50至70,调整到]
                                 # 60 when estimating effects of other factors[60时,估计其他因素的影响]
#Could have omitted datadist if specified 3 values for all non-categorical[如果可以省略datadist的3个值指定所有非分类]
#variables (1 value for categorical ones - adjustment level)[变量(1为分类的价值 - 调整水平)]
plot(s, log=TRUE, at=c(.1,.5,1,1.5,2,4,8))


options(datadist=NULL)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 10:42 , Processed in 0.035109 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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