spss instruction chapter 2 - moravian...

13
SPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables, crosstabulations, bar graphs and pie charts does not pose much difficulty with small sample sizes and minimal variables. However, in most cases, researchers have too much data to organize without the help of a statistical software program such as SPSS. Preparing Data in SPSS Obviously, before performing any sort of analysis in SPSS, the researcher must input his or her data into the Data View screen and enter relevant information into the Variable View screen as described in Chapter 1. Having done so, analyses can begin. An option in SPSS worthy of specific mention in the context of measurements of frequency is the “recode” function, which can separate values from a continuous variable into artificially-created categories. One would, thus, use this function to establish the salary categories used in Example 2.2 from the originally continuous salary data. Recoding data in SPSS requires the following steps. 1. Select Transform from the options as the top of the Data View screen or the Variable View screen. A pull-down menu should appear. 2. From the pull-down menu, select either “Recode into Same Variables” or “Recode into Different Variables.” The first of these options replaces the existing continuous values with codes for the user-defined categories. The second option generates a new variable that displays codes for the user-defined categories, leaving the raw data in tact. A small window, identified by the choice of recoding into the same or different variables, should appear. 3. An untitled box in the Recode into Same Variables or the Recode into Different Variables window contains the names of all variables for which data exists in the file. Indicate the variable to recode by clicking on its name and then clicking on the arrow to the right of the box. The name of the variable should disappear from its original location. a. If recoding into the same variable, the name of the variable should appear in the box labeled “Numeric Variables”.

Upload: others

Post on 28-Mar-2020

18 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

SPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables, crosstabulations, bar graphs and pie

charts does not pose much difficulty with small sample sizes and minimal variables.

However, in most cases, researchers have too much data to organize without the help of a

statistical software program such as SPSS.

Preparing Data in SPSS Obviously, before performing any sort of analysis in SPSS, the researcher must input his or

her data into the Data View screen and enter relevant information into the Variable View

screen as described in Chapter 1. Having done so, analyses can begin.

An option in SPSS worthy of specific mention in the context of measurements of frequency

is the “recode” function, which can separate values from a continuous variable into

artificially-created categories. One would, thus, use this function to establish the salary

categories used in Example 2.2 from the originally continuous salary data. Recoding data in

SPSS requires the following steps.

1. Select Transform from the options as the top of the Data View screen or the Variable

View screen. A pull-down menu should appear.

2. From the pull-down menu, select either “Recode into Same Variables” or “Recode

into Different Variables.” The first of these options replaces the existing continuous

values with codes for the user-defined categories. The second option generates a

new variable that displays codes for the user-defined categories, leaving the raw

data in tact. A small window, identified by the choice of recoding into the same or

different variables, should appear.

3. An untitled box in the Recode into Same Variables or the Recode into Different

Variables window contains the names of all variables for which data exists in the file.

Indicate the variable to recode by clicking on its name and then clicking on the

arrow to the right of the box. The name of the variable should disappear from its

original location.

a. If recoding into the same variable, the name of the variable should appear in the

box labeled “Numeric Variables”.

Page 2: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

FIGURE 2.11 – SPSS RECODE INTO SAME VARIABLES WINDOW

The placement of “VAR00002” in the Numeric Variables box indicates the researchers’ desire to recode its

values. The “Old and New Values” button allows the researcher to define the new categories. The codes for the

will replace the original variable’s values on the SPSS Data View page.

(1) Click on the “old and new values” button below this box, to define the ranges

for each category of data. In the box that appears, specify each range of raw

values for each category on the left and then, on the right, assign a code to

that category, clicking “add” after entering each code.

(2) Upon competing the recoding process, click “Continue” to return to the

Recode into Same Variable window.

(3) Click “OK.” The newly-created variable should appear on the Data View page

in place of the previously-existing variable.

b. If recoding into different variables, the name of the variable, followed by a

prompt for the user to supply a name for the newly-defined variable, appears in

the box labeled “Numeric Variable --> Output Variable.”

FIGURE 2.12 – SPSS RECODE INTO DIFFERENT VARIABLES WINDOW

Page 3: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

The placement of “VAR00002” in the Numeric Variables box indicates the researchers’ desire to recode its

values. The “Old and New Values” button allows the researcher to define the new categories. The codes for the

