SPSS Statistics

 View Only

 Competing risk using R in SPSS

Georgina Naylor's profile image
Georgina Naylor posted Fri July 11, 2025 09:38 AM

Hi all - hoping for some help please  in setting up R in SPSS so that I can run competing risk survival analysis on my cohort of cancer patients. I have spent hours trying to sort this, and am just failing!!

SPSS Stats 28.0.1. R 4.0 (correct version now!) have tried to download all relevant extensions in hub. Have correctly assigned R file location in SPSS settings.

I can't seem to run R using BEGIN PROGRAM R. I keep getting messages like "_SLINE OFF" or "_SLINE 0 3."

I use pretty basic SPSS functions at present, and R is totally new to me, so any help with very easy to understand advice/tips would be so very much appreciated!!

Thanks,
Georgie

Meni Berger's profile image
Meni Berger

Hello Georgina,

I've encountered the same phenomenon when coding Python into SPSS syntax. Had a nice discussion about this with SPSS tech support.

Let's presume your code is valid and can operate without bugs. 

The BEGIN PROGRAM R\PYTHON. - END PROGRAM. It is different from other blocks of code in SPSS. You must highlight the entire block from BEGIN PROGRAM R\Python to END PROGRAM. And of course, all the code in between, and only then click Run.

If you Run in any other way, you will get the _SLINE OFF error, the processor is busy, and the file is caught in memory. To release it, you need to run any BEGIN PROGRAM R\PYTHON. - END PROGRAM. That is valid (like a print command or such).

It is some sort of defect that they might address in future versions. 

I can show you how to do it with a screen capture if you are not sure.