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

R语言:vis.gam()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 17:28:36 | 显示全部楼层 |阅读模式
vis.gam(mgcv)
vis.gam()所属R语言包:mgcv

                                        Visualization of GAM objects
                                         自由亚齐运动对象的可视化

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

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

Produces perspective or contour plot views of gam model predictions, fixing all but the values in view to the  values supplied in cond.
生产gam模型预测的角度,或等高线图的意见,确定在viewcond提供的值但值。


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


vis.gam(x,view=NULL,cond=list(),n.grid=30,too.far=0,col=NA,
        color="heat",contour.col=NULL,se=-1,type="link",
        plot.type="persp",zlim=NULL,nCol=50,...)



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

参数:x
a gam object, produced by gam()
gam对象,产生gam()


参数:view
an array containing the names of the two main effect terms to be displayed on the  x and y dimensions of the plot. If omitted the first two suitable terms will be used. Note that variables coerced to factors in the model formula won't work as view variables, and vis.gam can not detect that this has happened when setting defaults.   
一个数组,包含两个主要图的X和Y尺寸显示效果方面的名称。如果省略前两个合适的条款将被使用。请注意,强迫因素在模型公式的变量将作为视图变量不起作用,vis.gam无法检测到这个设置默认时有发生。


参数:cond
a named list of the values to use for the other predictor terms (not in view). Variables omitted from this list will have the closest observed value to the median  for continuous variables, or the most commonly occuring level for factors. Parametric matrix variables have  all the entries in each column set to the observed column entry closest to the column median.  
指定的值列表使用其他预测方面(而不是在view)。从这个名单遗漏变量将有最接近中位数的观测值,为连续变量的因素,最常见的易出现水平。参数矩阵变量的每一列中的所有条目设置观测到的最接近列位数的列项。


参数:n.grid
The number of grid nodes in each direction used for calculating the  plotted surface.  
在每个方向上的网格节点的数量,用于计算绘制表面。


参数:too.far
plot grid nodes that are too far from the points defined by the variables given in view  can be excluded from the plot. too.far determines what is too far. The grid is scaled into the unit  square along with the view variables and then grid nodes more than too.far from the predictor variables  are excluded.
图网格节点过于远离由view变量定义的点的可以排除图。 too.far决定什么是太远。单位正方形网格缩放到一起view变量,然后网格节点比too.far预测变量被排除。


参数:col
The colours for the facets of the plot. If this is NA then if se>0 the facets are transparent,  otherwise the colour scheme specified in color is used. If col is not NA then it is used as the facet  colour.
图方面的色彩。如果这是NA那么se> 0的面是透明的,否则的配色方案,指定在color使用。 col如果不NA然后它被用作面的颜色。


参数:color
the colour scheme to use for plots when se<=0. One of "topo", "heat", "cm",  "terrain", "gray" or "bw". Schemes "gray" and "bw" also modify the colors used when se>0.
图时,se<= 0使用的配色方案。一个"topo","heat","cm","terrain","gray"或"bw"。计划"gray"和"bw"还可以修改所使用的颜色的时候se> 0。


参数:contour.col
sets the colour of contours when using plot.type="contour". Default scheme used if NULL.
设置轮廓的颜色时使用plot.type="contour"。使用默认的计划,如果NULL。


参数:se
if less than or equal to zero then only the predicted surface is plotted, but if greater than zero, then 3  surfaces are plotted, one at the predicted values minus se standard errors, one at the predicted values and one at the predicted values plus se standard errors.
如果小于或等于零,则只有预测的表面绘制,但如果大于零,则3表面绘制,减去se标准误差,预测值和一个预测值预测值,加上se标准误差。


参数:type
"link" to plot on linear predictor scale and "response" to plot on the response scale.
"link"绘制线性预测的规模和"response"上绘制的响应规模。


参数:plot.type
one of "contour" or "persp".
一个"contour"或"persp"。


参数:zlim
a two item array giving the lower and upper limits for the z-axis scale. NULL to choose automatically.
两个项目给予的Z-轴刻度的上限和下限的阵列。 NULL自动选择。