new categories will appear in a new column on the SPSS Data View page.

(1)To the right of the Numeric Variable -> Output Variable box, the user must

supply a name for the newly-created variable.

(2) Click on the “old and new values” button below this box to define the ranges

for each category of data. In the box that appears, specify each range of raw

values for each category on the left and then, on the right, assign a code to

that category, clicking “add” after entering each code.

(3) Upon competing the recoding process, click “Continue” to return to the

Recode into Different Variable window.

(4) Click “Change.” The newly-created variable should appear on the Data View

page in the column farthest to the right on the page.

4. Enter the coding scheme for the newly-defined variable in the “values” window on

the Variable View screen.

After organizing data, the user instructs SPSS to perform the desired statistical calculations

or create the desired table, graph, or chart. This resulting information appears on an output

screen for which SPSS generates a separate file from the data file. Thus, one who wishes to

save his or her output must remember to save both the data file, which generally has a .dat

extension, and the output file, which generally had an .spo extension.

Frequency Tables in SPSS SPSS can create tables displaying category names, frequencies, and percentages. To do so,

the user must have entered the raw data into a column on the Data View screen and

recoded if necessary. For coded variables, coding scheme should exist in the “values”

window on the Variable View screen. Failure to enter the coding scheme results in output

that contains numerical codes rather than category names.

With data in place, the following steps instruct SPSS to create a frequency table.

1. Select Analyze from the options at the top of the Data View screen or the Variable

View screen. A pull-down menu should appear.

2. From the pull-down menu, select “Descriptive Statistics.” A small window should

appear to the right of the selection.

3. Select “Frequencies” from the options in the window. A new window, entitled

Frequencies should appear.

Page 4: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

FIGURE 2.13 – SPSS FREQUENCIES WINDOW

The user creates frequency tables by selecting appropriate variables from those listed in the window above.

The “statistics,” “charts,” and “format” buttons provide options regarding the information included in the

table and alternative forms of presenting the data.

4. An untitled box in the Frequencies window contains the names of all variables for

which data exists in the file. Indicate the variable for which to create the frequency

table by clicking on its name and then clicking the arrow to the right of the box. The

name of the variable should disappear from its original location and appear in the

box labeled “Variable(s).” To create frequency tables for multiple variables, use the

same procedure with other variable names.

5. Click “OK.”

The output contains a small chart, entitled, “Statistics” as well as one frequency table for

each variable placed into the “Variable(s)” box in the Frequencies” window. The statistics

chart states the number of subjects who contributed data and the number with missing

data for the analysis. Along with the frequencies, themselves, the frequency tables contain

three percent values. The percent, itself, refers to the proportion all subjects who fall into

a particular category. However, researchers generally have the most interest in the other

two percentage values. The valid percent considers only the subjects who supplied data

for the relevant variable in determining the proportion of subjects within each category.

The cumulative percent, expresses an ongoing sum of the valid percents.

Example 2.23 – Frequency Table in SPSS

All of these values appear in the following output. The first frequency table uses the

categorical circus act data. The second table uses the artificially categorized salary groups.

Statistics

Act salary

Page 5: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

N Valid 40 40

Missing 0 0

act

Frequency Percent Valid Percent Cumulative

Percent

Valid Stunt 6 15.0 15.0 15.0

Clown 9 22.5 22.5 37.5

acrobatics/strength 9 22.5 22.5 60.0

Animal 5 12.5 12.5 72.5

Sideshow 9 22.5 22.5 95.0

Other 2 5.0 5.0 100.0

Total 40 100.0 100.0

TABLE 2.19, TABLE 2.20, AND TABLE 2.21 – SPSS FREQUENCY TABLE Frequency table output always includes a Statistics summary table (Table 2.19), indicating the number of values included in the analysis and the number of missing values. Table 2.20 and Table 2.21 appear as a result of the user requesting frequency tables for “act” and “salaries”. The category names, appearing in the leftmost column of these tables use the terms entered into the “values” box on the Variable View screen.

Because of the arbitrary order of the categories in Table 2.20, pertaining to circus act, the

values in the cumulative percent column have little importance. However, the ascending

order of categories Table 2.21, pertaining to salaries, makes the cumulative percents

noteworthy. Using the cumulative percent column, one can easily determine the percent of

subjects who earn less than those in a particular salary category and, by simply subtracting

