0% found this document useful (0 votes)
11 views14 pages

SPSS Software Overview and Data Management

This document presents the main features of the SPSS software, including its windows (data editor, output editor, syntax editor), its menus, and its tools (toolbar, status bar).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views14 pages

SPSS Software Overview and Data Management

This document presents the main features of the SPSS software, including its windows (data editor, output editor, syntax editor), its menus, and its tools (toolbar, status bar).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COURS SPSS-TRAVAUX PRATIQUE

I. Presentation of the SPSS software

1) Definition and Function of SPSS


SPSS: Statistical Package for the Social Sciences
Functions: Enter data, organize it, transform it, present it in a summarized form (tables,
graphics,...), analyze them (regression test calculations)
SPSS only executes commands, the choice of appropriate commands and interpretation.
the results are the responsibility of the operator

2) SPSS operation diagram

3) The Windows of SPSS


a)L ’Editeur de données/Data Editor :
It's1erawindow that appears at the beginning of each SPSS session. It allows for managing, creating, editing
manipulatethedataandthevariables;
The Data Editor file is recognizable by its icon and its extension '.SAV';
Ilsemainlyconsistsofatitlebar,afunctionmenu,andatoolbar.
of a matrix of data or information;
Ilse divides into two tabs or views by clicking in the lower left corner of the editor (Bar)
data view: the display of data, variable view: the display of variables.

The Data Editor:


Data view

1
Chaqueligne represents a case (observation). Ex: an individual or a respondent to a questionnaire;
The column headache represents a variable. Ex: a question from the questionnaire;
The cell (intersection of row and column) contains the value (response) of a variable (question)
foracase(individual);
In this view, the data can be numeric or alphanumeric;
The data grid is not dynamic (impossible to insert calculation formulas) nor (impossible
to insert calculation formulas) or relational (impossible links between cells)
Theorderofdata/variablescanbechanged
Possibility to copy, paste, or delete cells of cases or variables from the cell grid, cases.
orgridvariables.

The Data Editor:


Display of Variables/Variable view

The variable view provides a description of the characteristics of the grid variables;
The variables are found online;
The columns describe the characteristics of the variables.

Name Variable name (maximum 8 characters)


Typeofdataacceptedbythevariables(numbers,characters,date,etc…)
Type
Maximum number of characters allowed for the data to be entered
Width
Number of digits after the comma for numerical data
Decimals
Etiqueteexplainingthevariable
Etiquettes
Allowsdefiningvaluelabels(e.g.:0"female"1"male")
Values
Allowsdefiningthevaluesconsideredasmissing
Missing
Column width in the presentation of the variable
Columns
Position(left,center,right)ofthevariableinthecolumn
Aligner
Scale,ordinalornominal
Measure

2
b) The Results Publisher/Output

The results window receives all the results of the implemented commands: selection according to a
specificcriterion,statisticaltables,crosstables,resultsofamultipleregressionorananalysisof
data, etc. Any possible error messages also appear in this window. These files
[Link].
b) The Syntax Editor

The syntax window allows you to save or write executable programs on the variables.
orders are registered in this window in two ways. On one hand, following a selection of boxes of
dialogue, it is possible to "GLUE" the underlying syntax. On the other hand, a syntax window can
[Link]
at the same time. These files have the .sps extension

3
In summary, we have:

Types of
Extension Theassociatedwindows
Files
The data editor displays the content of the database.
File of can you create new databases or modify a database
*.SAV existing in the data editor. The lines of the data editor
data
corresponding to individuals, the columns each represent
variables of the study and the cells contain the values.
The syntax editor allows writing execution programs on the
Commands are entered in this window in two ways.
File of On one hand, following a selection of dialog boxes, it is possible
*.SPS
syntax from "COLLER" the underlying syntax. On the other hand, a window of
Syntax can be opened to include the commands to be executed.
Multiplesyntaxwindowscanbeopenedatthesametime.

Doherethe The results editor displays all the requested statistical results.
results *.SPO on the variables. The results can be recorded for a
future use and other result windows can be
simultaneously open

4) The SPSS menus


SPSSWindows offers the possibility of carrying out numerous operations and statistical analyses using
thedialogboxinterface.

SPSS menu bar

The "File" menu, in addition to the standard functions available in all Windows applications, allows you to display the

