Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Translate SPSS syntax files to R source code [closed]

Tags:

r

spss

A friend is in search of a method to translate SPSS 'syntax' files to semantically equivalent R source code files.

I suppose, no one ever wrote a translator. But maybe I'm wrong.

PS: Please excuse the wrong use of 'syntax': People using SPSS tend to name an SPSS source program a 'syntax file' ;-)

like image 800
SteAp Avatar asked Jan 20 '23 19:01

SteAp


1 Answers

The short answer is that sorry, you are right, there is no tool for automatically translating SPSS script to R script. Even worse, such a tool would likely take several (many?) man-years to create, so don't hold your breath.

A small concession is that it is probably not to hard to create a tool for translating very small, specific subsets of SPSS to R. For example, if you have a chunk of code for reading in CSV files, then you could use regular expressions to extract the useful bits from the SPSS code and autogenerate some R code from them. In most instances however it will be far easier and faster to manually port the code yourself.

If all else fails, ask Bob Muenchen; he know a lot about porting SPSS to R.

like image 140
Richie Cotton Avatar answered Jan 29 '23 19:01

Richie Cotton