scatterplot3d包;你如何重新调整回归平面的大小

时间:2015-01-10 17:26:49

标签: r 3d scatter3d

我有兴趣使用R中的scatterplot3d函数生成一系列简单的三维散点图,其中包括没有交互的回归平面。以下代码几乎生成了我遇到的一个问题 - 在很多情况下,回归平面扩展到了边界框(例如,在这种情况下,最靠近x,y和z = 0的角)。我尝试更改轴限制以增加框大小,但这不会改变指定的轴范围(根据包文档是一个未修复的错误)。是否有办法1)重新绘制框以包括整个平面或2)缩小平面以仅包括框内的部分?

示例数据

bugs<-c(335.20,8.68,1.94,3.22,21.79,11.16,1618.00,108.76,250.59,400.81,233.86,15.05,274.62,419.21)
max_dq<-c(0.015,0.001,0.001,0.001,0.002,0.007,0.04,0.001,0.014,0.003,0.002,0.006,0.004,0.013)
since_dist<-c(21,58,5,1,1,19,42,33,22,300,240,79,327,42)

library(scatterplot3d)

3 d plot

reg_plt<-scatterplot3d(max_dq,since_dist,bugs,angle=50)

回归平面

reg_plt$plane3d(lm(bugs~max_dq+since_dist))

0 个答案:

没有答案