[Link],ithandlestheimport
theexportofdatafilesinthevariousformatsofferedbySPSSWindows(ASCII,DBASE,
EXCEL…)
The 'Edit' menu, like in all Windows applications, is dedicated to editorial operations.
(copy,paste,textordatasearch,[Link]
levelbydialogboxo' ptions':automaticopeningofanewsyntaxwindowuponlaunch
from SPSSWindows, default format for new variables and currency symbols, display order
variables in dialog boxes, calculation options, default appearance of graphs, format of
results(tableborders,etc.),sizeofresultpages,systemmessagesdisplayedinthewindow
of results.
The 'Data' menu is dedicated to the management and transformation of data files. Its options
allow,amongotherthings,tomergefiles,tosort,toweightandtoaggregatedata,tocreate

4
variables,defininglabels,selectingsubgroups,andseparatingafile.

The "Transformer" menu groups the options related to transformation and manipulation of
variables: recoding, transformation, and creation of variables from calculations, functions
mathematics and logical expressions based on existing variables, counting occurrences.
The "Analysis" menu includes the list of all available statistical analyses. They are indeed
[Link],figure4showsthepathtoperformananalysisof
variance by the menu.

The 'Graphs' menu controls the creation of all the charts offered by SPSS Windows.
(barcharts,curves,scatterplots,etc.).

The "Utilities" menu controls the display of the list of variables in the working file, of the choice between
thedisplayoflabelsorvaluesinthedatawindowandprintingofinformationonthe
active file in the results [Link] designation of windows and the definition of groups of
variables2are carried out at this level. An index containing a brief description of the language commands
SPSSisalsoavailable.
The content of the W
' indow' and H
' elp' menus is standard.

5) The button bar and the status bar


SPSS Windows has a toolbar whose buttons serve as shortcuts for operations.
[Link],thestatusbardisplaysinformationabouttheactivefile.

Button bar with the following appearance:

The status bar displays information about the following ongoing operations and has the following appearance:

The current state of the processor is displayed. If a command is running, the processor indicates
hisnameandtheobservationnumberbeingprocessed.
By
example
hte:
The status of the filter if a selection has been made.
The weighting when the data is weighted by a variable.
The division of a file into subgroups according to a criterion.

5
II. Data file management
Transformation of a data file
The data and variables of a data file often need to be transformed to be suitable.
tocertainsituationsoranalyticalissues;

Transformations can take multiple forms (insertion, recoding, merging, restrictions, specifications,
…) ;

Transformations can be performed using the command procedure from the syntax page or from
the interactive method with the T
' ransform' or D
' ata' menus.

a) Creation of a variable by insertion

Display the 'Variable View' window of the data editor


Select (by clicking) the variable or the row that should follow the new variable to be created
ClickonE
' dit'thenI'nsertavariable'
A variable line is thus created.
Define the characteristics of the new variable

The section I'nsert variables' from the context menu (right-clicking from the order number)
of a variable) also allows you to insert a new variable above the one on which the right-click was made
carried out
The insertion of a variable can also be done vertically from the "Data Display" window of
the data editor.

b) Creation of a new variable from a variable


existing
Itispossibletocreatenewvariablesfromexistingvariablesusingthe'Calculate'sections.
Count or Recodify from the Transform menu.

It is also possible to create a new variable from the syntax

Open or create a syntax page


•Structure of the syntax command:
Command name 'Compute'
Name of the new variable
Equal sign ( = )
Mother variable name
.
Execution instruction 'Execute'
.
Example of writing an order:
Compute v2 = v1.
Execute.

6
After writing the command, select it and execute it.

Define the characteristics of the new variable.

To create a variable from existing variables, arithmetic operations ( + ,


- , * , / ) or other functions written in SPSS can be used

Example of a use case for arithmetic operations or functions:


Let v1 be in the file: Current age of respondents
Either v2 in the file: Duration of marriage of the respondents
Create the variable v3: Age of respondents at the time of marriage

Example of writing a command for using arithmetic operations or


functions:
Compute v3 = v1 - v2.
Execute.
c) Change of variable name
d) Change of position of a variable
e) Suppression of a variable
f) Procedure for inserting an observation
g) Change of position of an observation
h) Deletion of an observation
i) Labeling of a variable and values
Labeling a variable means assigning a label (explicit name) to that variable;
Labeling the values of a variable means assigning a label to the modalities of this variable.
variable.
Two methods to know: the interactive method and the syntax method
Exampel:
Variable labels Level of education
Execute.

