楼主: yadangsimi
3278 1

[问答] 线性回归检测中的Hypothesis matrix [推广有奖]

  • 0关注
  • 0粉丝

已卖:43份资源

大专生

58%

还不是VIP/贵宾

-

威望
0
论坛币
28 个
通用积分
0.1200
学术水平
3 点
热心指数
2 点
信用等级
0 点
经验
467 点
帖子
61
精华
0
在线时间
44 小时
注册时间
2009-3-3
最后登录
2017-8-4

楼主
yadangsimi 发表于 2011-9-25 12:47:03 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
下面是问题的简单描述:
对变量valadd,用hours,hours^2,capflow,capflow^2, hours*capflow 做线性回归:
quardratic<-lm(valadd~hours+I(hours^2)+capflow+I(capflow^2)+I(hours*capflow))

现在需要测试是否模型中的常数项和二次项系数均为0.即是否intercept=hours^2=capflow^2=hours*capflow =0

已知要用到命令
linear.hypothesis(model, hypothesis.matrix, rhs)
可是我目前还是不明白这里的hypothesis.matrix 到底怎么用。
用help(linear.hypothesis)得到的解释是:
hypothesis.matrix: matrix (or vector) giving linear combinations of coefficients by rows, or a character vector giving the hypothesis in symbolic form

可是具体到这个问题里面应该如何定义hypothesis.matrix 呢?

如果有人能给予解答,不胜感谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:HYPOTHESIS thesis matrix 线性回归 ESI matrix

沙发
DM小菜鸟 发表于 2014-12-17 18:52:47

定义hypothesis.matrix 这个问题

可以参考这个例子:

library(car)

mod.davis <- lm(weight ~ repwt, data=Davis)

## the following are equivalent:

linearHypothesis(mod.davis, diag(2), c(0,1))

linearHypothesis(mod.davis, c("(Intercept) = 0", "repwt= 1"))

linearHypothesis(mod.davis, c("(Intercept)","repwt"), c(0,1))

linearHypothesis(mod.davis, c("(Intercept)", "repwt =1"))

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-4 07:12