全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
43625 11
2010-10-29
有如下回归:
data twox;
input x1 x2 y;
datalines;
16.0 5.8 29.0
15.5 5.5 25.0
14.1 5.3 27.5
13.1 4.8 20.0
12.5 4.7 20.0
12.0 4.3 17.5
11.8 3.6 15.0
13.8 5.0 22.5
15.3 5.6 27.5
14.0 5.1 24.0
;
proc reg;
model y= x1 x2;
plot y*x1/symbol='';
plot y*x2/symbol='';
run;
quit;

回归结果是:
                                            SAS 系统  2010年10月29日 星期五 上午10时46分25秒   4
                                       The REG Procedure
                                         Model: MODEL1
                                     Dependent Variable: y
                            Number of Observations Read          10
                            Number of Observations Used          10

                                      Analysis of Variance
                                             Sum of           Mean
         Source                   DF        Squares         Square    F Value    Pr > F
         Model                     2      179.17902       89.58951      43.49    0.0001
         Error                     7       14.42098        2.06014
         Corrected Total           9      193.60000

                      Root MSE              1.43532    R-Square     0.9255
                      Dependent Mean       22.80000    Adj R-Sq     0.9042
                      Coeff Var             6.29526

                                      Parameter Estimates
                                   Parameter       Standard
              Variable     DF       Estimate          Error    t Value    Pr > |t|
              Intercept     1      -12.81592        4.83961      -2.65      0.0330
              x1            1        0.61838        0.94114       0.66      0.5321
              x2            1        5.44791        2.10036       2.59      0.0357

请问怎么编程才能在回归系数上打上1% 5% 10%的显著性星号*** ** *,并且在系数下用括号标注t值,请高人指点,谢谢谢谢!!!!!!!!!!
二维码

扫码加我 拉你入群

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

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

全部回复
2010-10-29 13:05:34
你花那么长时间写一个这样的程序,不过复制自己添加上去
二维码

扫码加我 拉你入群

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

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

2010-10-29 14:53:49
可是,将来的回归回归还很多,将来的模型模型更复杂,所以希望有简便的方法,毕竟手工是比较低效率的。
请高人指点,谢谢谢谢!!!!!!!!!!!!!!
二维码

扫码加我 拉你入群

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

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

2010-10-29 15:05:54
可以先把回归结果导入到数据集,然后从数据集选择需要的结果
二维码

扫码加我 拉你入群

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

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

2010-10-29 15:08:47
请问,能不能给具体的程序供参考下,谢谢谢谢!!!!!!!!!!!!!!!!!!!!
二维码

扫码加我 拉你入群

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

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

2010-10-29 15:32:54
data twox;
input x1 x2 y;
datalines;
16.0 5.8 29.0
15.5 5.5 25.0
14.1 5.3 27.5
13.1 4.8 20.0
12.5 4.7 20.0
12.0 4.3 17.5
11.8 3.6 15.0
13.8 5.0 22.5
15.3 5.6 27.5
14.0 5.1 24.0
;
ods trace on;
proc reg;
model y= x1 x2;
plot y*x1/symbol='';
plot y*x2/symbol='';
run;
quit;
ods trace off;

ods output ParameterEstimates=result;
proc reg;
model y= x1 x2;
plot y*x1/symbol='';
plot y*x2/symbol='';
run;
quit;
ods output close;

data estimate;
         set result;
         attrib param label='Parameter Estimate' length=$30;
         if probt<=0.01 then param=strip(put(estimate,12.5))||' ***  ('||strip(put(tvalue,6.2))||')';
         else if probt<=0.05 then param=strip(put(estimate,12.5))||' **  ('||strip(put(tvalue,6.2))||')';
         else if probt<=0.1 then param=strip(put(estimate,12.5))||' *  ('||strip(put(tvalue,6.2))||')';
         else param=strip(put(estimate,12.5))||'  ('||strip(put(tvalue,6.2))||')';
run;
proc print label;
var variable df param stderr tvalue probt;
run;
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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