Convert a dta file to csv without Stata software

前端 未结 11 2053

Is there a way to convert a dta file to a csv?

I do not have a version of Stata installed on my computer, so I cannot do something like: <

11条回答
  •  有刺的猬
    2020-11-30 22:15

    The R method will work reliably, and it requires little knowledge of R. Note that the conversion using the foreign package will preserve data, but may introduce differences. For example, when converting a table without a primary key, the primary key and associated columns will be inserted during the conversion.

    From http://www.r-bloggers.com/using-r-for-stata-to-csv-conversion/ I recommend:

    library(foreign)
    write.table(read.dta(file.choose()), file=file.choose(), quote = FALSE, sep = ",")
    

提交回复
热议问题