I wish to extract particular rows and columns in SPSS sheet but I dont want to give the exact names, rather something like column 1 to 10 and row 1 to 30. Is there a syntax to do this?
Asked
Active
Viewed 2,082 times
1 Answers
3
For rows you could use a variable containig the casenumber:
compute casenum = $casenum.
exe.
select if casenum > 30.
exe.
delete variable casenum.
for the columns python is your friend. I dont know an in-built command for this at least.
begin program.
import spss
start = 1
end = 5
killList = spss.GetVariableName(start-1) + " to " + spss.GetVariableName(end-1)
spss.Submit("delete variables {}".format(killList))
end program.
this snippet will delete "columns" 1 to 5 (included). You can adjust the start and end by changing the respective values

ragamuffin
- 460
- 2
- 12