[R] Retrieving column descriptions into Stata

AJ Bostian ajbostian at virginia.edu
Mon Apr 18 18:32:33 CEST 2005


Dear All,

I am working on a project with Stata 7 datafiles.  I'm trying to do some 
of my analysis in R since I don't have Stata handy.  My problem is with 
accessing the Stata column descriptions.  (Part of the project is to 
clean up these column descriptions.)

I imported the Stata files ok using the standard

X <- read.dta("c:/testdata/test1.dta")

test1.dta has column descriptions, but I can't figure out where they are 
kept in X.  (I assume they are in X somewhere; at least this is what the 
docs seem to imply.)  I see variable names in X, but no descriptions.

As a reverse test, I created a short dataset in R (the numbers 1-100), 
exported it to Stata format, and opened it in Stata.  I was expecting 
the column description to be null, but the column description was 
populated with the variable name.  So it appears that the export program 
knows how to set column descriptions.  I just need to figure out what 
attributes I need to check/set to make it do so.

Any suggestions would be much appreciated.

Regards,
AJ Bostian




More information about the R-help mailing list