R in SPSS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

R in SPSS

E. Bernardo
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!
Reply | Threaded
Open this post in threaded view
|

Re: R in SPSS

Peck, Jon

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:[hidden email]] On Behalf Of Eins Bernardo
Sent: Sunday, February 01, 2009 3:49 AM
To: [hidden email]
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!

Reply | Threaded
Open this post in threaded view
|

Re: R in SPSS

E. Bernardo
Hi all,

I need your help.  Do you have syntax that runs RASCH MODEL in SPSS via R software?

Thank you in advance.
Eins

--- On Sun, 2/1/09, Peck, Jon <[hidden email]> wrote:
From: Peck, Jon <[hidden email]>
Subject: Re: R in SPSS
To: [hidden email]
Date: Sunday, 1 February, 2009, 3:27 PM

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:[hidden email]] On Behalf Of Eins Bernardo
Sent: Sunday, February 01, 2009 3:49 AM
To: [hidden email]
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!



Have a new Yahoo! Mail account?
Kick start your journey by importing all your contacts!