SAS中文论坛

标题: 二次多项式回归出现以下问题,请帮忙解析一下 [打印本页]

作者: shiyiming    时间: 2010-10-12 16:05
标题: 二次多项式回归出现以下问题,请帮忙解析一下
data corn:
input x1-x2y@@;
t1=x1; t2=x2; t3=x1*x1; t4=x1*x2; t5=x2*x2;
cards;
40        0.6        1.078
40        1.2        1.885
40        1.8        2.204
55        0.6        2.45
55        1.2        2.764
55        1.2        2.865
55        1.2        3.165
55        1.8        3.911
70        0.6        3.344
70        1.2        5.357
70        1.8        6.351
;
proc reg data=corn;
model y=t1-t5;
run;

下面是运行结果
data corn;
21   input x1-x2y@@;
             -   --
             22  22
              ---  -
              202  200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, /, ;, _DATA_, _LAST_, _NULL_.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

ERROR 200-322: The symbol is not recognized and will be ignored.

22   t1=x1; t2=x2; t3=x1*x1; t4=x1*x2; t5=x2*x2;
23   cards;

ERROR: The value CORN; is not a valid SAS name.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds

35   ;


36   proc reg data=corn;
37   model y=t1-t5;
ERROR: Variable Y not found.
NOTE: The previous statement has been deleted.
38   run;

为什么出现这样的错误,忘指教!
作者: shiyiming    时间: 2010-10-15 16:21
标题: Re: 二次多项式回归出现以下问题,请帮忙解析一下
data corn;
input x1-x2 y@@;
t1=x1; t2=x2; t3=x1*x1; t4=x1*x2; t5=x2*x2;
cards;
40 0.6 1.078
40 1.2 1.885
40 1.8 2.204
55 0.6 2.45
55 1.2 2.764
55 1.2 2.865
55 1.2 3.165
55 1.8 3.911
70 0.6 3.344
70 1.2 5.357
70 1.8 6.351
;
proc reg data=corn;
model y=t1-t5;
run;
作者: shiyiming    时间: 2010-10-15 21:32
标题: Re: 二次多项式回归出现以下问题,请帮忙解析一下
[code:182pnc9z]
data corn;/*纠正一:冒号改成分号*/
input x1-x2 y@@;/*纠正二:x2和y之间加个空格*/
t1=x1; t2=x2; t3=x1*x1; t4=x1*x2; t5=x2*x2;
cards;
40 0.6 1.078
40 1.2 1.885
40 1.8 2.204
55 0.6 2.45
55 1.2 2.764
55 1.2 2.865
55 1.2 3.165
55 1.8 3.911
70 0.6 3.344
70 1.2 5.357
70 1.8 6.351
;
proc reg data=corn;
model y=t1-t5;
run;
quit;/*纠正三:proc reg需要加个quit;语句*/
[/code:182pnc9z]




欢迎光临 SAS中文论坛 (https://mysas.net/forum/) Powered by Discuz! X3.2