24小时热门版块排行榜    

CyRhmU.jpeg
南方科技大学公共卫生及应急管理学院2026级博士研究生招生报考通知(长期有效)
查看: 617  |  回复: 10
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

cheshg

铜虫 (正式写手)

[交流] 【求助】SAS问题

想计算相关系数,有两个变量一个变量是数据形式的,一个 不是,这样应该怎么求相关系数 ???请教  

[ Last edited by cheshg on 2009-6-20 at 00:05 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

★ ★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
mingdong(金币+3,VIP+0):谢谢您的交流! 6-25 15:59
给你 SAS 回归的结果:
CODE:
                                          The SAS System          20:33 Tuesday, June 20, 2009  21

                                        The REG Procedure
                                          Model: MODEL1
                                     Dependent Variable: SOC

                                       Analysis of Variance

                                              Sum of           Mean
          Source                   DF        Squares         Square    F Value    Pr > F

          Model                     1       12.20083       12.20083      20.30    0.0011
          Error                    10        6.01127        0.60113
          Corrected Total          11       18.21210


                       Root MSE              0.77532    R-Square     0.6699
                       Dependent Mean        8.90500    Adj R-Sq     0.6369
                       Coeff Var             8.70661


                                       Parameter Estimates

                                    Parameter       Standard
               Variable     DF       Estimate          Error    t Value    Pr > |t|

               Intercept     1        9.91333        0.31652      31.32      <.0001
               landform1     1       -2.01667        0.44763      -4.51      0.0011

                                          The SAS System          20:33 Tuesday, June 20, 2009  22

                                        The REG Procedure
                                          Model: MODEL1
                                     Dependent Variable: SOC

                                       Analysis of Variance

                                              Sum of           Mean
          Source                   DF        Squares         Square    F Value    Pr > F

          Model                     1        0.00120        0.00120       0.00    0.9800
          Error                    10       18.21090        1.82109
          Corrected Total          11       18.21210


                       Root MSE              1.34948    R-Square     0.0001
                       Dependent Mean        8.90500    Adj R-Sq    -0.0999
                       Coeff Var            15.15416


                                       Parameter Estimates

                                    Parameter       Standard
               Variable     DF       Estimate          Error    t Value    Pr > |t|

               Intercept     1        8.89500        0.55092      16.15      <.0001
               landuse1      1        0.02000        0.77912       0.03      0.9800

相关的源程序如下:
CODE:
data ex;
input landform $        landuse $        SOC;
if landform eq 'tablelan' then landform1 = 1; else landform1 = 0;
if landform eq 'slopelan' then landform2 = 1; else landform2 = 0;
if landuse eq 'grasslan' then landuse1 = 1; else landuse1 = 0;
if landuse eq 'orchard' then landuse2 = 1; else landuse2 = 0;
datalines;
tableland        grassland        8.28
tableland        grassland        9.10
tableland        grassland        8.25
tableland        orchard        7.21
tableland        orchard        7.27
tableland        orchard        7.27
slopeland        orchard        10.20
slopeland        orchard        11.21
slopeland        orchard        10.21
slopeland  grassland      9.23
slopeland  grassland      9.31
slopeland  grassland    9.32
;
proc reg data = ex;
model SOC = landform1;
/* model SOC = landform2; */
run;
proc reg data = ex;
model SOC = landuse1;
/* model SOC = landuse2; */
run;
quit;

[ Last edited by snoopyzhao on 2009-6-20 at 21:34 ]
9楼2009-06-20 21:32:52
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 11 个回答

snoopyzhao

至尊木虫 (职业作家)

给出部分数据看看……
2楼2009-05-17 22:17:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

cheshg

铜虫 (正式写手)

★ ★
mingdong(金币+2,VIP+0):谢谢您的交流! 6-25 15:59
SAS ---相关系数

相求一组是数字形式的变量,量一组不是数字形式的标量的相关系数?怎么求 请高手知道

例如:
变量X          变量Y
  A              1.1   1.2
  B              1.3   1.2
   C               1.4  1.5

每个变量X对照两个以上的变量Y

这样怎么求相关性,或者决定系数 就是X决定Y是多少 ?
3楼2009-06-14 21:37:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
mingdong(金币+1,VIP+0):谢谢! 6-15 14:47
这个似乎没有办法吧。以某个 y 对 x 可以获得线性模型的回归系数(决定系数)。但你的数据集给出的结果都会是 1,呵呵……
4楼2009-06-14 22:17:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复(可上传附件)
信息提示
请填处理意见