How to Use R with Other Statistical Software

943 views

Published on

A short lecture on how to use R with other software such as Stata and SPSS

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
943
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

How to Use R with Other Statistical Software

  1. 1. Interfacing R with Other Software Arindam Basu MBBS MPH PhD School of Health Sciences, University of Canterbury arin.basu@gmail.com
  2. 2. This is R in RStudio
  3. 3. This is Stata
  4. 4. They Do Not Easily Speak …
  5. 5. Questions … • Why Not? • Is there a Need to Let them Speak with Each Other? • Can I work entirely in R while keeping my data in Stata/Spss? • Can I work entirely in Stata while coding in R?
  6. 6. Why do I need to Integrate? • I like R; my colleague likes X • Combine the flexibility and features of both software … • Others? • Demonstrate R
  7. 7. Calling Stata Data into R • Use “foreign” package
  8. 8. Calling R into SPSS • Install R plug-in from – http://www.ibm.com/developerworks/spssdevcen tral • You can use SPSS GUI following installation, or use SPSS syntax to get your work done
  9. 9. SPSS Syntax to Call R in SPSS
  10. 10. Running R from Within Stata • Use the “File” command to create the file to write R code • Invoke a shell using “shell” command within Stata • In Mac, OK to write “R” • In Windows, Use the /Path/to/R.exe
  11. 11. Talking Points • It is relatively easy to use R flexibly with other software such as Stata and SPSS • Similar routines exist for SAS, JMP, and Statistica • The Package “Foreign” is very useful, but for large data sets, consider “memisc” package • With Other software, in most cases with R installed, invoking shell is effective • For More information, see http://r4stats.com/articles/calling-r/

×