当前位置: 动力学知识库 > 问答 > 编程问答 >

sas - proc sql aggregate

问题描述:

I have written some code:

proc sql;

create table single_model_summary_na(label = "&label") as

select exposure_index, gen, max(survival_time) as max_st, max(event_prob) as max_ep

from single_model_scored

group by exposure_index, gen

having exposure_index = 0

;

quit;

which appears to be running smoothly, until I test the other three exposure indices I have - the aggregated event_prob is identical for all four cases, although I know from other analyses that this isn't true. Could anyone please tell me where I am going wrong?

single_model_scored is a large dataset that contains the variables I have used along with several others.

The eventual result I would be hoping for (by joining in the proc sql or otherwise) would be along the lines of

exposure_index gen max_st max_ep

0 0 36 .01

0 1 36 .015

1 0 36 .02

1 1 36 .025

and etc.

The results I am actually getting are:

exposure_index gen max_st max_ep

0 0 36 .039329674

0 1 36 .0685513975

1 0 36 .039329674

1 1 36 .0685513975

分享给朋友:
您可能感兴趣的文章:
随机阅读: