由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS: calculating additional dose (ADDL) for NONMEM
相关主题
如何理解这个sample size calculation的解释请教一下SAS编程的一个问题
[合集] 求教面试问题:how to determine sample sizehelp need for SAS macro
请教一个sample size calculation的问题SAS code help
今天又“R”了 -- 感想和请教。求教 SAS base 123 Q 16
请教一个SAS codingSAS Question 请教
SAS应用问题求助SAS CODE:如何同时对90个variables进行log transformation?
电话面试,对方要求SAS code samples问两个简单的sample的问题
请教一个用SAS作DATA MERGE的问题请问一个SAS proc sql的写法
相关话题的讨论汇总
话题: sampling话题: 101话题: dosing话题: 01jan2000话题: addl
进入Statistics版参与讨论
1 (共1页)
t**i
发帖数: 688
1
Suppose the data for subject #101 is as follows:
ID Date Time Event Glucose
101 01Jan2000 7:30 Sampling .
101 01Jan2000 8:00 Dosing .
101 01Jan2000 8:30 Sampling 100
101 01Jan2000 9:30 Sampling 200
101 01Jan2000 12:30 Sampling 170
101 01Jan2000 18:30 Sampling 140
101 02Jan2000 7:30 Sampling 90
101 02Jan2000 8:00 Dosing .
101 03Jan2000 8:00 Dosing .
101 04Jan2000 8:00 Dosing .
101 05Jan2000 8:00 Dosing .
101 05Jan2000 8:30 Sampling 100
101 05
d*******1
发帖数: 854
2
你的问题倒是很具体详细, 就是太难懂了, 能耐下心来读懂的不多, 最好把这个大
问题分割成几个小问题来问。

【在 t**i 的大作中提到】
: Suppose the data for subject #101 is as follows:
: ID Date Time Event Glucose
: 101 01Jan2000 7:30 Sampling .
: 101 01Jan2000 8:00 Dosing .
: 101 01Jan2000 8:30 Sampling 100
: 101 01Jan2000 9:30 Sampling 200
: 101 01Jan2000 12:30 Sampling 170
: 101 01Jan2000 18:30 Sampling 140
: 101 02Jan2000 7:30 Sampling 90
: 101 02Jan2000 8:00 Dosing .

t**i
发帖数: 688
3
Question: in SAS Data Step, is there a way to refer to future records? I
think not, but would like to have it confirmed.
y*m
发帖数: 102
4
not easy, better sort it by desending order, then do it backwards.
after done, sort it back
or from my previous experience, addl can be calculated by expanding all the
dates in a CDP(constant dosing period), of course you 'll have to know the
start date and end date of each CDP.

【在 t**i 的大作中提到】
: Question: in SAS Data Step, is there a way to refer to future records? I
: think not, but would like to have it confirmed.

d*******1
发帖数: 854
5
yes, remember SAS holds a record in RAM AT A TIME. So in reality SAS would
not remember the previous records nor foresee the upcoming records unless
special techniques are used (R knows all since everything in RAM).
refering to the "future"records can not be done in a single data step. You
either need to create two datasets and merge them ("current records" from
dataset1 match to "future" records from dataset2) or assign the "future"
records to macro variable in the first data step and later on

【在 t**i 的大作中提到】
: Question: in SAS Data Step, is there a way to refer to future records? I
: think not, but would like to have it confirmed.

y*m
发帖数: 102
6
I guess I am too bored today,
here is the solution, baozi is very welcome .I added some data to make it
more realistic.
data temp;
input ID $ Date $9. Time $ Event $ Glucose;
time=put(input(time,time5.),tod5.);
cards;
101 01Jan2000 7:30 Sampling .
101 01Jan2000 8:00 Dosing .
101 01Jan2000 8:30 Sampling 100
101 01Jan2000 9:30 Sampling 200
101 01Jan2000 12:30 Sampling 170
101 01Jan2000 18:30 Sampling 140
101 02Jan2000 7:30 Sampling 90
101 02Jan2000 8:00 Do

【在 t**i 的大作中提到】
: Question: in SAS Data Step, is there a way to refer to future records? I
: think not, but would like to have it confirmed.

