Basic data operations in SPSS - ISS - University of Leeds
Basic data operations in SPSS - ISS - University of Leeds
Basic data operations in SPSS - ISS - University of Leeds
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Basic</strong> <strong>data</strong> <strong>operations</strong> <strong>in</strong> <strong>SPSS</strong> for W<strong>in</strong>dows 17<br />
Version 6 (November 2009)<br />
2.1.3 <strong>SPSS</strong> System Variables<br />
<strong>SPSS</strong> uses a set <strong>of</strong> special variables, called system variables, with reserved names to hold the values <strong>of</strong><br />
commonly used <strong>data</strong> items. Their names beg<strong>in</strong> with a dollar sign ($).<br />
Table 2 lists a selection <strong>of</strong> these variables and their values.<br />
Variable Description<br />
$CASENUM Records the number <strong>of</strong> cases read up to and <strong>in</strong>clud<strong>in</strong>g the current case.<br />
$SYSMIS System Miss<strong>in</strong>g Value<br />
$JDATE Current date <strong>in</strong> number <strong>of</strong> days s<strong>in</strong>ce October 14, 1582<br />
$DATE Current date <strong>in</strong> the form dd-mmm-yy<br />
$DATE11 Current date <strong>in</strong> the form dd-mmm-yyyy<br />
$TIME Current date and time. Value is the number <strong>of</strong> seconds from midnight,<br />
October 14, 1582 to the time when the value <strong>of</strong> $TIME is used.<br />
Table 2: A selection <strong>of</strong> <strong>SPSS</strong> system variables<br />
Although their values can not be modified, system variables may be used <strong>in</strong> the same way as normal variables<br />
with<strong>in</strong> <strong>data</strong> transformations.<br />
2.2 Comput<strong>in</strong>g Counts Us<strong>in</strong>g COUNT<br />
A common requirement is the need to form a count <strong>of</strong> the number <strong>of</strong> occurrences <strong>of</strong> a particular value across a<br />
list <strong>of</strong> variables. For example, patients’ medical <strong>data</strong> may conta<strong>in</strong> variables record<strong>in</strong>g the presence or absence<br />
<strong>of</strong> a host <strong>of</strong> symptoms. If the presence <strong>of</strong> a symptom is coded us<strong>in</strong>g ‘1’, the number <strong>of</strong> symptoms exhibited by<br />
the patient is just the number <strong>of</strong> variables with the value ‘1’. Although the Compute facility can deal with this<br />
problem, the Count facility provides a more efficient means <strong>of</strong> perform<strong>in</strong>g this task.<br />
Task 5 Comput<strong>in</strong>g a Count<br />
Objective Create a count <strong>of</strong> the number <strong>of</strong> occurrences <strong>of</strong> a value <strong>in</strong> a set <strong>of</strong> variables.<br />
Problem The <strong>SPSS</strong> <strong>data</strong> file census.sav conta<strong>in</strong>s <strong>data</strong> derived from a national census. The variables<br />
natenvir, natheal, natcrime, natdrug, nateduc, natdef and natmass record the respondents’<br />
views on the adequacy <strong>of</strong> the Government’s spend<strong>in</strong>g <strong>in</strong> several areas <strong>of</strong> national importance,<br />
such as Health and Education.<br />
The responses to these variables are coded as follows:<br />
Code Label<br />
0 Miss<strong>in</strong>g<br />
1 Too Little<br />
2 About Right<br />
3 Too Much<br />
Information Systems Services Page 12 <strong>of</strong>36<br />
Version 4.1 (December 2006) tut113_vn17nov2009.doc}