mcGraph3(rockchalk)
mcGraph3()所属R语言包:rockchalk
mcGraph3 draws a 3-dimensional scatter and a regression plane
mcGraph3绘制一个3 - 维的散点图和回归平面
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The observations are scattered in 3-dimensions, the fitted values are represented by a mesh, and their shadows in the x1-x2 plane are also represented.
观测散落在3 - 维,拟合值表示的网状结构,以及他们的x1-x2中平面中的阴影表示。
用法----------Usage----------
mcGraph3(x1, x2, y, interaction = FALSE,
drawArrows = TRUE, x1lab, x2lab, ylab, ...)
参数----------Arguments----------
参数:x1
a predictor vector
一个预测向量
参数:x2
a predictor vector
一个预测向量
参数:y
the dependent variable
因变量
参数:interaction
a TRUE or FALSE request for inclusion of the x1-x2 interaction in the regression calculation
在回归计算中的X1-X2互动的列入一个TRUE或FALSE要求的
参数:drawArrows
TRUE or FALSE, do you want arrows from the plane to observed y?
TRUE或FALSE,你想不想箭头从飞机上观察到的Ÿ?
参数:x1lab
label for the x1 axis, (the one called "xlab" inside persp)
标签X1轴,(称为“xlab”内persp一个)
参数:x2lab
label for the x2 axis, (the one called "ylab" inside persp)
标签X2轴,(称为“ylab”内persp一个)
参数:ylab
label for the y (vertical) axis (the one called "zlab" inside persp)
标签在y(垂直)轴(1名为“zlab”里面persp的)
参数:...
optional arguments passed to persp
可选参数传递给persp
值----------Value----------
a list of 2 objects, the fitted regression model and the perspective matrix used with persp to draw the image.
一个列表对象,拟合回归模型和透视矩阵使用persp绘制图像。
(作者)----------Author(s)----------
Paul E. Johnson <pauljohn@ku.edu>
实例----------Examples----------
set.seed(12345)
## Create data with x1 and x2 correlated at 0.10[#创建x1和x2的相关数据,在0.10]
dat <- genCorrelatedData(rho=.1, stde=7)
mcGraph3(dat$x1, dat$x2, dat$y, theta = 0)
dat2 <- genCorrelatedData(rho = 0, stde = 7)
mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = 0, phi = 10)
mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = 30, phi = 10)
mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = -30, phi = 10)
mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = -30, phi = -10)
mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = -30, phi = -15)
## Run regressions with not-strongly correlated data[#密切相关的数据进行回归分析,]
modset1 <- list()
for(i in 1:20){
dat2 <- genCorrelatedData(rho = .1, stde = 7)
summary(lm( y ~ x1 + x2 , data = dat2))
modset1[[i]] <- mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = -30)
}
## Run regressions with strongly correlated data[#密切相关的数据进行回归分析]
modset2 <- list()
for(i in 1:20){
dat2 <- genCorrelatedData(rho = .981, stde = 7)
summary(lm( y ~ x1 + x2 , data = dat2))
modset2[[i]] <- mcGraph3(dat2$x1, dat2$x2, dat2$y, theta = -30)
}
dat3 <- genCorrelatedData(rho = .981, stde = 100, beta=c(0.1, 0.2, 0.3, -0.1))
mcGraph3(dat3$x1, dat3$x2, dat3$y, theta=-10, interaction = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|