value labels v1 0 "Aucune instruction" 1 "Primaire" 2 "Secondaire" 3 "Supérieur".


Execute.
j) Recoding the modalities of a variable
To recode a variable is to modify the way the values and modalities are recorded.
It is an operation to assign new codes to the methods or to group them.
distinct categories
Recoding addresses a concern of changing the structure of a variable to meet certain requirements.
analyze or address a given problem (plethora of modalities, low numbers, ...).
Onecanrecodeavariablebycreatinganewvariableorbymodifyingthevariableitself.
recode v1 (0=1) (1=2) (2=2) (3=2).
Execute.
recode v1 (0=1) (1=2) (2=2) (3=2) INTO v1rec.
Execute.

7
2) The restructuring of files
Forspecificanalysisneeds,itissometimesnecessarytoreorganizeorrestructurethedataofoneor
several files in order to obtain a configuration suited to the objectives to be achieved. For this, it is often
necessary to:

Filter observations
Select the observations
Fragment or split files
Weighing files
Just like for data transformation, precautions must be taken during the
data file restructuring:
After correcting errors in a file, be sure to always keep a copy of the raw data.
– Carry out the restructuring on a working file (copy) and the original file.

a) Sorting observations from a file


Sorting is a function that allows In the menu, sorting is obtained from the 'Data' menu
to arrange (in ascending order or inthesection"Sorttheobservations"thatprovidesthebox
decreasing) a data grid
according to one or more sorting variables. ofthefollowingdialogue:
It is thus possible to observe
how is made up of sub-
groups of the file chosen based on
certain variables. The structure of
syntax for sorting a file according to a
variable is:
– Command name 'SORT CASES BY'
– Variable name (e.g. v1, age, region)
– Specification of the sorting order 'A' for
Croissant "D" for Decreasing
– Point ( . )
•Examples of sorting writing:
SORT CASES BY v024 (A).

SORT CASES BY v024 (D).

After writing the order, the


select and execute it

b) Selection of observations from a file


The selection is a function that restricts the data file to a subgroup of cases.
Only the cases meeting the condition in the order are retained for analysis.
subsequent.
In the menu, the selection of observations is made from the 'Data' menu in the section '
Select 'Observations' which brings up the following dialog:
d) Selection of variables from a file
The procedure 'Define variable groups' allows you to create a preferred list of variables to be done.
appearinthedialogboxesfortransformationandanalysisoperations.
In the menu, the selection of variables is done from the 'Tools' menu under the 'Define groups' section.
»[Link].
fromthesectionU
' singgroups.'

e) Fragmenter un fichier de données


Fragmenting a data file allows you to split In the menu, the fragmentation of a file
this file into several groups, based on the values data is done from the 'Data' menu
of one or more grouping variables. That is to say in the section "Split a file".
that can be analyzed separately from sub-groups of The "Compare groups" option provides a
[Link],themiddleof common table for the sub-groups and
résidence (Urbain 1, urbain 2) le sexe (Homme 1, Femme l'option «séparer les résultats par groupes
2),lareligion(Chrétienne1,Musulmane2,Autre3) "give separate tables for the sub-"
groups.
Ifyouselectmultiplegroupingvariables,the If fragmentation is enabled, SPSS
observations are grouped for each variable within enter information (separate file
of the terms of the previous variable in the list of active) in the taskbar, in the
coin bottom right.
grouping variables.

9
f) Weighting of a data file
Weighting is an operation to rebalance the In the menu, the weighting of a data file
data file samples obtained from made from the "Data" menu in the section
data collection based on a survey. Weight the observations.
The syntax structure of weighting a file
est:
Command name "WEIGHT BY"
–Nom de la variable –Point ( . )
•Examples of weighting writing:
WEIGHT BY v005.
If weighting is enabled, SPSS records a
information (Weighted activated) in the bar of
tasks, in the bottom right corner.

g) Merging of files

The data or variables to be processed or analyzed are often spread across different files.
Need to combine them into a single file

⇒ Filemerging
There are two ways to merge files:
Mergingobservations(mergingnon-parallelfiles):thevariablesofthefilesarethesame,
but the observations (cases, individuals) are different
Merging variables (merging parallel files): the observations are identical, but
the variables are different
The file in which observations or variables are imported is called the 'Main File'.
The file from which observations or variables are imported is called 'File of
consultation
Merging files requires that the variables or observations are ordered in the same way.
in the different files

