全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
2984 4
2011-03-01
悬赏 500 个论坛币 已解决
有人会做下面的2个题目吗,能发下命令吗,悬赏500论坛币求答案啊,谢谢了:

1. use the http://www.stata-press.com/data/imeus/cigconsump dataset, retaining only years 1985 and 1995. Regress lpackpc on lavgprs and lincpc. Use the Breusch-Pagan test (hettest) for variable year. What does this test tell you?

2. Use FGLS to refit the model, using analytical weights based on the residuals from each year. How do these estimates differ from the OLS estimates?

最佳答案

Elisa129 查看完整内容

. predict res, r . gen res_abs=abs(res) . reg res_abs lavgprs lincpc . predict sig_hat . reg lpackpc lavgprs lincpc [aw = sig_hat]
二维码

扫码加我 拉你入群

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

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

全部回复
2011-3-1 15:58:27
. predict res, r
. gen res_abs=abs(res)
. reg  res_abs lavgprs lincpc

. predict sig_hat
. reg  lpackpc lavgprs lincpc [aw = sig_hat]
二维码

扫码加我 拉你入群

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

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

2011-3-1 21:04:11
. reg  lpackpc lavgprs lincpc
      Source |       SS       df       MS              Number of obs =     528
-------------+------------------------------           F(  2,   525) =  162.03
       Model |  9.65857683     2  4.82928842           Prob > F      =  0.0000
    Residual |  15.6472676   525  .029804319           R-squared     =  0.3817
-------------+------------------------------           Adj R-squared =  0.3793
       Total |  25.3058444   527   .04801868           Root MSE      =  .17264
------------------------------------------------------------------------------
     lpackpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     lavgprs |  -.7852949   .0503104   -15.61   0.000    -.8841293   -.6864604
      lincpc |   .3040118   .0531955     5.71   0.000     .1995097    .4085139
       _cons |   7.686531   .1703546    45.12   0.000     7.351871    8.021191
------------------------------------------------------------------------------

. hettest year
Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
         Ho: Constant variance
         Variables: year
         chi2(1)      =     7.76
         Prob > chi2  =   0.0053
二维码

扫码加我 拉你入群

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

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

2011-3-2 14:25:23
3# Elisa129

下面是我自己做的第一问,和你给的答案一样,但第二问不知道怎么做,FGLS应该要用prais命令吧,请问你的第二问答案怎么还是做的OLS回归啊?


. use http://www.stata-press.com/data/imeus/cigconsump

. keep if year == 1985 | year == 1995

(432 observations deleted)

. regress lpackpc lavgprs lincpc


Source |
SS
df
MS
Number of obs =
96

-------------+------------------------------
F(
2,
93) =
45.42


Model |
2.78667621
2
1.3933381
Prob > F
=
0.0000


Residual |
2.85290424
93
.03067639
R-squared
=
0.4941

-------------+------------------------------
Adj R-squared =
0.4832


Total |
5.63958045
95
.059364005
Root MSE
=
.17515

------------------------------------------------------------------------------


lpackpc |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]

-------------+----------------------------------------------------------------


lavgprs |
-.8867271
.128371
-6.91
0.000
-1.141647
-.6318077


lincpc |
.435617
.140242
3.11
0.003
.1571241
.7141099


_cons |
7.780854
.3321711
23.42
0.000
7.121228
8.44048

------------------------------------------------------------------------------

. estat hettest year

Breusch-Pagan / Cook-Weisberg test for heteroskedasticity


Ho: Constant variance


Variables: year


chi2(1)
=
4.31


Prob > chi2
=
0.0379

Hettest is used to test whether the estimated variance of the residuals from a regression are dependent on the values of the year variable. The null hypothesis that the variance of the residuals is homogenous. Therefore, if the p-value is very small, we would have to reject the hypothesis and accept the alternative hypothesis that the variance is not homogenous. So in this case, the evidence is against the null hypothesis that the variance is homogeneous, so we need to refit the model.

二维码

扫码加我 拉你入群

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

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

2011-3-2 16:46:51
看了下书,好像是对的,500论坛币已经给了,请查收。

另外还有2道题目,悬赏1000论坛币,你如果有时间,也看看吧。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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