Search code examples
spss

Is there a way to view / edit the definition of a computed variable after it has been created?


I have created some new computed variables in SPSS. I would like to be able to view the definitions (to check for errors) and possibly edit them after the fact. I cannot find a way to do this or find any advice on the internet.

I can see the definitions in the saved syntax file but there does not seem to be a way to pull the definitions up and view them from the SAV file itself.

Note that this is NOT the same thing as recoding a variable - I want to be able to bring up something like the new variable dialog box for an existing computed variable, view the definition and, if necessary, edit it.


Solution

  • Double-click on the relevant output in your .SAV file. Select, copy, and paste the COMPUTE statement to a Syntax file. Edit the COMPUTE statement as desired. Add the command EXECUTE. after the COMPUTE statement. Select this block of code. Click on the 'play' button in the ribbon (or, select Run > Run Selected).

    This will recompute the variable.

    CAUTION: When you run COMPUTE from syntax, you don't get the warning asking if you want to replace the existing variable.