参数:nCol
The number of colors to use in color schemes.
在配色方案中使用的颜色数。


参数:...
other options to pass on to persp, image or contour. In particular ticktype="detailed" will add proper axes  labelling to the plots.  
其他选项传递到persp,image或contour。在特定的ticktype="detailed"将添加适当的轴标签的图。


Details

详情----------Details----------

The x and y limits are determined by the ranges of the terms named in view. If se<=0 then  a single (height colour coded, by default) surface is produced, otherwise three (by default see-through) meshes are produced at  mean and +/- se standard errors. Parts of the x-y plane too far from data can be excluded by setting too.far
的x和y的限制是由名为view条款的范围内确定。如果se<= 0,那么一个单一的(默认情况下,高度颜色编码)表面产生的,否则(默认情况下,看透)网格在平均生产和+ /  - se标准错误。 xy平面的零件太远数据可以排除设置too.far

All options to the underlying graphics functions can be reset by passing them as extra arguments ...: such supplied values will always over-ride the default values used by vis.gam.
所有的基本图形功能的选项,可以通过他们作为额外的参数复位...:这些值将始终凌驾默认值由vis.gam使用。


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

Simply produces a plot.
只产生一个图。


警告----------WARNINGS----------

The routine can not detect that a variable has been coerced to factor within a model formula,  and will therefore fail if such a variable is used as a view variable. When setting  default view variables it can not detect this situation either, which can cause failures if the coerced variables are the first, otherwise suitable, variables encountered.
变量已被裹挟因素在模型公式,并因此将失败,如果这样的变量view变量的程序无法检测。设置默认的view变量时,它不能检测这种情况下,如果强迫变量,否则变量遇到合适的,这可能会导致失败。


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


Simon Wood <a href="mailto:simon.wood@r-project.org">simon.wood@r-project.org</a>

Based on an original idea and design by Mike Lonergan.



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

persp and gam.
persp和gam。


举例----------Examples----------


library(mgcv)
set.seed(0)
n<-200;sig2<-4
x0 <- runif(n, 0, 1);x1 <- runif(n, 0, 1)
x2 <- runif(n, 0, 1)
y<-x0^2+x1*x2 +runif(n,-0.3,0.3)
g<-gam(y~s(x0,x1,x2))
old.par<-par(mfrow=c(2,2))
# display the prediction surface in x0, x1 ....[预测表面显示在X0,X1 ....]
vis.gam(g,ticktype="detailed",color="heat",theta=-35)  
vis.gam(g,se=2,theta=-35) # with twice standard error surfaces[两次标准的错误表面]
vis.gam(g, view=c("x1","x2"),cond=list(x0=0.75)) # different view [不同的看法]
vis.gam(g, view=c("x1","x2"),cond=list(x0=.75),theta=210,phi=40,
        too.far=.07)
# ..... areas where there is no data are not plotted[.....那里是没有数据的地方都没有绘制]

# contour examples....[轮廓的例子....]
vis.gam(g, view=c("x1","x2"),plot.type="contour",color="heat")
vis.gam(g, view=c("x1","x2"),plot.type="contour",color="terrain")
vis.gam(g, view=c("x1","x2"),plot.type="contour",color="topo")
vis.gam(g, view=c("x1","x2"),plot.type="contour",color="cm")


par(old.par)

# Examples with factor and "by" variables[因素和“由”变量的例子]

fac<-rep(1:4,20)
x<-runif(80)
y<-fac+2*x^2+rnorm(80)*0.1
fac<-factor(fac)
b<-gam(y~fac+s(x))

vis.gam(b,theta=-35,color="heat") # factor example[因素例如]

z<-rnorm(80)*0.4   
y<-as.numeric(fac)+3*x^2*z+rnorm(80)*0.1
b<-gam(y~fac+s(x,by=z))

vis.gam(b,theta=-35,color="heat",cond=list(z=1)) # by variable example[变量的例子]

vis.gam(b,view=c("z","x"),theta= 35) # plot against by variable[暗算的变量]


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 03:50 , Processed in 0.025700 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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