关于使visreg情节丰富多彩
我使用关于使visreg情节丰富多彩,r,regression,R,Regression,我使用visreg生成曲面图 testmodel<-lm(y~t1+t2+t3+t4+t5+t6+t7+t1:t7+t2:t3+t5:t6,data=df) visreg2d(testmodel,"t7","t2",plot.type="persp") testmodel您可以使用col参数设置曲面的填充颜色,使用border参数设置网格线的颜色。有关其他选项,请参阅persp功能的帮助(visreg2d如果设置plot.type=“persp”,则使用persp功能绘制绘图) 库(vi
visreg
生成曲面图
testmodel<-lm(y~t1+t2+t3+t4+t5+t6+t7+t1:t7+t2:t3+t5:t6,data=df)
visreg2d(testmodel,"t7","t2",plot.type="persp")
testmodel您可以使用col
参数设置曲面的填充颜色,使用border
参数设置网格线的颜色。有关其他选项,请参阅persp
功能的帮助(visreg2d
如果设置plot.type=“persp”
,则使用persp
功能绘制绘图)
库(visreg)
testmodel可能对您有所帮助
library(visreg)
testmodel <- lm(mpg ~ cyl*wt + gear + carb, data=mtcars)
# red fill, yellow gridlines
visreg2d(testmodel,"cyl","wt",plot.type="persp",
col="red", border="yellow",
theta=120, phi=10, r=10)
# Multicolor fill, yellow gridlines
visreg2d(testmodel,"cyl","wt",plot.type="persp",
col=c("red","green","blue","violet"), border="yellow",
theta=120, phi=10, r=10)