标题: 请问大家: [打印本页] 作者: shiyiming 时间: 2010-9-8 05:05 标题: 请问大家: [code:1hfz90pm]Have_1:
Obs Criterion Value
1 -2 Log Likelihood 674.166
2 AIC (smaller is better) 690.166
3 AICC (smaller is better) 690.394
4 BIC (smaller is better) 725.870
5 -2 Log Likelihood 669.260
6 AIC (smaller is better) 689.260
7 AICC (smaller is better) 689.609
8 BIC (smaller is better) 733.890[/code:1hfz90pm]
[code:1hfz90pm]have_2:
Obs distribution
1 exponential
2 gamma[/code:1hfz90pm]
[code:1hfz90pm]data have;
set have_1;
if Criterion = '-2 Log Likelihood' then
set have_2;
run;[/code:1hfz90pm]
结果是
[code:1hfz90pm]Have:
Obs distribution Criterion Value
1 exponential -2 Log Likelihood 674.166
2 exponential AIC (smaller is better) 690.166
3 exponential AICC (smaller is better) 690.394
4 exponential BIC (smaller is better) 725.870
5 gamma -2 Log Likelihood 669.260
6 gamma AIC (smaller is better) 689.260
7 gamma AICC (smaller is better) 689.609
8 gamma BIC (smaller is better) 733.890[/code:1hfz90pm]
写完这段程序,想问问大家,为什么是这样呢?作者: shiyiming 时间: 2010-9-8 08:48 标题: Re: 请问大家: 好奇ING作者: shiyiming 时间: 2010-9-8 08:55 标题: Re: 请问大家: 学习了作者: shiyiming 时间: 2010-9-8 09:32 标题: Re: 请问大家: 很有意思的一个现象。有时候可以用到。作者: shiyiming 时间: 2010-9-8 11:08 标题: Re: 请问大家: Thanks for reply 虽然我没有彻底理解。
I will continue to raise a qustion. what happens when set 'have_2' only has one observation?
答案是 set 'have' 只有前四个观测。
what about set 'have_1' having first 4 observations while keeping 'have_2' unchanged, that is, 2 observations?
答案是 set 'have' 只有四个观测。
似乎这个code也可以套入set a; set b;的模式,即截取最少的观测数。从另一点来讲,set have_2 如何读取数据很令人惊奇。
举例问题1
[code:3bm1qh39]have_1 meet condition? have_2
obs1 Y obs1 -->output
obs2 N -->output
obs3 N -->output
obs4 N -->output
obs5 Y end of have_2 -->stop[/code:3bm1qh39]
推荐的文章也是sas的精髓文章之一。而猪头也颇有Ian之风呢!作者: shiyiming 时间: 2010-9-8 11:29 标题: Re: 请问大家: 应该和set a; set b;的模式不一样的。
加个if,看起来更美好。