Dr. Kiran Kumar Agrawal (Associate Professor)
Dr. Kiran Kumar Agrawal (Associate Professor)
Each variable name you use must adhere to the following rules.
• Each variable may be any length but shorter than 10 characters is usually desirable.
• It must begin with a letter or the symbols @ or $. After that any letters, numbers, a
period, or the symbols @, #, _, or $ may be used. However, the name may not end with
a period.
• All variable names must be unique; duplicates are not allowed.
• Variable names are not sensitive to upper or lower case. ID, Id, and id are all
• identical to SPSS
• Because they have a unique meaning in SPSS, certain variable names may not be used,
including: all, ne, eq, to, le, lt, by, or, gt, and, not, ge, and with.
INSERTING A NEW VARIABLE To insert a new variable, click on the variable to the right of
where you would like the new variable to be located, click on the insert-variable icon, and a new
column will open (to the left) and push all other variables exactly one column to the right. You
may then name and format the new variable and enter data in that column.
TO COPY OR CUT CELLS To copy rows or columns of data, first highlight the data you want to
copy by a click on the variable name (to highlight all entries for one variable) or click on the case
number (to highlight all the entries for one subject or case) and then use the shift and arrow keys
to highlight larger blocks of data. Once the cells you want to copy are highlighted, right-click on
the highlighted cells and (from the drop down menu) click Copy if you wish to leave the cells
where they are but put them onto the clipboard for future pasting. Click the Cut option if you wish
to delete the cells from the data editor and place them onto the clipboard.
Editing Data……
TO PASTE CELLS At first glance, pasting cells may seem simply a matter of copying the
cells you wish to paste, selecting the location where you wish to paste them, and then
clicking Edit Paste. This process is actually somewhat tricky, however, for two reasons:
(1) If you paste data into already existing cells, you will erase any data already in those
cells and (2) SPSS lets you paste data copied from one variable into another variable (this
can cause confusion if, for example, you copy data from the gender variable into the
marital variable).
TO SEARCH FOR DATA One of the handiest editing procedures is the Find function. A
click on the Edit command followed by a click on the Find option (or a click on the toolbar
icon) opens up a find & Replace screen that allows you to search for a particular word or
data value. This function is most frequently used for two different purposes:
• If you have a large file that includes names, you can quickly find a particular name that is
embedded within the file.
• If you discover errors in your data file, the search function can quickly find those errors
for correction.
Dr. Kiran Kumar Agrawal , Associate Professor
Exercise on data entry, data import, creating and saving a data file in SPSS.
➢ Set up the variables described in the DKA Data-1.XLSx file, using appropriate
variable names, variable labels, and variable values. Enter the data as given in excel
sheet.
➢ Create a new variable in this dataset named Education, with values of 1,2 and 3.
Create variable labels, where 1 is the 12th Std, 2 is the Under Graduate, and 3 is the
Post Graduate. Save your dataset.
➢ Set up the variables described in the grades.XLX file, using appropriate variable
names, variable labels, and variable values. Enter the data for the first 20 students
into the data file.
➢ Create a new variable in this dataset named school, with values of 1 and 2. Create
variable labels, where 1 is the name of a school you like, and 2 is the name of a
school you don’t like. Save your dataset with the name gradesme.sav.
➢ Using gradesme.sav, search for a student name “DENNIS”. What is his or her last
name, Year and Section?