Wolf Logo

SPSS TUTORIAL #1 - DESCRIPTIVE STATISTICS

Cleborne D. Maddux, Ph.D.
Professor

maddux@unr.edu

Department of Counseling and Educational Psychology

College of Education
The University of Nevada, Reno

SPSS Descriptive Run - Data from PICO Tutorial

You may want to print out this tutorial so you will have a printed copy in your hand while you work. The horizontal lines next to each number are there for you to check off each step if you choose.

You will recall that in the UNIX tutorial, you created a file called

sample1.dat

that contained some hypothetical data to practice with. You will now view that file, and then change it to the data we will use for this exercise:

_____ 1. At the FALLON prompt, type:

pico sample1.dat

and press ENTER. You will see the data we used in an earlier tutorial. If you did the PICO tutorial last, the file will be OK as is. If you did the UNIX tutorial last, the file will have the following data in it:

13263748376483849
99998745656474839
98282827465634728
A file made with PICO can contain whatever you choose

_____ 2. IF YOU DID THE UNIX TUTORIAL LAST and the file contains the above data, we need to change this data back to the data we used in the PICO tutorial. You will recall that in this hypothetical data, ten people took a test, five in an experimental group and five in a control group.

Here are the scores:

_____ 3. Here is what the file SHOULD look like. IF IT DOES NOT, use the arrow keys and the backspace key to erase this data. Then change the data in sample1.dat to the following:

185
190
182
175
199
270
266
252
271
250

_____ 4. Save the file with the same name (sample1.dat) by using CTRL-O or CTRL-X and pressing the ENTER key when the name of the file is displayed.

Here are some facts about the data you just entered:

  1. Each row represents a different person.
  2. The number in the first column for each person is either a one or a two.
  3. A 1 in the first column designates experimental group membership, while a 2 designates control group membership.
  4. The numbers in columns two and three are the scores.

For example:
Now the task is to write a file on FALLON that contains the commands to cause SPSS to calculate descriptive statistics on this data.

The SPSS Reference Guide covers the DESCRIPTIVES program beginning on page 122.

However, before even getting to this, we must include some commands that tell SPSS how our data file (SAMPLE1.DAT) is to be read.

Here is a very simple list of all the lines necessary in the file. After presenting these lines, we will:

1. discuss each line one by one, and
2. cover how to make and name the file containing these commands.

A later tutorial will cover how to run an SPSS program after the program file is named and saved in your FALLON account.

title "Descriptive run on sample1.dat file"
data list file = "sample1.dat"
     /group 1 score 2-3
variable labels
     group 'group membership of subjects'
     score 'Final Examination'
value labels
     group 1 'experimental' 2 'control'/
descriptives variables = all/
     statistics=all
finish

Look at the first line:

title "Descriptive run on sample1.dat file"

This is only for convenience of the reader. It gives a title to this run and it will be printed at the top of each page of any printout we get. This is important when you have huge stacks of printouts! Note that the word title is flush left and the actual title is enclosed in quotation marks.

Look at the second line:

data list file = "sample1.dat"

Every one of your spss program files must have a line like this. This is the line that tells SPSS the name of the file that has the data in it that you want to analyze. You will remember that in the PICO tutorial, this is the file we made that contains the test scores and group code as listed above. Note that this line is also entered flush left.

Look at the third line:

/group 1 score 2-3

Note that this line is indented five spaces and begins with a forward slash. This line, which can be many lines in length, lists two things:
1. the name of each variable, followed by
2. the column or columns in which data for this variable is to be found in the data file (sample1.dat).

So, this line indicates that the variable named "group" is to be found in column 1 and the variable called "score" is to be found in columns 2 to three.

Note that single spaces separate each variable name from the column or columns and that a single space is then left before the name of the next variable, and so on.

Do not use variable names longer than 8 characters.

Look at the fourth line:

variable labels

Note that this line is entered flush left. This is an optional line, but I strongly recommend that you use it. This line allows you to give a short description of each variable (up to 120 characters including spaces). This is often important because you are limited to 8 characters with no spaces for the length of the variable name. If you list variable labels, then the entire label will appear on your printout, making it much easier to read than a cryptic 8-character variable name.

Look at the fifth line:

group 'group membership of subjects'

