I am working in Windows 7, 64-bit, and have IBMSPSS v.21. I tried to work with the R plug-ins and did the following:
1. Installed Python Essentials: 21.0-IM-S21STATPE-WIN64-FP001_Python, which installed Python 2.7.9 version when I go to the python.exe command line ;
2. Installed recommended earlier version of R, 2.14.2 (the one that is recommended in Essentials_for_R_Installation_Instructions) with the required packages (I was interested in quantile regressions, so installed and loaded the "quantreg" package.
3. Installed the R Essentials package: SPSS_Statistics_REssentials_21.0-FP1_win64 in the right directories for SPSS and R.
4. I can see that the R plug-ins are available in SPSS under Utilities, extension bundles (I attach a picture in Word).
5. I have both R and SPSS open and when I try to run the quant regression from SPSS, I get the following message:
6. Do I still need the NumPy and SciPy? What is the nature of the error?
SPSSINC QUANTREG DEPENDENT=RV_Normal
ENTER=RV_Normal_2 QUANTILES = .25 .5 .75
/OPTIONS METHOD = BR STDERR = RANK MISSING=LISTWISE
/SAVE.
Warning # 6894. Command name: BEGIN PROGRAM
The external program exit unexpectedly and lost its content, a new external
program will startup to execute the rest of job.
Answer by JonPeck (4671) | Jan 08, 2015 at 05:38 PM
The Python Essentials and R Essentials have nothing to do with each other, so focus on the R part. Numpy and Scipy are Python.
The error that you are getting probably indicates that there is a problem with the R plugin installation that underlies all of the R extensions. Try running this code from a syntax window.
begin program r.
print(sessionInfo())
end program.
This will fail if the R plugin is not working at all, but otherwise may provide some useful information.
You also need to be sure that bitness of Statistics and the R Essentials match. Although you are on a 64-bit OS, you could be running either 32 or 64-bit Statistics, so check the About box, and make sure that you installed the corresponding version of the R Essentials. (The installer is supposed to check this, but in V21 mismatches were not always detected.)
HTH
Answer by Peter Paprzycki (0) | Jan 08, 2015 at 08:57 PM
Thank you Jon for the fast reply. This is what I did.
1. I uninstalled the 64-bit version, since when I checked my IBMSPSS version is 32-bit.
2. I installed the 32-bit version R-essentials for version 21, SPSS_Statistics_REssentials_21.0-FP1_win32. It said that it installed successfully (please see the attached picture).
3. I restarted the computer.
4. I reran the Statistics procedure and got the same error message. When I ran the four line syntax you recommended, I got a message,
Error # 6887. Command name: begin program
External program failed during initialization.
Execution of this command stops.
The spss package could not be loaded. Please make sure that Essentials for R has been successfully installed.
5. I am sure I have the correct R-essentials now. There are only two on the download side for my version of Statistics, 64 and 32-bit. I also have the correct package of R that the R-essentials calls for, 2.14.2, 32-bit version. The R-essentials found the correct R folder automatically.
Peter
Answer by JonPeck (4671) | Jan 08, 2015 at 09:21 PM
The only thing I can think of is that the installer did not have sufficient permission to install all the files. Did you do the Essentials install using Run As Administrator? If not, try repeating the install in that mode.
Answer by Peter Paprzycki (0) | Jan 09, 2015 at 03:57 PM
Yes, I reinstalled the R-Essentials as an Administrator. I am still getting the same error message. I was thinking if it has something to do with the R package. When I wrote the install.packages("quantreg"), I noticed that
Installing package(s) into 'C:/Users/Peter/Documents/R/win-library/2.14'
(as 'lib' is unspecified)
And then I got the message:
trying URL 'http://cran.case.edu/bin/windows/contrib/2.14/quantreg_4.97.zip'
Content type 'application/zip' length 2804638 bytes (2.7 Mb)
opened URL
downloaded 2.7 Mb
package 'quantreg' successfully unpacked and MD5 sums checked
The downloaded packages are in
C:\Users\Peter\AppData\Local\Temp\RtmpSOub4x\downloaded_packages
Thank you Jon for support since these are nice and powerful features that are available now in IBMSPSS.
Answer by JonPeck (4671) | Jan 09, 2015 at 05:19 PM
It sounds like you installed the quantreg package manually. While the messages you saw are normal, installing the SPSSINC QUANTREG extension bundle normally installs the required R libraries itself.
If you still get the error message when you run the small program I posted above, then the problem is not related to the quantreg extension or page but to the basic plugin install, so any R code run within Statistics would fail. I suggest that you contact Technical Support to see if they can diagnose the problem.
Answer by Peter Paprzycki (0) | Jan 10, 2015 at 03:54 AM
I can see that the Quantreg Extension bundle installed itself correctly (please see attached pint screen) as part of the R Essentials package installation. You mean to install the Quantreg Extension bundle individually from Utilities-Extension Bundles-Install Extension Bundle? Where would I find the .spe file I looked in the SPSS Community and could not find the bundle. Thank you for support.
Peter
Answer by JonPeck (4671) | Jan 10, 2015 at 04:27 AM
You said that you ran
install.packages("quantreg")
which means that you did this directly in R. Installing SPSSINC QUANTREG, which is part of the R Essentials, would do this automatically as long as you have an internet connection, and the installer has sufficient permissions.
But, if running the short diagnostic I posted above
begin program r.
print(sessionInfo())
end program.
also fails, that proves that the problem has nothing to do with quantreg. It is a problem with the basic plugin install. Look at the file spssdxcfg.ini in your Statistics installation directory, and see if it has the location where you installed 32-bit R.
Answer by Peter Paprzycki (0) | Jan 10, 2015 at 08:37 PM
Yes, the diagnostic program fails as well. I checked, where the R Essentials installs itself, and it correctly chooses the R and Statistics directories (please see attached picture) 'C:\Statistics\ and C:\Program Files(x86)\R\R2.14.2. I found the following info in spssdxcfg:
HOME=C:\Python27\
LIB_NAME=InvokePython
[R]
HOME=C:\Program Files (x86)\R\R-2.14.2\
LIB_NAME=InvokeR
Peter
Answer by Peter Paprzycki (0) | Jan 11, 2015 at 11:04 PM
Thank you, Jon. Yes, I opened a Technical Support service request. I am wondering if it has something to do that I have a GradPack version. I just downloaded the 22 version for evaluation, and maybe will get a license for that version. I can see that the integration with R is a very good/useful step. I have been using R now for some time, but it is difficult to learn some of the packages, and some of them are very good, such as the quantreg one.