p********a
发帖数: 5352
7
赞楼上。。。Good programming skills
i**f
发帖数: 1195
8
不用看文字,看data就好了
把data1的格式变成data2,加上ADDL和II(additional dose的数量和dosing interval)
data1
D Date Time Event Glucose
101 01Jan2000 7:30 Sampling .
101 01Jan2000 8:00 Dosing .
101 01Jan2000 8:30 Sampling 100
101 01Jan2000 9:30 Sampling 200
101 01Jan2000 12:30 Sampling 170
101 01Jan2000 18:30 Sampling 140
101 02Jan2000 7:30 Sampling 90
101 02Jan2000 8:00 Dosing .
101 03Jan2000 8:00 Dosing .
101 04Jan2000 8:00 Dosing .
101 05Jan2000 8:00 Dosing .
data2

【在 d*******1 的大作中提到】
: yes, remember SAS holds a record in RAM AT A TIME. So in reality SAS would
: not remember the previous records nor foresee the upcoming records unless
: special techniques are used (R knows all since everything in RAM).
: refering to the "future"records can not be done in a single data step. You
: either need to create two datasets and merge them ("current records" from
: dataset1 match to "future" records from dataset2) or assign the "future"
: records to macro variable in the first data step and later on

t**i
发帖数: 688
9
What if some of dosing records that are not accompanied with blood sampling
events are missing?

【在 y*m 的大作中提到】
: I guess I am too bored today,
: here is the solution, baozi is very welcome .I added some data to make it
: more realistic.
: data temp;
: input ID $ Date $9. Time $ Event $ Glucose;
: time=put(input(time,time5.),tod5.);
: cards;
: 101 01Jan2000 7:30 Sampling .
: 101 01Jan2000 8:00 Dosing .
: 101 01Jan2000 8:30 Sampling 100

A*******s
发帖数: 3942
10
问问,为啥result data里那个addl是3而不是4呢?后面不是跟了4个dosing的
observation么?
哦,明白了。同一天之后有sampling的不算进addl里面。眼拙了

【在 t**i 的大作中提到】
: Suppose the data for subject #101 is as follows:
: ID Date Time Event Glucose
: 101 01Jan2000 7:30 Sampling .
: 101 01Jan2000 8:00 Dosing .
: 101 01Jan2000 8:30 Sampling 100
: 101 01Jan2000 9:30 Sampling 200
: 101 01Jan2000 12:30 Sampling 170
: 101 01Jan2000 18:30 Sampling 140
: 101 02Jan2000 7:30 Sampling 90
: 101 02Jan2000 8:00 Dosing .

相关主题
SAS应用问题请教一下SAS编程的一个问题
电话面试,对方要求SAS code sampleshelp need for SAS macro
请教一个用SAS作DATA MERGE的问题SAS code help
进入Statistics版参与讨论
t**i
发帖数: 688
11
When a dosing event/record is accompanied with its corresponding sampling
records, then that dosing record should not be counted toward ADDL.
A*******s
发帖数: 3942
12
有个细节还不明白,比如说yOm大牛贴出来的那个dataset
101 01Jan2000 7:30 Sampling .
101 01Jan2000 8:00 Dosing .
101 01Jan2000 8:30 Sampling 100
101 01Jan2000 9:30 Sampling 200
101 01Jan2000 12:30 Sampling 170
101 01Jan2000 18:30 Sampling 140
101 02Jan2000 7:30 Sampling 90
101 02Jan2000 8:00 Dosing .
101 03Jan2000 8:00 Dosing .
101 04Jan2000 8:00 Dosing .
101 05Jan2000 8:00 Dosing .
101 05Jan2000 8:30 Sampling 100
101 05Jan2000 9:30 Sampling 200
101 05Jan2000 12:30 Samplin

【在 t**i 的大作中提到】
: When a dosing event/record is accompanied with its corresponding sampling
: records, then that dosing record should not be counted toward ADDL.

y*m
发帖数: 102
13
then there has to be some variable indicating that, I don't see any variable
like that here?

sampling

【在 t**i 的大作中提到】
: What if some of dosing records that are not accompanied with blood sampling
: events are missing?

y*m
发帖数: 102
14
1) i think not, 'cause there's 06Jan2000 in between without a dosing
2) it was included in my code, 08jan2000 is additional dose for 07jan2000

sampling