that value from 100%, the percent of subject who earn more than those in that category. ▄

Crosstabulations in SPSS Crosstabulations, essentially, divide values from a frequency table according to a second

variable. Not surprisingly, then, the process of creating a crosstabulation in SPSS begins

with the same steps as does the process of creating a frequency table. The crosstabulation

is created with the following steps.

salaries

3 7.5 7.5 7.5

10 25.0 25.0 32.5

14 35.0 35.0 67.5

12 30.0 30.0 97.5

1 2.5 2.5 100.0

40 100.0 100.0

$300-$449

$450-$599

$600-$749

$750-$899

900-$1049

Total

Valid

Frequency Percent Valid Percent

Cumulat iv e

Percent

Page 6: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

1. Select Analyze from the options at the top of the Data View screen or the Variable

View screen. A pull-down menu should appear.

2. From the pull-down menu, select “Descriptive Statistics.” A small window should

appear to the right of the selection.

3. Select “Crosstabs” from the options in the window. A new window, entitled

Crosstabs should appear.

FIGURE 2.14 – SPSS CROSSTABULATIONS WINDOW

The user creates a crosstabulation by selecting appropriate variables from those listed in the box above. The

“statistics,” “cells,” and “format” buttons provide options regarding the information included in the

crosstabulation and alternative forms of presenting the data.

4. An untitled box in the Crosstabs window contains the names of all variables in the

file. Indicate the variable for which the categories should appear as rows in the

crosstabulation by clicking on its name and then clicking on the arrow to the left of

the box marked “Rows". The comparable procedure indicates the variable for which

categories should appear as columns. Use the “Layers” option for analyses with

more than two variables. For each variable identified and moved, the name of the

variable disappears from its original location and appears in the appropriate box.

5. To include percentages along with frequencies in the crosstabulation, click the

“cells” button at the bottom of the Crosstabs window. The Cell Display window that

appears includes a box in which the user can indicate whether he or she desires

row, column, and total percentages.

6. Click “OK.”

Page 7: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

If the user designates variables only into the row and column boxes, SPSS produces a

relatively uncomplicated two-variable crosstabulation. By default, each cell contains the

frequency for the appropriate combination of categories. Cells do not contain percents

unless the user requests these values. (See Step 5 in the preceding directions.)

Example 2.24 – Basic Crosstabulation in SPSS

Instructing SPSS to create a crosstabulation based upon circus performers’ acts and sexes,

including row, column, and total percentages, results in the following table.

sex * act Crosstabulation

Act

Total stunt Clown acrobatics/

strength animal sideshow other

sex Male Count 2 4 5 3 5 1 20

% within sex 10.0% 20.0% 25.0% 15.0% 25.0% 5.0% 100.0%

% within act 33.3% 44.4% 55.6% 60.0% 55.6% 50.0% 50.0%

% of Total 5.0% 10.0% 12.5% 7.5% 12.5% 2.5% 50.0%

female Count 4 5 4 2 4 1 20

% within sex 20.0% 25.0% 20.0% 10.0% 20.0% 5.0% 100.0%

% within act 66.7% 55.6% 44.4% 40.0% 44.4% 50.0% 50.0%

% of Total 10.0% 12.5% 10.0% 5.0% 10.0% 2.5% 50.0%

Total Count 6 9 9 5 9 2 40

% within sex 15.0% 22.5% 22.5% 12.5% 22.5% 5.0% 100.0%

% within act 100.0% 100.0% 100.0% 100.0% 100.0% 100.0% 100.0%

% of Total 15.0% 22.5% 22.5% 12.5% 22.5% 5.0% 100.0%

TABLE 2.22 – SPSS TWO-VARIABLE CROSSTABULATION

Each cell contains four values. The first value provides the frequency for the cell. The second value, refers to

the particular cell’s percentage within that row (sex). The third value refers to the particular cell’s percentage

within that column (act). The last value refers to that particular cell’s percentage within the entire sample.

Table 2.22 displays SPSS’s version of Table 2.7. Of course, without the instruction to

include percents within the cells, the crosstabulation would appear much less cumbersome

than Table 2.22 does, looking similar to table 2.3. ▄

When the user enters a variable name into the “layers” box in the Crosstabs window, SPSS

automatically nests rows of the crosstabulation within the layers. Once again, each cell

