- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有回归器 a
, b
, c
, e_1
和 e_2
我想运行以下回归:y ~ a + b + c + e_1 + e_2 + a.e_1 + a.e_2 + b.e_1 + b.e_2 + c.e_1 + c.e_2
每个e_1
和 e_2
必须与 a
互动, b
和 c
变量。
我实际上有 5 e
's 和其他 5 个变量。编写代码而不是单独编写的最快方法是什么a:e_1
, a:e_2
等等。
最佳答案
怎么样~(a+b+c)*(e1+e2)
?
例子:
dd <- data.frame(a=1,b=1,c=1,e1=1,e2=1)
colnames(model.matrix(~(a+b+c)*(e1+e2),dd)
## [1] "(Intercept)" "a" "b" "c" "e1"
## [6] "e2" "a:e1" "a:e2" "b:e1" "b:e2"
## [11] "c:e1" "c:e2"
pfun <- function(x) paste("(", paste(x,collapse="+"), ")")
reformulate(paste(pfun(p), "*", pfun(q)), response="y")
关于r - 如何以紧凑的形式描述回归交互项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60183196/
问题:用任何语言编写一个程序,给定一个字符串,生成一个与输入字符串的任何字谜匹配的正则表达式。对于所有大于某个长度 N 的正则表达式,正则表达式必须短于列出所有可能的字谜的“蛮力”解决方案,其中列出了
我正在尝试使用 html 和 css 生成一个简单的甘特图,我需要弄清楚如何使它紧凑,这意味着如果有可用的空白,该条应尝试适合前一行,同时保持相同的 x 距离。 上下文: X 轴是以月为单位的时间轴
我收到以下错误 (1/1) ErrorException compact(): Undefined variable: operator 这是我的代码行 $postsCat = Post::w
我正在使用 java 读取紧凑/截断的 PDF417 条形码,并且我有标准 PDF417 条形码的开始和结束模式的矩阵: Start Pattern = 81111113 (ending wit
我正在使用的当前 ListView 在文本上方和下方有额外的空间。我如何使它成为一个真正紧凑的? http://jsfiddle.net/qW6sP/8/
是否有办法“压缩”SQL 查询的结果? 结果如下: +----+-----------+----------+-----------+-------------+--------+ | ID | Fi
我目前在我的 Java 项目中使用 JSON(通过 gzip 压缩),其中我需要在磁盘上存储大量对象(数亿)。我每行有一个 JSON 对象,并且不允许在 JSON 对象中换行。这样我就可以逐行从磁盘流
R具有qr()函数,该函数使用LINPACK或LAPACK执行QR分解(以我的经验,后者快5%)。返回的主要对象是一个矩阵“ qr”,该矩阵包含在上三角矩阵R中(即R=qr[upper.tri(qr)
我希望开始 SQL 开发,因此决定用 Java 和 C# 实现一个使用基于 SQL 的数据库的应用程序,特别是它将是一个桌面应用程序,用于存储某些类型的数据通过数据库访问用户机器。 阅读此处发布的答案
我目前正在尝试解决一个奇怪的问题。我找不到太多相关信息。 简而言之: 当反序列化一个 xml 序列化对象时,我得到了一个正确对象类型的实例,但我只得到了对象内部的默认值。 长话短说: 序列化和反序列化
假设我需要一个包含许多重复元素的数组,如下所示: [3,3,3,3,3,8,8,8,8,5,5,5,5,5,5](所以这是五个 3,四个 8,和六个 5) 在 python 中,你可以像这样非常优雅地
这个问题在这里已经有了答案: Reverse the ordering of words in a string (48 个回答) 关闭 7 年前。 所以我正在尝试针对提示提出一个好的 C++ 解决
我是一名优秀的程序员,十分优秀!