楼主: nieqiang110
10245 14

[问答] 联立方程组中变量联合显著性检验 [推广有奖]

已卖:5517份资源

学术权威

60%

还不是VIP/贵宾

-

威望
0
论坛币
96449 个
通用积分
808.4280
学术水平
293 点
热心指数
351 点
信用等级
207 点
经验
7280 点
帖子
4801
精华
0
在线时间
5994 小时
注册时间
2007-7-26
最后登录
2025-12-22

楼主
nieqiang110 学生认证  发表于 2015-1-12 20:26:02 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
各位老师:我做方程组估计时用到R的systemfit包,已经可以运用systemfit包来做方程组估计。问题是,在多变量方程组中,如何检验两个变量的联合显著性?我找遍了systemfit包,没有给出方案,而在其他包中(如lmtest,sandwich等),我找不到类似的代码。现请教各位老师,请赐教。
二维码

扫码加我 拉你入群

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

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

关键词:联立方程组 联立方程 方程组 sandwich System 方程组 联合

回帖推荐

蓝色 发表于11楼  查看完整内容

根据你的提示,是5个方程,每个方程包括截距项是13个参数,因此,估计完有5*13个参数 因此,你按照前面的例子,构造方程进行估计 约束条件写成下面的形式就可以了 R1

蓝色 发表于13楼  查看完整内容

第一个检验没有问题啊 > linearHypothesis(fitsur, R1, test = "Chisq") Linear hypothesis test (Chi^2 statistic of a Wald test) Hypothesis: hrearn_married = 0 hrvac_married = 0 hrsick_married = 0 hrins_married = 0 hrpens_married = 0 Model 1: restricted model Model 2: fitsur Res.Df Df Chisq Pr(>Chisq) 1 3020 2 3015 5 14.177 0.01452 * --- Sign ...

沙发
nieqiang110 学生认证  发表于 2015-1-12 20:28:29
stata中很简单,只要用test就行,但是不知道R中怎么干。

藤椅
蓝色 发表于 2015-1-12 21:03:28
好像是
linearHypothesis

查help吧下面是里面的例子

Examples

data( "Kmenta" )

eqDemand <- consump ~ price + income

eqSupply <- consump ~ price + farmPrice + trend

system <- list( demand = eqDemand, supply = eqSupply )


## unconstrained SUR estimation

fitsur <- systemfit( system, method = "SUR", data=Kmenta )


# create hypothesis matrix to test whether beta_2 = \beta_6

R1 <- matrix( 0, nrow = 1, ncol = 7 )

R1[ 1, 2 ] <- 1

R1[ 1, 6 ] <- -1

# the same hypothesis in symbolic form

restrict1 <- "demand_price - supply_farmPrice = 0"


## perform Theil's F test

linearHypothesis( fitsur, R1 )  # rejected

linearHypothesis( fitsur, restrict1 )


## perform Wald test with F statistic

linearHypothesis( fitsur, R1, test = "F" )  # rejected

linearHypothesis( fitsur, restrict1 )


## perform Wald-test with chi^2 statistic

linearHypothesis( fitsur, R1, test = "Chisq" )  # rejected

linearHypothesis( fitsur, restrict1, test = "Chisq" )


# create hypothesis matrix to test whether beta_2 = - \beta_6

R2 <- matrix( 0, nrow = 1, ncol = 7 )

R2[ 1, 2 ] <- 1

R2[ 1, 6 ] <- 1

# the same hypothesis in symbolic form

restrict2 <- "demand_price + supply_farmPrice = 0"


## perform Theil's F test

linearHypothesis( fitsur, R2 )  # accepted

linearHypothesis( fitsur, restrict2 )


## perform Wald test with F statistic

linearHypothesis( fitsur, R2, test = "F" )  # accepted

linearHypothesis( fitsur, restrict2 )


## perform Wald-test with chi^2 statistic

linearHypothesis( fitsur, R2, test = "Chisq" )  # accepted

linearHypothesis( fitsur, restrict2, test = "Chisq" )


已有 1 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
nieqiang110 + 5 + 5 + 5 + 1 精彩帖子

总评分: 论坛币 + 5  学术水平 + 5  热心指数 + 5  信用等级 + 1   查看全部评分

板凳
nieqiang110 学生认证  发表于 2015-1-12 21:10:44
蓝色 发表于 2015-1-12 21:03
好像是
linearHypothesis
谢谢老师给我提供的例子,不过这和两个变量的联合显著检验不是一回事。再次感谢!

报纸
蓝色 发表于 2015-1-12 21:26:06
道理是一样的
你吧那个约束的矩阵写好就可以了

地板
nieqiang110 学生认证  发表于 2015-1-12 21:31:44
蓝色 发表于 2015-1-12 21:26
道理是一样的
你吧那个约束的矩阵写好就可以了
我试试再说,谢谢

7
nieqiang110 学生认证  发表于 2015-1-12 22:34:22
蓝色 发表于 2015-1-12 21:26
道理是一样的
你吧那个约束的矩阵写好就可以了
还是不行,老师。我按照你的建议试了好久,都无法和教材结果一致。谢谢。

8
蓝色 发表于 2015-1-13 07:52:13
r板块许多都很擅长
你想让大家帮你,但这么具体的问题
一不把你写的程序写出来,也不提供数据
二也不要把正确的结果列出来(你说stata可以,你也的把stata的结果和数据都帖出来)
你说不一样,哪里不一样?别人怎么知道
论坛上的其他人怎么帮你能测试。




9
nieqiang110 学生认证  发表于 2015-1-13 09:37:49
. use fringe
. gen hrvac  vacdays/annhrs
. gen hrsick  sicklve/annhrs
. gen hrins  insur/annhrs
. gen hrpens  pension/annhrs
. sureg (hrearn hrvac hrsick hrins hrpens  educ exper expersq tenure
tenuresq union south nrtheast nrthcen married white male), corr
. test married
( 1) [hrearn]married  0
( 2) [hrvac]married  0
( 3) [hrsick]married  0
( 4) [hrins]married  0
( 5) [hrpens]married  0
chi2( 5)  14.48
Prob  chi2  0.0128
. lincom [hrpens]educ - [hrins]educ
( 1) - [hrins]educ  [hrpens]educ  0
各位老师:如上是Stata做出的程序以及结果。我将数据以及原书奉上,具体问题是书中88-90页中显示的。请各位老师就联立方程组中变量的联合显著性检验问题,给出如何用R来做的建议。谢谢。

数据与问题出处.rar
下载链接: https://bbs.pinggu.org/a-1712691.html

1.69 MB

数据与问题出处

本附件包括:

  • fringe.dta
  • Solution Manual of Econometric Analysis of Cross Section and Panel Data Second Edition.pdf
  • FRINGE.RData

10
nieqiang110 学生认证  发表于 2015-1-13 09:38:42
蓝色 发表于 2015-1-13 07:52
r板块许多都很擅长
你想让大家帮你,但这么具体的问题
一不把你写的程序写出来,也不提供数据
老师:已经把数据以及问题出处发到网上了,清指教。

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-25 08:41