visreg2d(visreg)
visreg2d()所属R语言包:visreg
Visualization of regression functions for two variables
回归函数的两个变量的可视化
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A function used to visualize how two variables interact to affect the response in regression models.
函数用于可视化两个变量的相互作用,从而影响回归模型的响应。
用法----------Usage----------
visreg2d(fit, xvar, yvar, type=c("conditional","effect"),
nn=ifelse(plot.type=="persp",49,99), plot.type=c("image","persp","rgl"),
trans=as.numeric, scale=c("linear","response"), cond=list(),
whitespace=0.2, ...)
参数----------Arguments----------
参数:fit
This is the fitted model object you wish to visualize.
这是你想可视化拟合模型的对象。
参数:xvar
This is the variable to be put on the x-axis of your plot. Both continuous variables and factors are supported.
这是被提上你的曲线的x-轴的变量。连续变量和因素都支持。
参数:yvar
This is the variable to be put on the y-axis of your plot. Both continuous variables and factors are supported.
这是您的图的y轴被提上的变量。连续变量和因素都支持。
参数:type
The type of plot to be produced. The following options are supported:
图的类型。支持以下选项:
If 'conditional' is selected, the plot returned shows the value of the variable on the x-axis and the change in response on the y-axis, holding all other variables constant (median for numeric variables and most common category for factors, by default). See references for further detail.
如果“条件”被选择时,返回的图显示上的x轴方向和在y-轴的变化响应的变量的值,所有其他变量保持恒定(中位数为数字变量和最常见的类别为因素,通过默认情况下)。见参考文献进一步的细节。
If 'effect' is selected, the plot returned shows the effect on the expecte value of the response by moving the x variable away from a reference point on the x-axis (median for numeric variables and most common category for factors, by default). See references for further detail.
如果效果被选择时,返回的图x变量移动远离一个参考点上的x轴(中位数为数字变量和最常见的类别为因素,在默认情况下,显示的效果上人口会响应值的) 。见参考文献进一步的细节。
参数:nn
Resolution of the three dimensional plot. Higher values will results in a smoother looking plot.
分辨率的三维图。高的值将在外观更平滑的图。
参数:plot.type
The style of plot to be produced. The following three options are supported:
图的风格。支持以下三个选项:
image, a filled contour plot.
图像,填充的等高线图。
persp, a 3 dimensional perspective plot.
persp,一个3三维透视图。
rgl, a version of the perspective plot that can be rotated. Note: requires the rgl package to use.
RGL,可旋转的角度图的一个版本。注:需要使用RGL包。
参数:trans
Allows transformations to the response. A function should be passed.
允许转换的响应。应通过一个函数。
参数:scale
If response is selected and a glm is passed as the fit parameter, the response will automatically be transformed.
如果响应被选中,一个的GLM传递合适的参数,响应将被自动转化。
参数:cond
Used to set variables to specific values. Can also be used to select the reference point for an effect plot. Named lists should be passed. All variables left unspecified will be filled in with the median/most common category (see examples).
用于变量设置为特定的值。也可用于选择的参考点为效果图。命名名单应该通过。所有的变量,未指定将被填充,的位数/最常见的类别(见例子)。
参数:whitespace
When x (or y) is a factor, whitespace determines the ammount of space in between factors on the x (or y) axis.
当x(或y)是一个因素,空格确定ammount的空间之间的x(或y)轴的因素对。
参数:...
Graphical parameters can be passed to the function to customize the plots.
图形参数可以传递给函数的自定义图。
值----------Value----------
In addition to providing plots, the visreg function also invisibly returns the data frames and estimates used in the creation
除了提供图,visreg功能也无形地返回的数据框,并估计在创建
(作者)----------Author(s)----------
Patrick Breheny and Woodrow Burchett
参考文献----------References----------
using visreg. http://web.as.uky.edu/statistics/users/pbreheny/publications/visreg.pdf
参见----------See Also----------
visreg
visreg
实例----------Examples----------
ozone <- airquality[complete.cases(airquality),]
fit <- lm(Ozone ~ Solar.R + Wind + Temp + I(Wind^2) + I(Temp^2) + I(Wind*Temp)+I(Wind*Temp^2) + I(Temp*Wind^2) + I(Temp^2*Wind^2),data=ozone)
visreg2d(fit,x="Wind",y="Temp",plot.type="image")
visreg2d(fit,x="Wind",y="Temp",plot.type="persp")
## Requires the rgl package[#要求RGL包]
## Not run: [#不运行:]
visreg2d(fit,x="Wind",y="Temp",plot.type="rgl")
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|