.
From: Tasnuva Tabassum t.tasn...@gmail.com
To: Xiaogang Su xiaogan...@gmail.com
Cc: arun smartpink...@yahoo.com; R help r-help@r-project.org; Rui Barradas
ruipbarra...@sapo.pt
Sent: Saturday, February 23, 2013 11:23 PM
Subject: Re: [R] Selecting First Incidence from Longitudinal Data
Hi
, February 24, 2013 12:08 AM
Subject: Re: [R] Selecting First Incidence from Longitudinal Data
sorry, I tried this. But it gave me answer:
# ID COMPL SEX HEREDITY
#1 1 0 1 2
#4 2 0 0 1
#8 3 0 0 1
#13 4 0 1 2
I have a longitudinal competing risk data of the form:
IDCOMPL SEX HEREDITY
1 0 1 2
1 0 1 2
1 3 1 2
2 0 0 1
2 1 0 1
2 2 0 1
2 2 0 1
3 0 0 1
3 0 0 1
3 0
.
- Original Message -
From: Tasnuva Tabassum t.tasn...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Saturday, February 23, 2013 9:28 AM
Subject: [R] Selecting First Incidence from Longitudinal Data
I have a longitudinal competing risk data of the form:
ID COMPL SEX HEREDITY
1 0 1
On Feb 23, 2013, at 6:28 AM, Tasnuva Tabassum wrote:
I have a longitudinal competing risk data of the form:
IDCOMPL SEX HEREDITY
1 0 1 2
1 0 1 2
1 3 1 2
2 0 0 1
2 1 0 1
2 2 0 1
2 2
-project.org
Cc:
Sent: Saturday, February 23, 2013 9:28 AM
Subject: [R] Selecting First Incidence from Longitudinal Data
I have a longitudinal competing risk data of the form:
ID COMPL SEX HEREDITY
1 0 1 2
1 0 1 2
1 3 1 2
2 0 0 1
2 1
Hello,
You can use ?aggregate and ?head to do what you want. Try the following.
dat - read.table(text=
IDCOMPL SEX HEREDITY
10 1 2
10 1 2
13 1 2
20 0 1
21 0 1
22 0 1
22 0 1
30 0
Try this:
dat$sequence - as.vector(unlist(lapply( aggregate(dat$ID, by=list(x),
FUN=length)$x, FUN=function(x){seq(1, x
dat0 - dat[dat$sequence==1, ]
HTH, X
On Sat, Feb 23, 2013 at 1:07 PM, Rui Barradas ruipbarra...@sapo.pt wrote:
Hello,
You can use ?aggregate and ?head to do what you
To account for COMP,
dat$sequence - as.vector(unlist(lapply( aggregate(dat$ID, by=list(dat$ID),
FUN=length)$x, FUN=function(x){seq(1, x
dat0 - dat[dat$sequence==1 dat$COMPL!= 0, ]
HTH, X
On Sat, Feb 23, 2013 at 1:15 PM, Xiaogang Su xiaogan...@gmail.com wrote:
Try this:
dat$sequence -
-
From: Xiaogang Su xiaogan...@gmail.com
To: Rui Barradas ruipbarra...@sapo.pt
Cc: r-help@r-project.org
Sent: Saturday, February 23, 2013 2:15 PM
Subject: Re: [R] Selecting First Incidence from Longitudinal Data
Try this:
dat$sequence - as.vector(unlist(lapply( aggregate(dat$ID, by=list(x),
FUN
0 011
#13 4 0 121
A.K.
- Original Message -
From: Xiaogang Su xiaogan...@gmail.com
To: Rui Barradas ruipbarra...@sapo.pt
Cc: r-help@r-project.org
Sent: Saturday, February 23, 2013 2:15 PM
Subject: Re: [R] Selecting First Incidence from
, 2013 2:15 PM
Subject: Re: [R] Selecting First Incidence from Longitudinal Data
Try this:
dat$sequence - as.vector(unlist(lapply( aggregate(dat$ID, by=list(x),
FUN=length)$x, FUN=function(x){seq(1, x
dat0 - dat[dat$sequence==1, ]
HTH, X
On Sat, Feb 23, 2013 at 1:07 PM, Rui Barradas
.
From: Tasnuva Tabassum t.tasn...@gmail.com
To: Xiaogang Su xiaogan...@gmail.com
Cc: arun smartpink...@yahoo.com; R help r-help@r-project.org; Rui Barradas
ruipbarra...@sapo.pt
Sent: Saturday, February 23, 2013 11:23 PM
Subject: Re: [R] Selecting First Incidence from Longitudinal Data
Hi
13 matches
Mail list logo