全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件
3966 3
2010-05-28
用SAS软件怎么做怀特检验阿???
哪位高人指点指点贝!!
二维码

扫码加我 拉你入群

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

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

全部回复
2010-5-28 05:45:23
1# sjliu0509

Question is not clear. I generated a dataset and run a proc reg. The code and results are as following. some explanation are in the code. Hope this will help you. Let me know what you think.

data test;
seed=123456;
do i=1 to 100;
   weight=30*NORMAL(seed)+120;
   height=1.3*weight+NORMAL(SEED);
   output;
   end;
   run;
proc print data=test;
/*The White test tests 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.
We use the / spec option on the model statement to obtain the White test. */

proc reg;
model height=weight/ spec;
run;

                                         The SAS System           16:14 Friday, May 15, 2009  53
                                       The REG Procedure
                                         Model: MODEL1
                                  Dependent Variable: height
                            Number of Observations Read         100
                            Number of Observations Used         100

                                      Analysis of Variance
                                             Sum of           Mean
         Source                   DF        Squares         Square    F Value    Pr > F
         Model                     1         176720         176720     185416    <.0001
         Error                    98       93.40413        0.95310
         Corrected Total          99         176814

                      Root MSE              0.97627    R-Square     0.9995
                      Dependent Mean      156.60601    Adj R-Sq     0.9995
                      Coeff Var             0.62339

                                      Parameter Estimates
                                   Parameter       Standard
              Variable     DF       Estimate          Error    t Value    Pr > |t|
              Intercept     1        0.21567        0.37608       0.57      0.5676
              weight        1        1.29890        0.00302     430.60      <.0001

                                         The SAS System           16:14 Friday, May 15, 2009  54
                                       The REG Procedure
                                         Model: MODEL1
                                  Dependent Variable: height
                                    Test of First and Second
                                      Moment Specification
                                   DF    Chi-Square    Pr > ChiSq
                                    2          2.28        0.3206

it is not significant as which is what we expected.
二维码

扫码加我 拉你入群

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

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

2010-5-29 09:08:11
model过程可以直接执行white过程,具体用法你可参考这个过程的一些介绍。
二维码

扫码加我 拉你入群

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

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

2010-5-29 21:07:32
还是举个例子来说吧:
data a;
do i=1 to 100;
if i le 50 then y=2+0.5*i+2*normal(0);
else  y=2+0.5*i+6*normal(0);
output;
end;
proc model;
parms a0 a1;
y=a1+a2*i;
fit y/white;
run;
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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