全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1688 6
2011-12-03
悬赏 30 个论坛币 未解决
thanks for help with R code to duplicate the dosing record with EVID=1 for each ID in below sample dataset.

STUD ID SUBJ TIME AMT DV MDV EVID SS II DOSE AGE NSEX NRACE HT WT
1 1 10001 -0.483 . 0 0 0 2 21 0 180 64.5
1 1 10001 0 2 . 1 1 0 0 2 21 0 180 64.5
1 1 10001 0.6 . 0 0 0 . . 2 21 0 180 64.5
1 1 10001 1.1 . 3.192 0 0 . . 2 21 0 180 64.5
1 1 10001 1.52 . 6.184 0 0 . . 2 21 0 180 64.5
1 1 10001 2.12 . 7.723 0 0 . . 2 21 0 180 64.5
1 1 10001 2.5 . 7.59 0 0 . . 2 21 0 180 64.5
1 1 10001 3.1 . 8.063 0 0 . . 2 21 0 180 64.5
1 1 10001 4.1 . 8.018 0 0 . . 2 21 0 180 64.5
1 1 10001 6.12 . 7.652 0 0 . . 2 21 0 180 64.5
1 1 10001 12.35 . 4.616 0 0 . . 2 21 0 180 64.5
1 1 10001 24.1 . 1.209 0 0 . . 2 21 0 180 64.5
1 1 10001 48 . 0 0 0 2 21 0 180 64.5
1 1 10001 72 . 0 0 0 2 21 0 180 64.5
2 30 20404 -2.6 . . 1 0 2 47 0 2 168 65
2 30 20404 0 2 . 1 1 0 0 2 47 0 2 168 65
2 30 20404 3.07 . 4.5 0 0 . . 2 47 0 2 168 65
2 30 20404 1327.4 4 . 1 1 1 12 4 47 0 2 168 65
2 30 20404 1341.57 . 4.1 0 0 . . 4 47 0 2 168 65.4
2 30 20404 1342.57 4 . 1 1 0 0 4 47 0 2 168 65.4
2 30 20404 1345.73 . 11.5 0 0 . . 4 47 0 2 168 65.4



Edit Post    Reply    Reply With Quote    Thanks       

二维码

扫码加我 拉你入群

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

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

全部回复
2011-12-3 01:44:07
Basically, in my example dataset I pasted, for first subject (ID=1), second row is his dosing record, AMT=2, DV=0,TIME=0; for second subject (ID=30), he had three dosing records, AMT=2, 4, 4 at the TIME = 0, 1327.4, 1342.57. I need duplicate these dosing records for each subject, for example, for ID=1, he will have another same dosing record besides the original one, so the goal is he will have two dosing records at TIME=0, at 2nd row and 3rd row, similar to ID=30. Thanks again.
二维码

扫码加我 拉你入群

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

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

2011-12-3 01:47:45
data is attached.
附件列表

data.xls

大小:19.5 KB

 马上下载

二维码

扫码加我 拉你入群

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

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

2011-12-3 03:48:10
ORIGINAL DATA:
复制代码
二维码

扫码加我 拉你入群

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

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

2011-12-3 03:50:48
TARGET DATASET
附件列表

targetdata.xls

大小:20 KB

 马上下载

TARGET DATASET

二维码

扫码加我 拉你入群

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

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

2011-12-3 07:12:45
What you need to do is just separate the dose records, merge with the original dataset before sorting it:
复制代码
A few comments:
1. There may be other ways to do this task. I prefer this one because I can modify the separated dose records (change CMT, RATE, etc) for different absorption models.
2. I do not know what  is your data source. In my experience, the dose and concentration data almost always come from different sources. If I need to do the data management myself, I will keep those 2 sources of data separated right before I finish. That gives you more flexibility.
3. ASCII files are preferred than xls as it is easy to be imported into R and can be used by NM.

Glad to see another NMuser.
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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