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

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

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

                                        rms Methods and Generic Functions
                                         RMS方法和通用功能

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

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

This is a series of special transformation functions (asis, pol, lsp, rcs, catg, scored, strat, matrx), fitting functions (e.g., lrm,cph, psm, or ols), and generic analysis functions (anova.rms, summary.rms, Predict,  plot.Design, survplot, fastbw, validate, calibrate, specs.rms, which.influence, latex.rms, nomogram, datadist, gendata) that help automate many analysis steps, e.g. fitting restricted interactions and multiple stratification variables, analysis of variance (with tests of linearity of each factor and pooled tests), plotting effects of variables in the model, estimating and graphing effects of variables that appear non-linearly in the model using e.g. inter-quartile-range hazard ratios, bootstrapping model fits, and constructing nomograms for obtaining predictions manually.  Behind the scene is the Design function,  called by a modified version of model.frame.default to store extra attributes. Design() is not intended to be called by users.   Design causes detailed design attributes and descriptions of the distribution of predictors to be stored  in an attribute of the terms component called Design. In addition to model.frame.default being replaced by a modified version, [. and [.factor are replaced by versions which carry along the label attribute of a variable.  In this way, when an na.action function is called to subset out NAs, labels are still defined for variables in the model.
这是一系列特殊的变换函数(asis,pol,lsp,rcs,catg,scored,strat matrx),拟合函数(例如,lrm,cph,psm或ols),和一般的分析功能(anova.rms, summary.rms,Predict,plot.Design,survplot,fastbw,validate,calibrate,specs.rms,which.influence,latex.rms,nomogram,datadist,gendata),帮助许多分析步骤自动化,例如:装修限制的互动和多个分层变量,方差分析与线性度的各因素汇集测试的测试,绘制模型中的变量的影响,估计和图形效果出现的变量非线性模型中的使用,例如四分位范围内的危险比,引导模型拟合,构建手动获得预测的诺模图。幕后是Design功能,称为model.frame.default来存储额外的属性修改后的版本。 Design()不打算被称为由用户。 Design会导致存储在详细设计属性分布的预测和描述的属性terms组件,叫做Design。除了model.frame.default被替换修改后的版本,[.和[.factorlabel属性的变量随身携带的版本取代。在这种方式中,当一个na.action函数被称为满分定居的子集时,标签仍然被定义为在模型中的变量。


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


Design(mf, allow.offset=TRUE, intercept=1)



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

Design(mf, allow.offset=TRUE, intercept=1)
# not to be called by the user; called by fitting routines
# dist <- datadist(x1,x2,sex,age,race,bp)   
# or dist <- datadist(my.data.frame)
# Can omit call to datadist if not using summary.rms, Predict,
# survplot.rms, or if all variable settings are given to them
# options(datadist="dist")
# f <- fitting.function(formula = y ~ rcs(x1,4) + rcs(x2,5) + x1%ia%x2 +
#                       rcs(x1,4)%ia%rcs(x2,5) +
#                       strat(sex)*age + strat(race)*bp)
# See Design.trans for rcs, strat, etc.
# %ia% is restricted interaction - not doubly nonlinear
# for x1 by x2 this uses the simple product only, but pools x1*x2
# effect with nonlinear function for overall tests
# specs(f)
# anova(f)
# summary(f)
# fastbw(f)
# pred <- predict(f, newdata=expand.grid(x1=1:10,x2=3,sex="male",
#                 age=50,race="black"))
# pred <- predict(f, newdata=gendata(f, x1=1:10, x2=3, sex="male"))
# This leaves unspecified variables set to reference values from datadist
# pred.combos <- gendata(f, nobs=10)   # Use X-windows to edit predictor settings
# predict(f, newdata=pred.combos)
# plot(Predict(f, x1))
# latex(f)
# nomogram(f)



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

参数:mf
a model frame
一个模型框架


参数:allow.offset
set to TRUE if model fitter allows an offset term
设置为TRUE模型钳工如果允许偏移项


参数:intercept
1 if an ordinary intercept is present, 0 otherwise
1,如果是一个普通的拦截,否则为0


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

a data frame augmented with additional information about the predictors and model formulation
增强与其他信息的预测和模型制定一个数据框


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



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




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

rms.trans, rmsMisc, cph, lrm, ols, specs.rms, anova.rms, summary.rms, Predict, gendata, fastbw, predictrms. validate, calibrate, which.influence, latex, latex.rms, model.frame.default, datadist, describe, nomogram, vif, dataRep
rms.trans,rmsMisc,cph,lrm,ols,specs.rms,anova.rms,summary.rms,Predict,gendata,fastbw,predictrms。 validate,calibrate,which.influence,latex,latex.rms,model.frame.default,datadist,describe,nomogram,vif,dataRep


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


## Not run: [#不运行:]
require(rms)
dist &lt;- datadist(data=2)     # can omit if not using summary, plot, survplot,[可以忽略不使用总结,图,survplot的如果,]
                             # or if specify all variable values to them. Can[如果指定变量值。可以]
                             # also  defer.  data=2: get distribution summaries[也推迟。数据= 2:获得分配摘要]
                             # for all variables in search position 2[搜索位置2中的所有变量]
                             # run datadist once, for all candidate variables[运行datadist一次,对所有候选变量]
dist &lt;- datadist(age,race,bp,sex,height)   # alternative[替代]
options(datadist="dist")
f <- cph(Surv(d.time, death) ~ rcs(age,4)*strat(race) +
         bp*strat(sex)+lsp(height,60),x=TRUE,y=TRUE)
anova(f)
anova(f,age,height)          # Joint test of 2 vars[2瓦尔联合测试]
fastbw(f)
summary(f, sex="female")     # Adjust sex to "female" when testing[测试时,调整性别为“女”]
                             # interacting factor bp[交互因素基点]
bplot(Predict(f, age, height))   # 3-D plot[3-D图]
plot(Predict(f, age=10:70, height=60))
latex(f)                     # LaTeX representation of fit[乳胶表示适合]


f &lt;- lm(y ~ x)               # Can use with any fitting function that[可以使用任何装置的功能,]
                             # calls model.frame.default, e.g. lm, glm[调用model.frame.default,例如LM,GLM]
specs.rms(f)                 # Use .rms since class(f)="lm"[使用RMS因为类(F)=“LM”]
anova(f)                     # Works since Varcov(f) (=Varcov.lm(f)) works[工程自Varcov(F)(= Varcov.lm(F))工程]
fastbw(f)
options(datadist=NULL)
f &lt;- ols(y ~ x1*x2)          # Saves enough information to do fastbw, anova[保存足够的信息做fastbw,方差分析]
anova(f)                     # Will not do plot.Design since distributions[,不会做plot.Design因为分布]
fastbw(f)                    # of predictors not saved[不保存的预测]
plot(f, x1=seq(100,300,by=.5), x2=.5)
                             # all values defined - don't need datadist[所有定义的值 - 不需要datadist]
dist &lt;- datadist(x1,x2)      # Equivalent to datadist(f)[等效,以datadist(六)]
options(datadist="dist")
plot(f, x1, x2=.5)        # Now you can do plot, summary[现在你可以做策划,总结]
plot(nomogram(f, interact=list(x2=c(.2,.7))))

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

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

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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