R + SPSS

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

R + SPSS

drfg2008
I still try to solve the problem of an older thread:

http://spssx-discussion.1045642.n5.nabble.com/R-SPSS-equivalent-commands-td4670420.html

(with the full R program and the SPSS-data)

Since R is integrated in SPSS, would it be possible to use a combination of R and SPSS? Any idea how to do that? Maybe some code example?

(The R code examples on IBM website are known to me, but I couldn't match them with my problem)

Thanks
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: R + SPSS

Jon K Peck
You would have more luck if you spelled out what statistical functionality you are looking for rather than asking people to backtranslate R code.

Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        08/16/2011 02:02 PM
Subject:        [SPSSX-L] R + SPSS
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I still try to solve the problem of an older thread:

http://spssx-discussion.1045642.n5.nabble.com/R-SPSS-equivalent-commands-td4670420.html

(with the full R program and the SPSS-data)

Since R is integrated in SPSS, would it be possible to use a combination of
R and SPSS? Any idea how to do that? Maybe some code example?

(The R code examples on IBM website are known to me, but I couldn't match
them with my problem)

Thanks

-----
Dr. Frank Gaeth
FU-Berlin

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/R-SPSS-tp4705612p4705612.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Reply | Threaded
Open this post in threaded view
|

Re: R + SPSS

drfg2008
I thought it might be possible to directly use the R-code [1] within a BEGIN PROGRAM R.
 - AND PROGRAM block, since I could not find a solution with SPSS to repeat the results.


[1] btbb <- glm(ybb ~ xbb - 1, family = binomial, weights = c(rep(13, 21)))
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: R + SPSS

Jon K Peck
You can include that code in an R program within Statistics, assuming that you have installed the R Essentials, but you need to add code to read the data from Statistics.

Here is an example

begin program r.
dta = spssdata.GetDataFromSPSS()
btbb <- glm(ybb ~ xbb - 1, family = binomial, data=dta,weights = c(rep(13, 21)))
end program.

Note that I added the data parameter to the call.
Of course, if you want nice pivot table output, you would need a bit more code.
The code above will produce text output in the Statistics Viewer.


Jon Peck (no "h")
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        drfg2008 <[hidden email]>
To:        [hidden email]
Date:        08/16/2011 11:34 PM
Subject:        Re: [SPSSX-L] R + SPSS
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I thought it might be possible to directly use the R-code [1] within a BEGIN
PROGRAM R.
- AND PROGRAM block, since I could not find a solution with SPSS to repeat
the results.


[1] btbb <- glm(ybb ~ xbb - 1, family = binomial, weights = c(rep(13, 21)))

-----
Dr. Frank Gaeth
FU-Berlin

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/R-SPSS-tp4705612p4706887.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD