首页 > 解决方案 > 使用 CAR 包进行交互类型为 null 的假设检验

问题描述

我正在尝试测试以下内容: H0: Beta2+Beta3*.16 = 0 & Ha: Beta1 + Beta2*.5 does not = 0 using the car package

iv <- ivreg(lnwage ~ educ + exper + expersq100 + disadv + city + city10 + region10_2 + region10_3 + region10_4 + region10_5 + region10_6 + region10_7 + region10_8 + region10_9 + motheduc + fatheduc | nearuniv + exper + expersq100 + disadv + city + city10 + region10_2 + region10_3 + region10_4 + region10_5 + region10_6 + region10_7 + region10_8 + region10_9 + motheduc + fatheduc, data=a2 )
cov5 <- vcovHC(iv, type="HC1")
hnull_6 <-c("exper+expersqr100*.16=0")
linearHypothesis(iv, hnull_6, vcov=cov5)
Error in constants(lhs, cnames_symb) : 
The hypothesis "exper+expersqr100*.16=0" is not well formed: contains bad coefficient/variable names. 

如何使用 car 包成功设置我的 null 而不会发生错误?谢谢!

标签: rhypothesis-test

解决方案


推荐阅读