- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 csv 文件中有以下数据。
y,x1,x2,x3,x4,x5,x6,x7,x8,x9
10,2113,1985,38.9,64.7,4,868,59.7,2205,1917
11,2003,2855,38.8,61.3,3,615,55,2096,1575
11,2957,1737,40.1,60,14,914,65.6,1847,2175
13,2285,2905,41.6,45.3,-4,957,61.4,1903,2476
10,2971,1666,39.2,53.8,15,836,66.1,1457,1866
11,2309,2927,39.7,74.1,8,786,61,1848,2339
10,2528,2341,38.1,65.4,12,754,66.1,1564,2092
11,2147,2737,37,78.3,-1,761,58,1821,1909
4,1689,1414,42.1,47.6,-3,714,57,2577,2001
2,2566,1838,42.3,54.2,-1,797,58.9,2476,2254
7,2363,1480,37.3,48,19,984,67.5,1984,2217
example = data.frame(x1,x2,x3,x4,y)
如何绘制变量
x1
,
x2
,
x3
使用
scatter3D(x,y,z)
?
library("plot3D")
with(example,scatter3D(y ~ x1 + x2 + x3))
但我得到错误:
Error in min(x,na.rm) : invalid 'type' (list) of argument
最佳答案
看起来您想绘制回归平面。 scatter3d
包中的函数 car
会这样做。您需要安装 car
和 rgl
.首先让我们让您的数据更易于访问:
dput(example)
structure(list(y = c(10L, 11L, 11L, 13L, 10L, 11L, 10L, 11L,
4L, 2L, 7L), x1 = c(2113L, 2003L, 2957L, 2285L, 2971L, 2309L,
2528L, 2147L, 1689L, 2566L, 2363L), x2 = c(1985L, 2855L, 1737L,
2905L, 1666L, 2927L, 2341L, 2737L, 1414L, 1838L, 1480L), x3 = c(38.9,
38.8, 40.1, 41.6, 39.2, 39.7, 38.1, 37, 42.1, 42.3, 37.3), x4 = c(64.7,
61.3, 60, 45.3, 53.8, 74.1, 65.4, 78.3, 47.6, 54.2, 48), x5 = c(4L,
3L, 14L, -4L, 15L, 8L, 12L, -1L, -3L, -1L, 19L), x6 = c(868L,
615L, 914L, 957L, 836L, 786L, 754L, 761L, 714L, 797L, 984L),
x7 = c(59.7, 55, 65.6, 61.4, 66.1, 61, 66.1, 58, 57, 58.9,
67.5), x8 = c(2205L, 2096L, 1847L, 1903L, 1457L, 1848L, 1564L,
1821L, 2577L, 2476L, 1984L), x9 = c(1917L, 1575L, 2175L,
2476L, 1866L, 2339L, 2092L, 1909L, 2001L, 2254L, 2217L)),
class = "data.frame", row.names = c(NA, -11L))
install.packages("car")
install.packages("rgl")
library(car)
library(rgl)
scatter3d(y~x1+x2, example)
关于r - 使用 scatter3D()(包 plot3D)在 R 中绘制多元线性回归,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58895105/
在我的 previous question ,已经确定,当纹理四边形时,面部被分解为三角形,纹理坐标以仿射方式插值。 不幸的是,我不知道如何解决这个问题。 provided link很有用,但没有达到
是否有简单的解决方案可以在 Qt 中为图像添加运动模糊?还没有找到任何关于模糊的好教程。我需要一些非常简单的东西,我可以理解,如果我可以改变模糊角度,那就太好了。 最佳答案 Qt 没有运动模糊过滤器。
我想构建一个有点复杂的轴,它可以处理线性数据到像素位置,直到某个值,在该值中所有内容都被归入一个类别,因此具有相同的数据到像素值。例如,考虑具有以下刻度线的 y 轴: 0%, 10%, 20%, 30
我需要确保两个 View 元素彼此相邻且垂直高度相同。我会使用基线约束来做到这一点,但目前我正在使用线性、可滚动的布局( ScrollView 中的线性布局),当我点击一个元素时,它不允许我从中获取基
考虑正则表达式 ".*?\s*$" 和一个不以空格结尾的字符串。 示例 " a" .最后\s永远无法匹配 a这就是为什么 匹配器迭代: \s\s\s\s\s - fails .\s\s\
Closed. This question needs to be more focused。它当前不接受答案。 想要改善这个问题吗?更新问题,使它仅关注editing this post的一个问题。
我正在尝试阅读英特尔软件开发人员手册以了解操作系统的工作原理,这四个寻址术语让我感到困惑。以上是我的理解,如有不对请指正。 线性地址 : 对一个孤立的程序来说,似乎是一长串以地址0开头的内存。该程序的
有很多方法可以使用正则表达式并相应地使用匹配/测试匹配来检查字符串是否有效。我正在检查包含字母(a-b)、运算符(+、-、/、*)、仅特殊字符(如(')'、'(')和数字(0-9)的表达式是否有效 我
我正在使用 iris 数据集在 R 中练习 SVM,我想从我的模型中获取特征权重/系数,但我想我可能误解了一些东西,因为我的输出给了我 32 个支持向量。假设我要分析四个变量,我会得到四个。我知道在使
我正在使用 iris 数据集在 R 中练习 SVM,我想从我的模型中获取特征权重/系数,但我想我可能误解了一些东西,因为我的输出给了我 32 个支持向量。假设我要分析四个变量,我会得到四个。我知道在使
如何向左或向右滑动线性布局。在该线性布局中,默认情况下我有一个不可见的删除按钮,还有一些其他小部件,它们都是可见状态,当向左滑动线性布局时,我需要使其可见的删除按钮,当向右滑动时,我需要隐藏该删除按钮
我正在编写一个 R 脚本,运行时会给出因变量的预测值。我的所有变量都被分类(如图所示)并分配了一个编号,总类数为101。(每个类是歌曲名称)。 所以我有一个训练数据集,其中包含 {(2,5,6,1)8
如果源栅格位于 linear RGB color space使用以下 Java 代码进行转换,应用过滤器时(最后一行)会引发 java.awt.image.ImagingOpException: Un
我想为我的多个 UIImageView 设置动画,使其从 A 点线性移动到 B 点。 我正在使用 options:UIViewAnimationOptionCurveLinear - Apple 文档
我第一次无法使用 CSS3 创建好看的渐变效果。右侧应该有从黑色到透明的渐变透明渐变。底部是页脚,所以它需要在底部另外淡化为透明。 如果可能的话,一个例子: 页面的背景是一张图片,所以不可能有非透明淡
我有一组线性代数方程,Ax=By。其中A是36x20的矩阵,x是20x1的 vector ,B是36x13,y是13x1。 排名(A)=20。因为系统是超定的,所以最小二乘解是可能的,即; x = (
我有一个带有年月数据列(yyyymm)的 Pandas 数据框。我计划将数据插入每日和每周值。下面是我的 df。 df: 201301 201302 201303
假设我想找到2条任意高维直线的“交点”。这两条线实际上不会相交,但我仍然想找到最相交的点(即尽可能靠近所有线的点)。 假设这些线有方向向量A、B和初始点C、D,我可以通过简单地设置一个线性最小二乘问题
如果我想编写一个函数(可能也是一个类),它从不可变的查找表(调用构造函数时固定)返回线性“平滑”数据,如下所示: 例如func(5.0) == 0.5。 存储查找表的最佳方式是什么? 我正在考虑使用两
给定一条线 X像素长如: 0-------|---V---|-------|-------|-------max 如果0 <= V <= max , 线性刻度 V位置将是 X/max*V像素。 如何计
我是一名优秀的程序员,十分优秀!