[R] converting a data set to a format for time series analysis

From: Ricardo Pietrobon <pietr007_at_gmail.com>
Date: Mon, 09 Jun 2008 12:45:59 -0400


I currently have a data set describing human subjects enrolled into an international clinical trial, the name of the hospital enrolling this human subject, the date when the subject was enrolled, and a vector with variables representing characteristics of the site (e.g., number of beds in a hospital). my data sets looks like this:

subject	hospital	date_enrollment	hospital_beds
1	hospitalA	1/3/2002	300
2	hospitalA	1/6/2002	300
3	hospitalB	2/4/2002	150
4	hospitalC	3/2/2002	200

to perform a time series analysis I am now trying to get to a format that would give me the following variables:

month year site number_enrolled_subjects hospital_beds

the data would be displayed on one-month intervals, and number of subjects clustered around sites.

any help would be greatly appreciate

thanks

Ricardo



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 09 Jun 2008 - 17:13:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 10 Jun 2008 - 01:30:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive