楼主: crackman
1686 1

[学习资料] syntax学习案例1 [推广有奖]

已卖:401份资源

院士

83%

还不是VIP/贵宾

-

威望
6
论坛币
91928 个
通用积分
23.5045
学术水平
424 点
热心指数
505 点
信用等级
256 点
经验
112978 点
帖子
2940
精华
0
在线时间
2532 小时
注册时间
2007-4-26
最后登录
2025-6-25

初级热心勋章 中级热心勋章 初级学术勋章 初级信用勋章

楼主
crackman 发表于 2010-3-27 12:22:31 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
INPUT PROGRAM.
LOOP id=1 TO 50.
DO REPEAT v=TH00,TH05,TH10,TH15,TH20,TH30,TH40,TH60,TH80.
COMPUTE v=UNIFORM(25).
END REPEAT.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
EXECUTE.
DO REPEAT  h = h00 h05 h10 h15 h20 h30 h40 h60 h80
/ t = 0 .5 1 1.5 2 3 4 6 8 .
COMPUTE h = t.
END REPEAT.
EXECUTE.
VECTOR time = h00 to h80.
VECTOR drug = th00 to th80.
COMPUTE cmax = MAX(th00 to th80).
COMPUTE tmax = $sysmis.
COMPUTE lagdrug = $sysmis.
COMPUTE lagtime = $sysmis.
COMPUTE auc = 0.
LOOP #k = 1 to 9.
DO IF (NOT(MISSING(drug(#k)))).
IF (NOT(MISSING(lagdrug)))
auc = auc + (time(#k) - lagtime)*(lagdrug + drug(#k))/2 .
IF (drug(#k) = cmax and missing(tmax)) tmax = time(#k) .
COMPUTE lagdrug = drug(#k).
COMPUTE lagtime = time(#k).
END IF.
END LOOP.
EXECUTE.
二维码

扫码加我 拉你入群

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

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

关键词:SYNTAX tax compute EXECUTE missing 学习 SYNTAX

沙发
crackman 发表于 2010-3-27 12:25:00
Subject: Re: Area Under the curve

> Here is a solution that I wrote for a similar problem. The area is
> calculated for each case by trapezoidal integration. If your time points
> are evenly spaced, then the commands could be simplified somewhat, but you could
> still use thes same structure if you wished, only changing variable names
> and times.
> I hope this helps.
>
> David Matheson
> SPSS Technical Support
>
> Q.
> How can I use SPSS to calculate the area under a curve for each cas=
e
> in the data file? I have measurements of drug levels in the blood f=
or
> each case at 9 time points. These time points are unevenly spaced b=
ut
> identical for all cases. Suppose that I plotted drug level as a
> function of time for each case. I would like SPSS to calculate the
> area under this curve, using trapezoidal integration, and store it
> in a new variable. I would also like to calculate and store the
> maximum drug level for each case and the time point at which that
> maximum level first appeared for that case.

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 07:02