Merging observations from two files


Prérequis :Deux bases de données (Base01 et Base02)
The same variables in both databases (Base01: 15 Variables and Base02: 15 Variables)
Different observations in the two databases (Base01: 150 cases and Base02: 45 cases)

The merger plan is as follows:

Openthetwofilesandcheckthatthenumber,names,order,andparameters(type,length,…)ofthe
variables are similar
Then open the main file alone

Select the 'Merge files' options Add observations from the 'Data' menu

10
In the dialog box that appears, open the consultation file.

Another dialog box for case merging appears


Check the contents of the box and validate if it's okay.
Save the main file under a different name
This new file now contains the cumulative observations from the main file and the file of
consultation (195 for the example) for the same number of variables (15 for the example)

Merging variables from two files


Prérequis :Deux bases de données (Base01 et Base02)
Variables différentes dans les deux bases (Base01 :10Variables et Base02 :5Variables)
The same observations in both databases (Base01: 150 cases and Base02: 150 cases)

The merger scheme is as follows:

Openbothfilesandcheckthattheyhaveacommonvariablethatwilserveasamatchingkey.
Sort the two files according to the matching key in the same order - Save and
Close.
Then open the main file alone

Select the options "Merge the files" Add variables from the 'Data' menu

In the dialog box that appears, open the consultation file.

Another dialog box for the merging of variables appears

Check the content of the excluded variables and the variables of the new working file.
Excluded variables: list of variables from the consultation file that are already in the main file.

• "New working file" cumulative list of variables from the main file and the consultation file

Check the box for matching observations and select the matching option

Choose the pairing key from the "Excluded variables" and bring it into the key matching window
thankstothearrow

Validate the process with "Ok"

11
A verification message that the two files are sorted in the same order based on the key
matching appears

If the sorting has not been done, toresume


click ontheprocessbysorting
'Cancel'

If the sorting had been done, SPSS proceeds to merge the variables from the two files.

The variables from the consultation file appear below those of the main file.
Save the main file under a different name
This new file now contains the cumulative variables from the main file and the file of
consultation (15 for the example) for the same number of observations (150 for the example).
Note:
The consultation tables
A consultation table is a file whose observations can be applied to several.
observationsfromanotherfile:forexample,afilewithhousehold-levelinformation
is a consultation table that can be merged with a file containing data on the
[Link]
' erge'option
unzip according to the variables in the 'Data' menu. At the level of the dialog box (figure 8), it is enough
toindicatethattheexternal(orworking)fileisaconsultationtable.

h) Aggregation of data from a file


Aggregation is an operation that allows assigning the values of a given observation (case) to
other observations belonging to the same subgroup.
Examples:
Assign the standard of living of a household to all members of the household
Assign the sex of the head of household to all members of the household.
Assign the total number of children of a certain age from each household to all members of the
household
According to the aggregation cases, the operator must look for the variables, the right combination of formulas and
steps to achieve the expected results.

12
Data aggregation is done from the 'Data' menu in the 'Aggregate' section.
This section allows you to obtain the following windows:

Example: the average age by marital status

i) Procedure for reading a file in text format


The transfer under SPSS of text file format (*.txt) is done with the help of the text format reading wizard.
This assistant is activated by the "Read text data..." section of the "File" menu, after selecting
the text file to be transferred

Italowsthetransferoftextfilesinvariousformats:
Tab-delimited file
Space-delimited file
Comma delimited file
• File delimited by a predefined character
Fixed field file
The transfer of text format files is done in six steps corresponding to operation windows and
options to specify.

3) Handling of missing values


The reasons that can lead to the occurrence of missing values in the database are diverse.
The data entry operator can skip variables that are well filled in. Some variables may also not
to be informed about the questionnaire and remained undetected by both field staff and
the data entry operator. Some questionnaires may contain missing data, either because the
the person questioned did not answer the question, either because the investigator did not ask the question or
forgottoreporttheanswer.
Missing data replacements are done using several methods. There are methods
standard imputation proposed by SPSS (mean of the series, mean of neighboring points,
median of neighboring points, linear interpolation, and linear trend at the point). It is up to the user
toshowimaginationinrefiningallocationsbyusingcombinations(spliting

13
fromthefile,sortingobservationsaccordingtocriteria.

14

You might also like