LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 1 Feb 2009 09:27:12 -0600
Reply-To:   "Peck, Jon" <peck@spss.com>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   "Peck, Jon" <peck@spss.com>
Subject:   Re: R in SPSS
Comments:   To: Eins Bernardo <einsbernardo@yahoo.com.ph>
In-Reply-To:   A<670469.46242.qm@web76102.mail.sg1.yahoo.com>
Content-Type:   multipart/alternative;

Assuming version 16 or later, you need to install the R plug-in from Developer Central. Then your R syntax can be run in the syntax window between

BEGIN PROGRAM R.

and

END PROGRAM R.

The output automatically appears in the SPSS Viewer with two cautions. 1) In version 16, R graphics are written to files and don't appear in the Viewer. Version 17 integrates the graphics directly. 2) When using R interactively, expression output appears in your console windows, e.g.,

summary(dta)

displays the summary statistics for a data frame, dta. In non-interactive mode, which is what you are in when running BEGIN PROGRAM, you need to enclose the expression in a print function for it to display, e.g.,

print(summary(dta))

The documentation for the apis to communicate between SPSS and R is installed along with the plug-in, and there are examples in the Data Management book linked on Developer Central (www.spss.com/devcentral).

You might also go through the PowerPoint article on Developer Central, "Programmability in SPSS Statistics 17", which you will find on the front page of the site. It includes a detailed example of using the R Quantreg package in SPSS as an extension command. There is also a download in the R section on creating an SPSS dialog box that generates an R program directly. Look for Rboxplot - Creating an R Program from a Dialog. This has a simple dialog box that generates code for an R boxplot along with an article that explains what is happening.

HTH,

Jon Peck

________________________________

From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Eins Bernardo Sent: Sunday, February 01, 2009 3:49 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: [SPSSX-L] R in SPSS

Provided we have installed R, can we run R syntax in the "SPSS Syntax Editor" and then produce outputs in the "SPSS ourput viewer"?

________________________________

Show off your style with new cool skins. Try the all-new Yahoo! Messenger 9.0 today! <http://sg.rd.yahoo.com/ph/messenger/maxwell/*http:/ph.messenger.yahoo.com/>


[text/html]


Back to: Top of message | Previous page | Main SPSSX-L page