[R] Plotting longitudinal data

Jukka Koskela jukka.koskela at helsinki.fi
Tue Sep 7 18:27:18 CEST 2010


Hello,

Hope that someone could help me plotting longitudinal data below:

7213	3333330001	0.8300	13.05.09	1
1	3333330001	0.8700	09.02.05	NULL
4797	3333330001	0.7700	21.03.07	NULL
2399	3333330001	0.7800	12.04.06	NULL
2400	3333330002	NULL	27.03.06	NULL
7230	3333330002	0.8200	14.05.09	0
2	3333330002	0.8400	09.02.05	NULL
4798	3333330002	0.8700	20.03.07	0
4799	3333330003	0.9000	20.03.07	13
2401	3333330003	0.9300	27.03.06	16
3	3333330003	0.8400	10.02.05	NULL
7233	3333330003	NULL	14.05.09	1
4	3333330004	0.7200	10.02.05	NULL
4800	3333330004	0.8900	19.03.07	22
2402	3333330004	0.7300	29.03.06	27
7258	3333330004	0.7700	18.05.09	1

The second column is a patient_id, the third is the value I want to  
plot against the fourth which is the date.

First I 'aggregate' the patient_ids:

id<-unique(dat$patient_id)

Then I try (and fail) to create a loop, that is supposed to plot the data:

for(i in 1:8480){patient_id==id[i]plot(date,value)}


What might be wrong?

And how could I only plot eg quintiles for the ones that go down fastest?

Thanks,

Jukka



More information about the R-help mailing list