楼主: juneylee
1950 1

[SAS] [紧急求助]请大家帮忙看看这个程序! [推广有奖]

  • 0关注
  • 0粉丝

已卖:192份资源

高中生

40%

还不是VIP/贵宾

-

威望
0 级
论坛币
206 个
通用积分
27.2617
学术水平
1 点
热心指数
0 点
信用等级
0 点
经验
265 点
帖子
43
精华
0
在线时间
0 小时
注册时间
2008-4-2
最后登录
2008-11-11

楼主
juneylee 发表于 2008-4-13 11:50:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
<span class="tpc_content">目的:用PROC IML过程产生数据,数据满足COX比例风险模型,协变量为2个,取值均为1或者-1,程序中用Z表示。<br/>参数描述:nv表示协变量的个数。ns表示样本量。nf发生死亡的个体数。bt表示协变量对应的回归系数的真实值。nr表示重复的次数。nc(k)表示在第k次与第k+1次死亡之间删失的个体数。<br/>proc IML;<br/>start data;<br/>&nbsp; nv=2;ns=100;nf=100; <br/>bt={0.5 1}; nr=1000; r=I(nv);<br/>&nbsp; nc={0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<br/>&nbsp; &nbsp; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<br/>&nbsp; &nbsp; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<br/>&nbsp; &nbsp; 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0};<br/>&nbsp; &nbsp;seed1=5630123;<br/>&nbsp; &nbsp;seed2=937841;<br/>mtrx1=shape({-1,-1},25,2);mtrx2=shape({1,-1},25,2);mtrx3=shape({-1,1},25,2);<br/>mtrx4=shape({1,1},25,2);<br/>z=mtrx1//mtrx2//mtrx3//mtrx4;<br/>rz=exp(z*bt`); <br/>ft=repeat(0,1,ns); fo=repeat(0,1,nf);<br/>y=repeat(1,ns,nf);<br/>do k=1 to nf;<br/>&nbsp; &nbsp; &nbsp; risk=rz#y(|,k|);<br/>&nbsp; &nbsp; &nbsp; trk=sum(risk);<br/>&nbsp; &nbsp; &nbsp; hit=uniform(seed1)*trk;<br/>&nbsp; &nbsp; &nbsp; j=0;<br/>&nbsp; &nbsp; &nbsp; ptr=0;<br/>do while (ptr&lt;hit);<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j=j+1;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prisk=risk(|1:j|);<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ptr=sum(prisk);<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;<br/>&nbsp; &nbsp; &nbsp; ft(|j|)=k;<br/>&nbsp; &nbsp; &nbsp; fo(|k|)=j;<br/>&nbsp; &nbsp; if k&lt;nf then y(|j,k+1:nf|)=0; <br/>&nbsp; &nbsp; &nbsp; if nc(|k|)&gt;0 &amp; k&lt;nf then do i=1 to nc(|k|);<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tc=y(|+,k+1|);<br/>hic=tc*uniform(seed2); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j=0; &nbsp; &nbsp; ptc=0;<br/>do while(ptc&lt;hic);<br/>j=j+1;<br/>ptc=sum(y(|1:j,k+1|));<br/>&nbsp; &nbsp;end;<br/>y(|j,k+1:nf|)=0;<br/>end; &nbsp; end; <br/>finish data ; run data;<br/><br/>我的问题是:如何输出程序里所产生的数据呢??用什么变量记录程序中所产生的数据。<br/><br/>我对IML很不熟,也没找到相关书籍。从这个程序中我没有看出来输出的部分呢。<br/>还请大家指点指点。<br/>论文模拟部分,很着急啊!!<br/>谢谢大家</span><br/>
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:紧急求助 急求助 Uniform repeat Shape 求助 程序 帮忙

沙发
juneylee 发表于 2008-4-13 16:59:00
<p><font style="BACKGROUND-COLOR: #cce8cf;">请大家帮帮忙指点指点阿!!!</font></p><p></p>

您需要登录后才可以回帖 登录 | 我要注册

客服
GMT+8, 2026-12-5 01:04