多元线性回归,分类和数值自变量

时间:2019-12-06 18:20:15

标签: sas linear-regression

我有一个包含多个月数据(超过1000条记录)的数据集,其结构如下:

   Patient_fin      DOV            Acuity     Wait_time
       1            1/1/2019         1            345
       2            1/1/2019         2            402
       3            1/1/2019         4            49
       4            1/1/2019         1            334
       5            1/2/2019         3            268

我想开发一个线性回归模型,其中输出可以解释为(假设意义),例如,在患者数量为300的一天,我们可以预期4位患者的等待时间为19分钟超过视力3例(参考组)。

我编写了代码,为分类敏锐度变量创建了一个虚拟变量。

 data test1;
 set test; 
 if pt_acuity ~= '' then pt_acuity1=0; 
 if pt_acuity ~= '' then pt_acuity2=0; 
 ...
 if pt_acuity = '1 - Resuscitation'  then pt_acuity1=1; 
 if pt_acuity = '2 - Emergent'       then pt_acuity2=1; 
 ...
 run; 

现在这是我看不清楚的地方。

我可能看错了一切,但是...

如何为我的模型创建一个表,其中包含一个变量,该变量是每天的体积以及按敏锐度计算的中位等待时间?

enter image description here

我尝试了Proc Tab,但是变量的格式不正确,无法进行分析。

 proc tabulate data = test out=test1;
 class  DOV Acuity;
 var Wait_time;
 table DOV , Wait_time* Acuity*(Median)
 all='TOTAL'*(n*f=6.0)/rts=25 misstext='0' printmiss;;
 run;

enter image description here

0 个答案:

没有答案
相关问题