SPSS Tutorials

BASICS REGRESSION T-TEST ANOVA CORRELATION

SPSS LEAVE Command

Introduction

When a new variable is calculated, this calculation starts off with a SYSTEM MISSING value for each case. Sometimes it's desirable to use the value of the previous case as a starting point. This can be done with the LEAVE command.

Explanation

Example: Creating Test Data with Groups

SPSS Leave Syntax Example

*Create test data, 5 groups of N = 4.

input program.
loop group = 1 to 5.
leave group.
loop # = 1 to 4.
end case.
end loop.
end loop.
end file.
end input program.
exe.
SPSS Leave Command ResultSPSS Leave Command - Result

Previous tutorial: SPSS LAG Function – What and Why?

Next tutorial: SPSS Macros

Let me know what you think!

*Required field. Your comment will show up after approval from a moderator.

This tutorial has 4 comments