Many thanks; using Gabor's advice I'd used:
with(myData, rep(time, evid)[cumsum(evid)])
but yours also works a treat Henrique.
Thanks once again!
Jim.
Henrique Dallazuanna wrote:
>
> If I understand, try this:
>
> with(myData, factor(cumsum(evid), labels = which(evid == 1)))
>
>
> On Th
On 7/3/2008 2:19 PM, Jim Price wrote:
All,
I am constructing a pharmacokinetic dataset and have hit a snag. The dataset
can be demonstrated in the following way:
myData <- data.frame(
evid = c(1, 0, 0, 0, 1, 0, 1, 1, 1, 0),
time = 1:10,
last.dose.time = c(1, 1, 1, 1, 5, 5, 7, 8, 9
If I understand, try this:
with(myData, factor(cumsum(evid), labels = which(evid == 1)))
On Thu, Jul 3, 2008 at 3:19 PM, Jim Price <[EMAIL PROTECTED]> wrote:
>
> All,
>
> I am constructing a pharmacokinetic dataset and have hit a snag. The
> dataset
> can be demonstrated in the following way:
>
Try:
cumsum(myData$evid)
On Thu, Jul 3, 2008 at 2:19 PM, Jim Price <[EMAIL PROTECTED]> wrote:
>
> All,
>
> I am constructing a pharmacokinetic dataset and have hit a snag. The dataset
> can be demonstrated in the following way:
>
>
>
> myData <- data.frame(
>evid = c(1, 0, 0, 0, 1, 0, 1,
All,
I am constructing a pharmacokinetic dataset and have hit a snag. The dataset
can be demonstrated in the following way:
myData <- data.frame(
evid = c(1, 0, 0, 0, 1, 0, 1, 1, 1, 0),
time = 1:10,
last.dose.time = c(1, 1, 1, 1, 5, 5, 7, 8, 9, 9)
)
The evid field is
5 matches
Mail list logo