全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
1650 1
2010-03-27
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.
二维码

扫码加我 拉你入群

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

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

全部回复
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.
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群