下面是问题的简单描述:
对变量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 呢?
如果有人能给予解答,不胜感谢!