我是SAS的初级程序员,我遇到了一些试图做LR的问题。
我正在尝试对数据集运行多元线性回归(ads.csv,预测基于电视,广播和报纸数字的销售额)
S_no,TV,Radio,Newspaper,Sales
1,230.1,37.8,69.2,22.1
2,44.5,39.3,45.1,10.4
3,17.2,45.9,69.3,9.3
4,151.5,41.3,58.5,18.5
然而,当我使用初始编码声明输出数据在SAS中运行线性回归时,我得到一个错误:ERROR:必须提供输出SAS数据集。
options linesize=180 pagesize=180 nodate pageno=1;
libname Linreg1 "/folders/myfolders";
proc import datafile="/folders/myfolders/ads.csv";
out=Linreg1.output dbms=dlm replace;
delimiter=,;
getnames=yes;
run;
以下是这小段代码的完整日志:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 options linesize=180 pagesize=180 nodate pageno=1;
57 libname Linreg1 "/folders/myfolders";
NOTE: Libref LINREG1 was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders
58 proc import datafile="/folders/myfolders/ads.csv";
ERROR: Output SAS data set must be provided.
NOTE: The SAS System stopped processing this step because of errors.
非常感谢任何帮助!
答案 0 :(得分:0)
[编辑:正如Reeza在第一条评论中所述]那里还有多余的分号-您的proc导入行需要阅读如下:
options linesize=180 pagesize=180 nodate pageno=1;
libname Linreg1 "/folders/myfolders";
proc import datafile="/folders/myfolders/ads.csv" out=Linreg1.output dbms=dlm replace;
delimiter=,;
getnames=yes;
run;