Note that this and every other variable label must be indented five spaces. This line first lists the variable name you already assigned followed by the variable label enclosed in apostrophes. So this fifth line says for the group variable, assign the label "group membership of subjects." Now, "group membership of subjects" will be printed on your printout rather than simply the variable name "group."

Look at the sixth line:

score 'Final Examination'

Again indented five spaces, this line assigns the label "Final Examination" to the variable named "score."

Look at the seventh line:

value labels

This line is entered flush left and tells the SPSS program that you will be assigning labels to the values of some variables. What does this mean? One of our variables is called "group," and a value of 1 means "experimental group" while a value of 2 means "control group." This is an optional thing to do, but if we do not assign these labels to the values of 1 and 2, then only the numbers 1 and 2 will show up on a printout. Days, weeks, or months from now, we may very likely forget what 1 and 2 designates. Therefore, it is important to actually designate value labels for all categorical variables.

Look at the eighth line:

group 1 'experimental' 2 'control'/

This line is indented five spaces and it assigns value labels for the variable we named "group." If a 1 appears in that column, then the label "experimental" is assigned. If a 2 appears in that column, then the label "control" is assigned.

Note the syntax (separate with spaces):

1. List the variable name.
2. List the first value (number) to which you want to assign a label.
3. List the label enclosed in apostrophes.
4. List the next value of that variable to which you want to assign a label.
5. Continue until all possible values are identified. Then end with a forward slash. 6. If there are other categorical variables, begin again on the next line with a five-space indention.

Look at the ninth line:

descriptives variables = all/

Entered flush left, this is the command to run the SPSS descriptive program.

The "variables = all/" tells SPSS to calculate descriptive statistics on all the variables in the data file you have defined.If you do not want this done for all variables, you can list each one you want included with a space between each. Don't forget the forward slash after the word "all" (or after the list of variables).

Note the forward slash after the word "all."

Look at the tenth line:

statistics=all

Indented five spaces from the left, this tells SPSS to calculate all available statistics on each variable named on the variables = field explained above. These include MEAN, SEMEAN (standard error of the mean), STDDEV (standard deviation), VARIANCE, KURTOSIS, SKEWNESS, RANGE, MIN (minimum score), MAX (maximum score), and SUM.

Each of these can be requested in the statistics=all field by giving the abbreviation in the previous paragraph and separating all by a single blank space.

If no statistics= is included, the default statistics will be calculated for each variable. These include only MEAN, STDDEV, MIN AND MAX.

Look at the eleventh line:

finish

This is the last command in every program file. Note it is flush left.

Much more about the descriptives analysis can be found starting on page 122 of the SPSS manual.

Now you must create the file containing the above SPSS program. If you do not remember how to use PICO to create a FALLON file, review that tutorial. Briefly, here are directions:

_____1. Log on to FALLON.

_____2. At the FALLON prompt, type:

pico sample1.pr1

The name of the file is up to you, but since we named the file containing the data sample1.dat it would make sense to name the file containing the program sample1.pr1

_____3. PICO will open and you will see the file name at the top of the screen. Type in the program exactly as shown:

title "Descriptive run on sample1.dat file"
data list file = "sample1.dat"
     /group 1 score 2-3
variable labels
     group 'group membership of subjects'
     score 'Final Examination'
value labels
     group 1 'experimental' 2 'control'/
descriptives variables = all/
     statistics=all
finish

_____4. Be sure you have not made any typing errors. Save the file by holding down the CONTROL key while you hit the O key once. When shown the name of the file, press ENTER.

_____5. Hold down the CONTROL key while you hit the X key once to exit PICO.

_____6. You are now ready to run the program. Consult the tutorial on running an SPSS program on FALLON.

_____7. Obtain a printout of your program file. Put your name on the printout, label it SPSS TUTORIAL #1 - DESCRIPTIVES RUN and turn it in to me.

This concludes this tutorial.

Top of the page.

STATISTICS COURSES TAUGHT BY CLEB MADDUX PAGE.

CEP640 Page - Educational Measurements and Statistics

CEP740 Page - Advanced Educational Measurements and Statistics

Click here to go to the page for CEP741 - Applied Research Design and Analysis in Education I

 University of Nevada, Reno
Please direct questions to: maddux@unr.edu
URL of this document: http://unr.edu/homepage/maddux/stat/spssdesc.html