全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
3886 2
2014-08-17
比如我要检验多元线性回归模型中的beta_1是否等于beta_2, 那么在R中如何实现呢?
谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2014-8-17 21:07:56
You can try it in the following way. First  fit two models: model 1 is y = beta0 + beta1*x1 + beta2*x2,   model 2 is  y = beta0 + beta1 *(x1+x2). Compute the Residual Sum of Squares for model 1 and for model 2, respectively, denoted by RSS1 and RSS2. Then  calculate the statistics  T = (RSS2-RSS1)/(RSS1/(n-3)) that has a F-distribution with parameters  (1, n-3), where n is the number of observations. So you can apply it to test your problem. For more general problem with more than two variables, the above statistics can be used as well just with a need to modify the degrees of freedom of F distribution.
二维码

扫码加我 拉你入群

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

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

2014-8-20 16:13:39
楚韵荆风 发表于 2014-8-17 21:07
You can try it in the following way. First  fit two models: model 1 is y = beta0 + beta1*x1 + beta2* ...
多谢指教!我很好奇的是用SAS可以直接加一句test x1=x2就可以给出检验beta_1是否等于beta_2, 为什么r需要自己编写F检验程序呢
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群