As a stata user, you may find out there are limited types of data stata can read in directly. Normally, we use Stat/Transfer to transfer data into stata format. Roger Newson wrote a stata package --stcmd-- that can call Stat/Transfer inside of stata.
To install the package, simply type:
ssc install stcmd
To use stcmd, you need to set up the program path for Stat/Transfer:
global StatTransfer_path `"c:\Program Files\StatTransfer9\st.exe"'
Here is the sample code to read in an Excel data with extension xls:
inputst test.xls
To export data from stata to R inside of stata:
outputst test.Rdata
20 hours ago
No comments:
Post a Comment