楼主: fengyuan78
3041 4

[其他] 求做STATA题目 [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

已卖:2份资源

大专生

40%

还不是VIP/贵宾

-

威望
0
论坛币
250 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
1 点
经验
294 点
帖子
25
精华
0
在线时间
60 小时
注册时间
2009-6-21
最后登录
2013-7-31

楼主
fengyuan78 发表于 2011-3-1 15:58:26 |AI写论文
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]
关键词:Stata tata Analytical Estimates Residuals

沙发
Elisa129 发表于 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]

藤椅
Elisa129 发表于 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

板凳
fengyuan78 发表于 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.

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

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

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 08:21