contains the frequency for the appropriate combination of categories unless the user the

user requests percentages.

Example 2.25 – Nested Crosstabulation in SPSS

Page 8: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

The following nested crosstabulation below utilizes the same variables as and, accordingly,

has a similar appearance to Table 2.10. As with Table 2.10, for the sake of simplicity, the

table contains only frequencies. Interestingly, though, unlike Table 2.10, the

crosstabulation created by SPSS does not display rows or columns that consistently have a

frequency of 0. Thus, no row appears for the income category of $900-$1049 in the male

layer of the following table. salaries * act * sex Crosstabulation

Sex Act Total

stunt clown acrobatics/

strength animal sideshow other stunt

Male salaries $300-$449 0 0 0 0 1 0 1

$450-$599 0 0 1 0 3 1 5

$600-$749 0 4 2 2 0 0 8

$750-$899 2 0 2 1 1 0 6

Total 2 4 5 3 5 1 20

Female salaries $300-$449 0 1 0 0 1 0 2

$450-$599 0 2 0 0 3 0 5

$600-$749 2 2 2 0 0 0 6

$750-$899 2 0 2 2 0 0 6

900-$1049 0 0 0 0 0 1 1

Total 4 5 4 2 4 1 20

TABLE 2.23 – SPSS NESTED CROSSTABULATION

Categories of “male” and “female” appear as nested elements within each weekly salary category in the rows

of the crosstabulation. Marginal values for each act category appear at the end of the respective column.

Adding the values at the end of all rows marked “female” or “male” produces the marginal values for the

respective sex category. ▄

Graphs and Charts in SPSS The most obvious method of creating graphs and charts in SPSS uses the Graphs option at

the top of the Data View and Variable View pages. Choosing this option produces a pull-

down menu containing the names of most graphs and charts available in the program.

However, other methods can create the same illustrations. The process of creating the

appropriate illustration varies based upon the graph or chart selected.

One who wishes to create bar graphs and pie charts might notice that the Frequencies

window provides users the option of including these illustrations with frequency table

output. Doing so, the user need only click on the “charts” button located at the bottom of

the page, then select the desired illustration and indicating whether it should display

frequencies or percentages. This process, however, can only produce basic graphs and

charts. One who wishes to produce nested or stacked illustrations should use the Graphs

option described. To maintain consistency all directions for creating graphs provided in

Page 9: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

this chapter involve the use of the Graphs option. The bar graphs and pie charts already

provided in this chapter were created using this method.

Bar Graphs Clicking on the Graphs option brings the names of three method of creating the graph to

the screen. Although all of these methods eventually produce similar illustrations, some

methods involve fewer steps than others do depending upon the particular graph desired.

The last of the methods listed, “Legacy Dialogues” generally proves the simplest method of

creating bar graphs. Beginning with the selection of this method, then, the following steps

describe the process of creating a basic (one-variable) bar graph.

1. From the pull-down menu under the Graphs option at the top of the Data View or

Variable View screen, select “Legacy Dialogues.” A listing of graphs and charts

available through this method should appear.

2. Select “Bar.” A window entitled Bar Charts should appear. The Bar Charts window,

by default, identifies a simple bar graph as the desired illustration and summaries

for groups of cases as the data in the chart.

3. Click “Define.” A new window, entitled. Define Simple Bar: Summaries for Groups of

Cases should appear.

FIGURE 2.15 – SPSS SIMPLE BAR GRAPH WINDOW

Page 10: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

The user creates one-variable bar graph by selecting the appropriate variable from those listed in the box

above. The designation in the “Bars Represent” portion of the window identifies the comparison factor used

for the graph.

4. An untitled box in the Summaries for Groups of Cases window contains the names of

all variables for which data exists in the file. Indicate the variable for which to

create the bar graph by clicking on its name and then clicking on the arrow to the

left of the box marked “Category Axis".

5. Click “OK.”

Example 2.26 – Bar Graph in SPSS

As mentioned, earlier portions of this chapter contain examples of SPSS-generated graphs

and charts. Basic bar graphs pertaining to the variable of circus act and salary category

appear as Figure 2.1 and Figure 2.2, respectively. ▄

Creating clustered and stacked bar graphs, require only small adjustments to the process

for creating the basic bar graph. A description of the process for doing so follows.

