termplot(stats)
termplot()所属R语言包:stats
Plot Regression Terms
图回归条款
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Plots regression terms against their predictors, optionally with standard errors and partial residuals added.
图对他们的预测,可以选择标准错误和局部残差,回归条款。
用法----------Usage----------
termplot(model, data = NULL, envir = environment(formula(model)),
partial.resid = FALSE, rug = FALSE,
terms = NULL, se = FALSE,
xlabs = NULL, ylabs = NULL, main = NULL,
col.term = 2, lwd.term = 1.5,
col.se = "orange", lty.se = 2, lwd.se = 1,
col.res = "gray", cex = 1, pch = par("pch"),
col.smth = "darkred", lty.smth = 2, span.smth = 2/3,
ask = dev.interactive() && nb.fig < n.tms,
use.factor.levels = TRUE, smooth = NULL, ylim = "common",
...)
参数----------Arguments----------
参数:model
fitted model object
拟合模型对象
参数:data
data frame in which variables in model can be found
数据框中的变量在model可以发现
参数:envir
environment in which variables in model can be found
在环境变量在model可以发现
参数:partial.resid
logical; should partial residuals be plotted?
逻辑;部分残差应该被绘制?
参数:rug
add rugplots (jittered 1-d histograms) to the axes?
添加rugplots(抖动1-D直方图)轴?
参数:terms
which terms to plot (default NULL means all terms)
图的条款(默认的NULL意味着所有条款)
参数:se
plot pointwise standard errors?
图逐点标准的错误?
参数:xlabs
vector of labels for the x axes
X轴的标签的向量
参数:ylabs
vector of labels for the y axes
Y轴标签的向量
参数:main
logical, or vector of main titles; if TRUE, the model's call is taken as main title, NULL or FALSE mean no titles.
逻辑,或向量的主标题;如果TRUE,模型的号召,作为主标题NULL或FALSE的意思是无标题。
参数:col.term, lwd.term
color and line width for the "term curve", see lines.
“长期曲线的颜色和线宽,看到lines。
参数:col.se, lty.se, lwd.se
color, line type and line width for the "twice-standard-error curve" when se = TRUE.
颜色,线型和线宽为“两倍标准误差曲线时se = TRUE。
参数:col.res, cex, pch
color, plotting character expansion and type for partial residuals, when partial.resid = TRUE, see points.
颜色,绘制字符的扩展和部分残差类型,当partial.resid = TRUE,看到points。
参数:ask
logical; if TRUE, the user is asked before each plot, see par(ask=.).
逻辑;如果TRUE,用户要求每个小区前,看到par(ask=.)。
参数:use.factor.levels
Should x-axis ticks use factor levels or numbers for factor terms?
应的x轴刻度因子水平的数字或使用因素方面?
参数:smooth
NULL or a function with the same arguments as panel.smooth to draw a smooth through the partial residuals for non-factor terms
NULL或功能相同的参数作为panel.smooth提请顺利通过非要素方面的部分残留
参数:lty.smth, col.smth, span.smth
Passed to smooth
传递smooth
参数:ylim
an optional range for the y axis, or "common" when a range sufficient for all the plot will be computed, or "free" when limits are computed for each plot.
y轴的可选范围,或"common"时,范围为所有的图足够将计算,或"free"限制时计算每个小区。
参数:...
other graphical parameters.
其他图形参数。
Details
详情----------Details----------
The model object must have a predict method that accepts type=terms, eg glm in the base package, coxph and survreg in the survival package.
模型对象,必须有一个predict方法,接受type=terms如glmbase包coxph和survreg的survival包。
For the partial.resid=TRUE option it must have a residuals method that accepts type="partial", which lm and glm do.
对于partial.resid=TRUE选项,它必须有一个residuals接受type="partial",lm和glm做的方法。
The data argument should rarely be needed, but in some cases termplot may be unable to reconstruct the original data frame. Using na.action=na.exclude makes these problems less likely.
应该很少需要data参数,但在某些情况下termplot可能无法重建原始数据框。使用na.action=na.exclude使这些问题不太可能。
Nothing sensible happens for interaction terms.
发生什么明智的互动方面。
参见----------See Also----------
For (generalized) linear models, plot.lm and
对于(广义)线性模型,plot.lm“
举例----------Examples----------
require(graphics)
had.splines <- "package:splines" %in% search()
if(!had.splines) rs <- require(splines)
x <- 1:100
z <- factor(rep(LETTERS[1:4],25))
y <- rnorm(100, sin(x/10)+as.numeric(z))
model <- glm(y ~ ns(x,6) + z)
par(mfrow=c(2,2)) ## 2 x 2 plots for same model :[#2×2图同样的模式:]
termplot(model, main = paste("termplot( ", deparse(model$call)," ...)"))
termplot(model, rug=TRUE)
termplot(model, partial.resid=TRUE, se = TRUE, main = TRUE)
termplot(model, partial.resid=TRUE, smooth=panel.smooth, span.smth=1/4)
if(!had.splines && rs) detach("package:splines")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|