Re: [R] Converting a list from R to Stata

From: Thomas Lumley <>
Date: Thu 04 Aug 2005 - 01:38:44 EST

On Wed, 3 Aug 2005, Vicky Landsman wrote:


> Dear all,
> I have a list containing 150 simulated datasets in R. Is there a way to
> convert it to the Stata format such that I will be able to apply some Stata
> functions on each dataset in the list?

For Stata your best best is probably to stack all 150 datasets into one long data frame and add an id variable, so you can then -by id:- your analysis. <-"rbind", the.list.of.datasets) will stack them for you and$id <- rep(1:150, sapply(, nrow)) will make the id variable.

         -thomas mailing list PLEASE do read the posting guide! Received on Thu Aug 04 01:43:25 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:02:39 EST