1. From the pull-down menu under the option at the top of the Data View or Variable

View screen, select “Legacy Dialogues.” A listing of graphs and charts available

through this method should appear.

2. Select “Bar.” A window entitled Bar Charts should appear.

3. Change the default selection of “simple” in the Bar Charts window to “clustered” or

“stacked.” Do not adjust the selection for data in the chart.

4. Click “Define.” A new window, entitled. Define Clustered Bar: Summaries for Groups

of Cases or Define Stacked Bar: Summaries for Groups of Cases should appear.

Page 11: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

FIGURE 2.16 – SPSS CLUSTERED BAR GRAPH WINDOW

The user creates clustered bar graph by selecting the appropriate variable from those listed in the box above.

The designation in the “Bars Represent” portion of the window identifies the comparison factor used for the

graph. The comparable box for a stacked bar graph appears identical to this one with the exception of the

request to define stacks rather than to define clusters.

5. An untitled box in the Summaries for Groups of Cases window contains the names of

all variables for which data exists in the file.

a. Indicate the variable for which frequencies should appear as bars graph by

clicking on its name and then clicking on the arrow to the left of the box marked

“Category Axis".

b. Indicate the variable by which to separate the data by clicking on its name and

then clicking on the arrow to the left of the box marked, “Define Clusters by” or

“Define Stacks by.”

6. Click “OK.”

Example 2.27 – Clustered and Stacked Bar Graphs in SPSS

In the case of the circus data, circus act determines the category axis and sex serves as the

variable by which to define the clusters or stacks. Ordinarily SPSS distinguishes between

Page 12: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

clusters by using different colors. However, Figure 2.3 and 2.4 utilize patterns rather than

colors to visually exaggerate the distinction. ▄

Pie Charts Creation of a pie chart begins the same way as creating a bar graph does, by selecting the

“Legacy Dialogues” option from the SPSS’s Graphs menu. Steps for creating a basic (one-

variable) follow.

1. From the pull-down menu under the Graphs option at the top of the Data View or

Variable View screen, select “Graphs.” A listing of graphs and charts available

through this method should appear.

2. Select “Pie.” A small window, asking the user to describe the data points appears.

3. Select ”Summaries for Groups of Cases” and click Define. A window, entitled Define

Pie: Summaries for Groups of Cases, should appear.

FIGURE 2.17 – SPSS DEFINE PIE: SUMMARIES OF GROUPS OF CASES WINDOW

The user creates one-variable pie chart by selecting the appropriate variable from those listed in the box

above. Clicking on the “pies,” “titles,” and “options” tabs allows for modifications to the chart’s appearance.

Page 13: SPSS INSTRUCTION CHAPTER 2 - Moravian Collegehome.moravian.edu/users/soc/medwh02/0_DATA/ch2/ch2in.pdfSPSS INSTRUCTION – CHAPTER 2 Using paper and pencil to draw frequency tables,

4. An untitled box in the Define Pie: Summaries for Groups of Cases window contains the

names of all variables for which data exists in the file. Indicate the variable for

which to create the pie chart dragging its name to the box marked “Define Slices

by".

5. Click “OK.”

Example 2.28 – Basic Pie Chart in SPSS

Figure 2.5 in this chapter contains the pie chart created using the preceding steps and

based upon the variable of circus act. Ordinarily SPSS distinguishes between pie slices by

using different colors. However, Figure 2.5 utilizes patterns rather than colors to visually

exaggerate the distinction. ▄

To create a paneled pie chart, you also use the Define Pie: Summaries for Groups of Cases

window. In addition to moving a variable name to the “Define Slices by” box, you must

identify the categorical variable that serves as a basis for the panels. You should move the

name of this variable to either the “Rows” or the “Columns” box in the “Panel by” portion of

the window. If you use the “Rows” box, SPSS will arrange the pie charts vertically in its

output. If you use the “Columns” box, the pie charts will appear horizontally in the SPSS

output.

Example 2.29 – Paneled Pie Chart in SPSS

Defining slices of the pie chart by circus act and paneling the data according to sex

produces Figure 2.6 in this chapter. As in the basic pie chart, SPSS, unless directed

otherwise, distinguishes between pie slices by using different colors. The patterns used in

Figure 2.6 merely serve to visually exaggerate this distinction. ▄