【在 A*******s 的大作中提到】
: 有个细节还不明白,比如说yOm大牛贴出来的那个dataset
: 101 01Jan2000 7:30 Sampling .
: 101 01Jan2000 8:00 Dosing .
: 101 01Jan2000 8:30 Sampling 100
: 101 01Jan2000 9:30 Sampling 200
: 101 01Jan2000 12:30 Sampling 170
: 101 01Jan2000 18:30 Sampling 140
: 101 02Jan2000 7:30 Sampling 90
: 101 02Jan2000 8:00 Dosing .
: 101 03Jan2000 8:00 Dosing .

t**i
发帖数: 688
15
To yOm:
After ADDL is obtained, those dosing records that has been counted as part
of ADDL should be deleted. Your code did not do that.
To yOm and Actuaries:
06Jan2000 is a sampling corresponding to the dosing on 05Jan2000. The
records on 07Jan2000 and 08Jan2000 were added by yOm, which do not
necessarily abide the rule of the data set.
Let's concentrate on the data from 01Jan2000 to 06Jan2000.
Essentially, there may be a number of sampling events (the ones on 01Jan2000
and 05Jan2000) follow
t**i
发帖数: 688
16
There may not be a variable indicating this in the data set to begin with.
However, such information has to be obtained/created in the process of
calculating ADDL.
Let's concentrate on the original example dataset for the time being and
complete it.

variable

【在 y*m 的大作中提到】
: then there has to be some variable indicating that, I don't see any variable
: like that here?
:
: sampling

y*m
发帖数: 102
17
really, have you checked my final output dataset, the date from 02jan
through 04jan should have been deleted.

01Jan2000
if

【在 t**i 的大作中提到】
: To yOm:
: After ADDL is obtained, those dosing records that has been counted as part
: of ADDL should be deleted. Your code did not do that.
: To yOm and Actuaries:
: 06Jan2000 is a sampling corresponding to the dosing on 05Jan2000. The
: records on 07Jan2000 and 08Jan2000 were added by yOm, which do not
: necessarily abide the rule of the data set.
: Let's concentrate on the data from 01Jan2000 to 06Jan2000.
: Essentially, there may be a number of sampling events (the ones on 01Jan2000
: and 05Jan2000) follow

y*m
发帖数: 102
18
i don't see any missing dosing date in the original data as well?
or maybe 06jan without dosing row imply the dosing is missing?



【在 t**i 的大作中提到】
: There may not be a variable indicating this in the data set to begin with.
: However, such information has to be obtained/created in the process of
: calculating ADDL.
: Let's concentrate on the original example dataset for the time being and
: complete it.
:
: variable

t**i
发帖数: 688
19
The sampling on 06Jan2000 was corresponding to the dosing on 05Jan2000. The
II is 24 hours, so the sampling outside of a window of 24 hours after a
dosing event could indicate a missing dose unless otherwise explicitly
indicated as 36, 48 or 96 hours sampling events, etc. I did not include
such cases in my example.
In my original example dataset, I did not make any missing values. I wanted
to begin with the simplest scenario :-)

【在 y*m 的大作中提到】
: i don't see any missing dosing date in the original data as well?
: or maybe 06jan without dosing row imply the dosing is missing?
:
:

t**i
发帖数: 688
20
My mistake.
Your code does have those ADDL dosing records removed.

【在 y*m 的大作中提到】
: really, have you checked my final output dataset, the date from 02jan
: through 04jan should have been deleted.
:
: 01Jan2000
: if

1 (共1页)
进入Statistics版参与讨论
相关主题
请问一个SAS proc sql的写法请教一个SAS coding
please help --- SAS System HelpSAS应用问题
填充缺失值 问题请教 (SAS, R, 所用软件不限)电话面试,对方要求SAS code samples
A question about basic statistics, thanks.请教一个用SAS作DATA MERGE的问题
如何理解这个sample size calculation的解释请教一下SAS编程的一个问题
[合集] 求教面试问题:how to determine sample sizehelp need for SAS macro
请教一个sample size calculation的问题SAS code help
今天又“R”了 -- 感想和请教。求教 SAS base 123 Q 16
相关话题的讨论汇总
话题: sampling话题: 101话题: dosing话题: 01jan2000话题: addl