数据集的 SAS 输出回归

SAS-output regression to a dataset

我使用以下代码将回归结果(残差)输出到新数据集(want)中。回归结果快速显示在结果查看器中,而不能同时创建新数据集。直到现在,我等了大约 30 分钟,仍然没有得到新的数据集。

我的数据集包含 2,500,000 个观察值。这是可能的原因吗?或者我的代码有什么问题吗?谁能给我一些建议?

如果我也想要系数的结果,我应该添加什么代码?谢谢

proc reg data=have;
model dmid=effhalfsp;
output out=want
   r=effhalfspred;
run;

尝试添加 plots=none.

outest=est_data_set 输出估计值;

这会生成 2,500,000 个观测值。 PROC REG 步骤在我的笔记本电脑上运行 1.1 秒并生成您要求的输出。

data test;
do i=1 to 2500000;
    x = rannor(1);
    y = 10 + 1*x + rannor(1);
    output;
end;
drop i;
run;

proc reg data=test outest=estimates plots=none;
model y=x;
output out=want r=resid;
run;
quit;

确保添加 quit;PROC REG 将保留 运行 并等待更多命令。