Invoking PSPPIRE
****************

This chapter describes the graphical user interface.

Primary Windows
===============

The PSPP graphical user interface provides a set of windows through which you store, edit and analyze data. You can choose to perform tasks and operations through interactive drop down menus in the data editor window or through command line statements in the syntax editor. The three primary windows include the Data Editor, Syntax Editor, and the Output Viewer.

Data Editor Central to PSPP, launches when you start a session. Similar in organization to a spreadsheet with rows and columns of data cells, this is where the data is stored, operated on, and edited.

Figure: Data editor window

Output Viewer Displays executed instructions as well as results of statistical analyses including, text, tables, and charts.

Note: this window is not visible upon start up and only pops open after the first instruction set is executed.

Syntax Editor Enter command line instructions to edit, import and analyze data. This has the advantage of enabling batch processing and code reuse.

Launch the syntax editor from within the data editor by selecting File -> Open -> Syntax.

Figure: Syntax editor window

Data Editor
===========

There are two alternate views: data view and variable view. Data view shows the numerical value held by each datum while the other displays the metadictionary data of each variable. Toggle between views by clicking on the Data View or Variable View tab at the bottom left hand corner of the window.

Figure: Data editor window

Data View
---------

PSPP lists variables in columns and cases in rows, e.g., in the hotel customer satisfaction survey (see fig:pic4) each row represents the set of answers given by each respondent and each column a question.

Figure: Data view

Variable View
-------------

Display variable attributes associated with each case, where variable attributes (see Attributes) include name, type, width, decimal, variable label, value label, missing values, columns, align, and measurement.

Figure: Variable view

Data Entry and Editing
----------------------

There are several functions available in the data editor for entering, editing and sorting data.

Edit Variable Attributes
........................

Edit variable attributes such as Name, Type, Width, Decimals, Label, and Values, Missing, Columns, Align, and Measure in variable view.

Name

Click a cell in the Name column.

Type a new name in the cell.

Press the enter key.

Figure: Edit name in variable view.

Type

Click a cell in the Type column.

Click on the grey box that appears to bring up a Variable Type dialogue box.

Choose a variable type (see Basic Numeric Formats) from the list: Numeric, Comma, Dot, Scientific Notation, Date, Dollar, Custom Currency, and String.

Enter the width and/or number of decimal places, if relevant.

Press OK.

Figure: Edit type in variable view.

Width

Click a cell in the Width(see Attributes) column.

Select the up-down arrow that appears in the cell to alter the value.

Figure: Edit width in variable view.

Decimals

Click a cell in the Decimals(see Attributes) column.

Select the up-down arrow that appears inside the cell to alter the value.

Figure: Edit decimals in variable view.

Label

Click a cell in the Label column.

Type a variable label in the cell.

Press enter.

Figure: Edit label in variable view.

Values

Click a cell in the Values(see Attributes) column.

Click the gray box that appears inside the cell to bring up the Value Labels dialogue box.

Enter the Value label.

Click the Add button.

Repeat to add other labels, if necessary.

Press OK.

Figure: Edit values in variable view.

Missing

Select a cell in the Missing column.

Click the gray box that appears inside the cell to bring up the Missing Values dialogue box.

Enter either up to three discrete missing values or specify a numerical range plus one discrete value. see Attributes for further information.

Columns

Select a cell in the Columns (see Attributes) column.

Click the up-down arrows that appears inside the cell to alter the value.

Figure: Edit columns in variable view.

Align

Align values left, right or center in a cell

Click a cell in the Align column.

Select left, right, or center from the drop down menu that appears.

Figure: Edit align in variable view.

Measure

Select a cell in the column Measure (see Attributes).

Select either nominal, ordinal, or scale from the drop down menu.

Figure: Edit measure in variable view.

New Variable
............

Enter a new variable by selecting insert variable from the edit drop down menu or tool bar. This function inserts a new variable with a generic name. In addition, if you already have at least one variable defined, then you can add a new variable to the left of the current column by right clicking on the variables title and selecting insert variable from the pop-up menu.

Figure: Insert new variable

New Case
........

There are a few ways to add a new case to an existing variable:

 1. Select Edit -> Insert Case from the drop down menu.

 2. Select Insert Cases from the toolbar.

 3. Right click on the row number above the insertion point to bring up a pop menu, and select Insert Cases.

Figure: Insert new case

Read Variable in Data View
..........................

Hover the mouse over the variables name at the top of the column to view its label.

Figure: Hover mouse over variable title to view its label.

Change Data Value
.................

Switch to data view, if you are not there already.

Select the cell you want to change.

Type the new value.

Press enter.

Select Entire Row or Column
...........................

Right click on the column title or row number to select the entire column or row, respectively.

Clear Variables
...............

There are a couple of ways to clear columns:

In data view:

1. Right click on the variable name at the top of the column.

    Select Clear Variables from the pop-up menu.

2. Right click on the column to select it.

    Select Edit -> Clear Variables from the drop down menu.

In variable view:

    Right click on the number title to the left of the row.

    Select Clear Variables from the pop-up menu.

Figure: Delete variables

Clear Cases
...........

There are a couple of ways to clear cases:

1. Right click on the row number to the left of  the row.

    Select Clear Cases from the pop-up menu.

2. Right click on the row number to the left of  the row.

    Select Edit -> Clear Cases from the drop down menu.

Figure: Delete cases

Sort Cases
..........

There are two alternative ways to sort cases without using the menu:

1. Right click on the variable title and select Ascending or Descending from the pop-up menu.

2. Right click on the variable title and select Data -> Sort Cases (see Sort Cases).

Figure: Sort cases

Status Bar
----------

Located at the bottom of the data editor window, provides information about the data under process.

Figure: Status bar

Filter Status turns on when you filter a subset of cases in the current file for analysis.

Wieght Status states the variable you are weighting the data against in the analysis.

Split File Status indicates there are separate data into groups.

Output Viewer
=============

The output viewer displays results, charts, and the instruction set executed, whether invoked from a menu command or the syntax window.

Note: The output viewer is not visible when PSPP loads, and appears upon execution of the first set of instructions.

Output View Examples
--------------------

1.

Figure: Output viewer displays open file instructions.

2.

Figure: Output viewer displays executed statistics functions.

The right pane of the output viewer displays results such as tables, text, and charts. The left pane gives the corresponding outline.

Figure: Output viewer panes

Save Output
-----------

To save the results in the output viewer select  File -> export. File types include PDF, HTML, Open Document, Text, and Postscript.

Syntax Editor
=============

Use the Syntax Editor window to enter command line instructions. For syntax and rules (see Language).

Enter commands into the syntax window and then execute them by selecting run from the menu. The instruction set can optionally be saved for later reuse. For example, the following set of commands (see fig:pic26) populates the data editor with a list of random numbers.

Figure: Enter command line instructions in the syntax editor.

Enter Commands
--------------

Most data-editor-menu functions enable you to paste the command line equivalent to that function directly into a syntax window from within the functions dialogue box, by selecting the paste button.

Example
.......

Place a command line instruction that generates descriptive statistics in the syntax editor window.

Open file manufacturing.sav.

Select  Analyze -> Descriptive Statistics -> Descriptives

Figure: Descriptives function in the data editor drop down menu.

Select variables and statistics in the Descriptives dialogue box

Figure: Paste button in the Descriptives dialogue box.

Click the Paste button to insert the command line equivalent of the function into the syntax editor.

Figure: Command line equivalent of Descriptives function in the drop-down menu.

Run
---

Select run to execute code in the syntax window. Options include:

Execute all commands   Run -> All

Execute highlighted commands    Run -> Selection

Execute a single line at current cursor position    Run -> Current Line

Execute at cursor position onwards    Run -> To End

Save
----

Save a set of commands by selecting Save in the File drop down menu.

GUI Main Menu
=============

Overview
--------

Perform tasks and operations on data with functions available through the drop down menus and toolbar.

File Perform all file handling operations such opening, closing and saving files.

Edit Move data and text around with cut, copy, and paste operations. In addition, can use to insert data and cases and perform searches.

View Use to change fonts, display extra information such as a status bar and value labels, and toggle between data and variable view.

Data Perform operations on data sets, such as sort, transpose, apply weights, extract subsets of cases, and split files.

Transform Replace select data with the result of applying mathematical or other operations on it.

Analyze Perform statistical analyses on the data.

Utilities Use to insert comments and view summary information of each variable.

Windows Use to toggle between open windows, split and minimize them.

Help Provide help contents.

File
----

New
...

Open a new data or syntax file.

Open
....

Open data, syntax, system, or portable files.

Import Delimited Text Data
..........................

Import all or part of a delimited text data file into the data editor. A series of dialogue boxes guides you through this process as follows:

Importing Textual Data Dialogue Box Import all or part of the file.

Figure: Import textual data dialogue box

First Line of Data Dialogue Select the first line of data.

Figure: Select first line of data.

Choose Separators Dialogue Choose a delimiter. Options include:

Space

Colon (:)

Pipe (|)

Tab

Comma (,)

Semicolon (;)

Bang (!)

Hyphen (-)

Slash (/)

Custom Separator Choose how to quote separator characters as demonstrated below (see fig:pic34).

Figure: Choose data separators dialogue box

Adjust Variable Formats Verify and edit variable attributes ( see Attributes).

Figure: Check and fix data formats.

Select the Apply button to import the data.

Save
....

Save the current file.

Save As
.......

Save the current file with a name and location of your choosing.

Display Data File Information
.............................

Working File Display the dictionary of the currently opened file.

Figure: Dictionary of current file.

External File Display the dictionary of a data file that is not yet open.

Recently Used Data
..................

Links to recently used data files.

Recently Used Files
...................

Links to recently used syntax files.

Quit
....

Close the current data file and shutdown PSPP.

Edit
----

Insert Variable
...............

Insert a new variable in data view to the left of the current column. The editor fills in system-missing values for all cases as a placeholder. By default, PSPP inserts a numerical variable type (see Basic Numeric Formats).

Insert Variable Example
.......................

Select  Edit -> Insert Variable to enter a new variable.

Figure: Insert variable in data editor.

Insert Cases
............

Insert a new case in the selected row if it is empty, or, above otherwise.

Go To Case
..........

Jump to the selected case number.

Cut
...

Remove the selected text and place it elsewhere by selecting paste at the desired insertion point.

Copy
....

Copies text onto the clipboard. Highlight the text and then select Edit -> Copy.

Paste
.....

Places the contents stored on the clipboard at the insertion point.

Find
....

Look for a case.

View
----

Status Bar
..........

Turn the status bar on or off. see Status Bar for further information.

Font
....

View and edit the current font settings.

Grid Lines
..........

Make the grid lines in the data editor window visible or invisible.

Value Labels
............

Show the value label associated with each result in data view.

Value Labels Example
....................

The data editor window on the right displays the value labels of the numerical survey data displayed in the window to the left (see fig:pic38).

Figure: Value labels of the data in the left window.

Variables
.........

Use to switch from data to variable view.

Data
----

Sort Cases
..........

Sort cases in ascending or descending order based on one or more variables.

Transpose
.........

Exchange rows and columns on data that is in the reverse order to the PSPP file format. Standard file format lists cases in rows and variables in columns.

Split File
..........

Split data into groups using grouping variables. If you select more than one grouping variable then you need to nest each successive category within the previous one. sp 1

Note: Cases should be sorted with the Sort Cases command first such that they are in the same order as the grouping variables listed under the Groups based on textbox.

Figure: Split File Dialogue Box

Group a file with physiology data according to height.

Figure: Physiology data file

Open the file physiology.sav.

Select  Data -> Split File.

Select the Compare groupsradio button in the pop up window.

Click Height in millimeters to highlight the variable.

Figure: Split-File dialogue box

Select the arrow to the left of the Groups based on textbox to move the height variable inside that textbox.

Click OK to see the results in the output viewer.

Figure: Split-file results in output viewer

Compare Groups
..............

Show split-file group output along side each other. For example, the output viewer displays a chart for each group in a single window.

Organize Output by Groups
.........................

Show results for each split-file group separately.

Weight Cases
............

Assign weights to variables. Note: Cases with a zero, negative, or missing value for the weighting variable are not included in the analysis.

Transform
---------

Compute
.......

Perform operations on numeric and string variables. Compute new variables or replace existing ones.

Example
.......

Compute the absolute difference in weight before and after participants follow a new diet plan (see fig:pic43).

Figure: Volunteers weights before and after dieting.

Open the file Diet.sav.

Select  Transform -> Compute from the drop-down menu to bring up a Compute Variable dialogue box.

Figure: Compute dialogue box

Enter weightChange in the Target Variable textbox and click the Type and Label button below it; This variable holds the result of the calculation.

Figure: Compute solution Type and Label

Select the Label radio button in the Type and Label dialogue box, and enter weightChange.

Press Continue.

Select the ABS(number) function from the list of functions and press the up arrow to place the function up in the Numeric Expressions textbox.

Select weightAfter from the list of variables located on the left of the dialog box.

Note: when you hover the mouse over the list of variables this brings up their names.

Figure: Enter numeric expression into compute dialogue box.

Click in between the parenthesis of the function in the Numeric Expressions textbox to move the cursor position.

Click the right arrow to the left of the Numerical Expressions textbox to move ABS(weightAfter) variable to the cursor position in the box.

Delete the question mark if it is still present in the ABS arguments.

Enter a space followed by a minus sign after  weightAfter, as follows: ABS(weightAfter - )

Select the weightBefore variable from the list on the left side of the Compute Variable dialog box.

Place the cursor after the minus sign of the mathematical expression in the Numeric Expressions textbox .

Click the right arrow.

Figure: Enter formula into compute variable dialogue box.

Click OK to add the result to the data file.

Figure: New variable weight change from calculation in compute dialogue box.

Rank Cases
..........

Create new variables that hold ranks, Savage scores, Normal scores, and percentile values for numeric variables in the current data file. PSPP automatically names and labels these such as to indicate original variable name and selected measures.

Figure: Rank cases by one or more variables.

Select the Smallest Value option from the Assign rank 1 to box for ascending order and Largest Value for descending.

Rank numerical variables by moving them into the Variables textbox (highlight the variable then click the right arrow).

Organize rankings into subgroups by moving the variables upon which the others will depend into the By textbox, e.g., move gender and height to calculate ranks for each combination of gender and height.

Rank Types
..........

Bring up the Rank Cases Types dialogue box by clicking on the Rank Types Button towards the bottom of the Rank Cases dialogue.  This dialogue box includes the following options: Rank, Savage score, Fractional rank, Fractional rank as a percent, Sum of case weights, Ntiles , Proportion Estimates, and Normal Scores.

Figure: Rank case types dialogue box.

Rank The value of the new variable is its rank.

Savage Scores calculated using an exponential distribution

Fractional Rank Return rank divided by the sum of the weights.

Fractional Rank as a Percent Return rank divided by the number of cases as a percent.

Sum of Case Weights is returned.

Ntiles Return a rank according to the percentile group. The size of each percentile group is given by 100/Ntile.

Proportion Estimates Estimate of the cumulative proportion of the distribution corresponding to a specific rank.

Normal Scores Return z scores corresponding to the estimated cumulative proportion.

Choose from a range of proportion estimate formulae when calculating proportion estimates and normal scores; options include Blom, Tukey, Rankit, or Van der Waerden.

     Blom Ranking variable based on proportion estimates which employ the formula (r - 3/8)/(w+ ), where w is the sum of the case weights and r is the rank.

     Tukey Apply the formula (r - 1/3)/(w + 1/3), where r is the rank and w is the sum of the case weights.

     Rankit Estimate expected values using (r - 1/2)/w, where w is the number of observations and r is the rank which ranges from unity to w.

     Van der Waerden Return Van der Waerdens transformation, given by the formula r/(w+1), where w is the sum of the case weights and r is the rank, ranging from 1 to w.

Ties Use to select the method for assigning rankings to cases with the same value on the original variable.

Figure: Rank case ties dialogue box

Recode Into Same Variables
..........................

Recode different values of the same type (numeric or string) into a variable. There are two options available: 1) change a single value to a new one or 2) change a range of values to a category.

Change a Single Value Example
.............................

Increase the value 12 Miles per Gallon (MPG) to 13 in the data set listing the mileage per gallon of a specific brand of car.

Figure: Mileage-per-gallon data file

Open file MPG.sav

Select  Transform -> Recode into Same Variables to bring up a Recode dialogue box.

Figure: Recode into same variables pop-up box

Select Miles Per Gallon and click the right arrow to move the variable into the Variables textbox.

Click the Old and New Values button to bring up its dialogue box.

Figure: Recode into same variables: Old and new values pop-up box

Type the number 12 in the Value text box under Old Value on the left side.

Type the number 13 in the Value text box under New Value on the right side.

Figure: Replace cases with a new value.

Click the Add button. The number 12 now appears under old and 13 under new.

Figure: Display old and new case values in Recode into same variables pop-up box.

Press Continue to close the New Values dialogue box

Click OK on the Recode into Same Variable dialogue box.

The value 12 MPG is now 13 MPG.

Collapse Range of Values Into a Category Example
................................................

Open file MPG.sav

Convert the mileage per gallon values in the MPG.sav automobile data set into three categories, as follows:

     If Miles Per Gallon is less than 19 MPG then give it a value of one.

     If Miles Per Gallon is greater than or equal to 19 MPG and less than 24 then give it a value of 2.

     If Miles Per Gallon is greater or equal to 24 then give it a value of three.

Select Transform -> Recode into Same Variables.

Select the range LOWEST thru value radio button, and enter 18.

Enter the number 1 in the value field under New Value on the right side of the dialogue box.

Click the Add button, to get the LOWEST-18 listed under old and 1 under new.

Repeat with the other value ranges:

     Select the Range-through radio button and then enter 19 in the first text box and 23 in the second.

     Enter the number 2 in the value text box under New Value, and click the Add button.

     Select the range thru HIGHEST radio button and enter 24.

     Enter the number 3 in the value field under New Value, and click the Add button.

Figure: Collapse a range of values into categories with recode into same variables.

Click Continue. The Old and New Values dialogue box disappears.

Click OK on the Recode into New Variables dialogue box to put the new values in the MPG variable column.

Figure: Calculated frequency data inserted into data editor.

Recode into Different Variables
...............................

Change variable values and save into a new one. There are two options available; change a single value to a new one or change a range of values to a category. Note, that  the new variable type must be the same as the original; numeric or string (see Recode Into Same Variables).

Figure: Recode case values into a new variable.

Analyze
-------

Descriptive Statistics Definitions
..................................

Central Tendency Measure of the central position of a set of data.

Mean Average value, or first moment (see definition below), defined as sum of all data within a set divided by the number of cases in the set. Note: the mean is susceptible to outlying values, e.g., the average temperature over a month in a region that has had a few unusually hot days will be higher than usual.

Note: Moments are the sums of integer powers of the values, where a higher integer power corresponds to a higher moment e.g. the variance is the second moment, skewness the third, and kurtosis the fourth.

Median The central value of an ordered set of numbers. In other words, 50% of the values fall above or below it. When the number of data values is even the median is the average of the middle two. The median is not as susceptible to outlying values as the mean.

Mode Most frequently occurring value.  Note that there can be more than one mode in a data set.

Sum The addition of all values across the different cases excluding missing ones.

Dispersion A measure of the spread or variation in data values about the mean.

Standard Deviation A measure of the spread in values about the mean equal to the square root of the sum of the squares of the difference between each value and the mean, for all values, divided by one less than the number of cases.

Variance The standard deviation squared, or the second moment.

Range The difference between the largest and smallest numerical values in the set.

Minimum The smallest numerical value in the set.

Maximum The largest numerical value in the set.

S.E. Mean The standard error of the mean is a measure of by how much the value of the mean varies with different samples from the same distribution.

Distribution Statistics that describe the shape and symmetry of a distribution.

Skewness A measure of the asymmetry of a distribution. Estimate this by taking the third moment (proportional to the sum of the cube of the difference of each data value and the mean). Unlike the mean and variance the definition is such as to make it a dimensionless quantity, and this pure number characterizes the shape of the distribution.  Positive values indicate the distribution has a more heavily pronounced right tail, while negative ones indicate a more prominent left one. When both tails are equal the skewness is zero.

Kurtosis A measure of the relative peakedness or flatness compared to a normal distribution.  Estimate this by taking the fourth moment (proportional to the sum of the fourth power of the difference of each data value and the mean). Like the skewness, this is also a dimensionless quantity. A distribution with negative kurtosis is termed leptokurtic, while a distribution with a positive value as platykurtic, and an in-between one is termed mesorkurtic.

Descriptive Statistics
......................

Includes frequencies, descriptives, explore and crosstabs.

Frequencies
...........

cindex frequencies

Calculate statistics including central tendency (mean, median, mode, and sum), dispersion (standard deviation, variances, range, minimum, maximum, standard error of the mean) and distribution (skewness and kurtosis). Optionally, view frequency tables and charts.

Figure: Frequencies dialogue box

The frequencies dialogue box lists all variables along the left side. In order to perform statistical analyses or plot charts move the variables into the Variables dialogue box. To do this, first, click on the variable until it is highlighted and then select the right arrow.

Figure: Select variables in the frequencies dialogue box.

Choose whether to display frequency tables, and in what way to order the tables; ascending or descending value or ascending or descending frequency.

Figure: Frequency tables pop-up box

Plot histograms or pie charts with the Chart Dialogue box.

Figure: Frequency charts pop-up box.

Histogram options include scaling with either frequencies or percentages and superimposing a normal curve.

Pie charts come with the option to include slices for missing values.

Frequencies Example
...................

Analyze the extent to which hotel customers were satisfied with the level of service in the following survey (see fig:pic65).

Figure: Customer satisfaction survey

Open file hotel.sav.

Select Analyze -> Descriptive Statistics -> Frequencies to bring up the Frequencies dialogue box.

Select the first variable from the list on the left side then click the right arrow to move it inside the Variables dialogue box.

Figure: Pick variables in the frequencies dialogue box.

Select the charts button to bring up the Charts dialogue box.

Select Draw Histograms and press Continue to close this dialogue box.

Figure: Plot histograms of selected data.

Select Mode from the Statistics options in the Frequencies dialogue box.

Figure: Select statistical analyses in the frequencies pop-up.

Press OK to display the results in the output viewer.

Figure: Results of frequencies function displayed in output viewer.

Descriptives
............

Display univariate summary statistics and z-scores. Statistics include central tendency (mean), dispersion (standard deviation, variance, range, minimum, maximum, and standard error of the mean), and distribution (kurtosis and skewness).

Z-Score
.......

Z-score is a dimensionless variable that classifies how many standard deviations a value is from the mean. Also known as standardizing or normalizing. Based on normal theory, these are best for quantitative variables with symmetrical distributions. Note, if the distribution is skewed the z scores will be as well.

Z-Score Example
...............

Begin by making a data set in the syntax editor. Write a small program to generate normally distributed numbers that represent SAT test scores with a mean of 500 and standard deviation of 110 as follows:

Select  File -> New -> Syntax to open a syntax window.

Enter the following command lines (see fig:pic70) into the syntax window.

Figure: Generate data (random numbers) in the syntax editor.

Select  Run -> All to execute the program and populate the data editor with random numbers drawn from a normal distribution.

Figure: New data generated with command line instructions in the syntax editor.

Next, calculate the z scores using the Descriptives menu command.

Select  Analyze -> Descriptive Statistics -> Descriptives to bring up the Descriptives dialogue box.

Select the newvar variable by clicking on it in the variables list to the left of the dialogue box, and then by clicking the right arrow to move it over into the Variables textbox.

Select the save Z scores of selected variables as new variables check box.

Click OK to generate a list of z scores under the new variable in the data editor window.

Figure: Z-scores generated with the descriptives function.

Explore
.......

Provides descriptive statistics including percentiles and extremes, and in addition, enables you to examine subgroups of data. Descriptive statistics include the mean, median, variance, standard deviation, minimum, maximum, range, skewness, and kurtosis.

Explore Example
...............

Generate descriptive statistics of the following data set of SAT test scores versus gender for everyone, independent of gender, or break it down into subgroups and do a separate analysis for each gender type.

Figure: Data sheet of SAT scores by gender.

Open file SATscores.sav.

Start by looking at all test scores independent of gender.

Select Analyze -> Descriptive Statistics -> Explore to open the Explore dialogue box.

Figure: Explore dialogue box

Select Score and press the right arrow button next to the Dependent List box.

Click the Statistics button at the bottom left side of the dialogue box to bring up the Statistics pop-up box.

Select the Descriptives and Extremes check boxes, and then press continue.

Figure: Explore statistic functions

Press OK on the Explore dialogue box to display the results in the output editor.

Figure: Explore statistical analysis results displayed in output viewer.

Repeat the analysis, examining each gender group separately, where 0 represents male.

Select  Analyze -> Descriptive Statistics -> Explore to open the Explore dialogue box.

Select Score and press the right arrow button beside the Dependent List textbox.

Select Gender and press the right arrow button beside the Factor List textbox.

Figure: Compare SAT scores by gender with the Explore function.

Press the Statistics button at the bottom of the Explore dialogue box.

Select the Descriptives and Extremes check boxes and then press the continue button.

Press OK on the Explore dialogue box to display the results.

The output viewer lists different statistics for each group. For example, the lowest and highest test scores are 182.98 and 835.52, respectively, for the males, and, 179.03 and 805.10 for the female group.

Figure: Results of Explore function analysis in output viewer.

Crosstabs
.........

Examine bivariate relationships through cross tabulation. This tool is useful for determining if one variable is dependent upon another, e.g.,  in a customer satisfaction survey you might discover a dependency of customer satisfaction levels on price.

Statistics and Measures of Association
......................................

Chi-Square Use Pearsons Chi-Square to test if the frequency in each cell is at least five; when the frequency is less than five and the contingency table is 2 x 2 in size then Fishers exact test is performed. When both variables are quantitative this function also returns a linear-by-linear association test.

Correlations Return Spearmans correlation coefficient and rho for numeric data when the values in the rows and columns are ordered. When both variables are quantitative returns the Pearsons R.

Nominal Data Measure the degree of association with several coefficients.

     Phi Measure of association that returns the square root of the chi-square coefficient divided by the sample size. Typically, apply this to 2 x 2 tables although it can handle larger sizes. For 2 x 2 tables phi is identical to the correlation coefficient, but for larger ones the interpretation can be more complex.

     Contingency Coefficient An adjustment to phi in order to make it suitable for tables larger than 2 x 2. The coefficient is equal to the square root of chi-square divided by chi-square plus the sample size. Note: For tables smaller than 5-by-5 this underestimates the level of association.

     Cramer's V This measure of association gives accurate results when the number of rows and columns are equal, independent of size. V is equal to the square root of chi-square divided by the product of the sample size and the length of the smallest row or column.

     Lamda Returns the percent by which you reduce the error when estimating the value of the dependent variable based upon on the value of the independent one. A lambda of zero means that there is no advantage in using the distribution of the independent variable to estimate the value of the dependent variable.

     Uncertainty Coefficient Otherwise known as the entropy coefficient, is the percent reduction in error accounting for the variance in the dependent variable, where variance is defined in terms of entropy. When the uncertainty coefficient is zero, the independent variable is not helpful in predicting the dependent variable.

Ordinal Data

     Gamma Returns the strength of association for ordinal data, ignoring tied (cases have equal values on both variables) pairs. Gamma is defined as the number of concordant pairs minus the number discordant ones over the sum of each type of pair. Cases form a concordant pair when the ranking agrees; meaning one case has a higher value than another case on both variables. When one case has a higher value on one variable, but a lower value on another the ranking disagrees and the cases form a discordant pair. Values of gamma range from -1 to 1. A value of 1 indicates perfect agreement between the rankings, while a value of -1 means there is perfect disagreement. When gamma is equal to zero then there is no association between cases.

     Note: Since gamma ignores ties, the strength of association between two variables might be over-exaggerated.

     Somers'd Modification to Gamma that accounts for pairs tied on the dependent variable; values range from -1 for negative relationships to +1 for positive ones.

     Kendall's Tau B A modification to gamma that takes into account tied pairs tied on both the dependent and independent variable. Kendalls Tau-B is symmetrical in that the same value is produced regardless of which variable is considered independent. Tau-b can only reach its maximum or minimum values of 1 and -1 for square tables.

     Kendall's Tau C This is a variant of Kendall's Tau-B that can reach the maximum and minimum values of +1 and -1 for non-square tables.

Nominal by Interval

     Eta Gauge of association when the dependent variable is a quantitative measure and the independent variable is categorical. Eta ranges from 0 to 1, with increasing values indicating a higher degree of association.

     Cohen's Kappa Kappa is a measure of the degree to which two raters agree over their sorting of items into mutually exclusive categories, and takes into account agreement that occurs by chance. Values range from -1 to +1 and represent the proportion of agreements between raters after adjusting for those that take place by chance. A value of +1 indicates perfect agreement and -1 perfect disagreement. When kappa is zero, then there is no relationship between the raters and any agreements or disagreements are due to chance only.

     Estimated Relative Risk The observed risk of having the outcome of interest be greater due to a specific factor.  Use the odds ratio as an estimate or measure of risk if the occurrence of the factor is rare. A confidence interval greater than one indicates there is a greater chance of the event occurring in the presence of the factor. Note: this is only suitable for 2 x 2 tables.

Crosstabs Example
.................

Consider a medical study examining the relative risk of patients having cerebella toxicity who have taken a generic chemotherapeutic agent rather than a non-generic one.

Table: Toxicity Versus Chemotheraputic Agent

  Toxicity+   Toxicity-
Generic+       11       14
Generic-       3        31

Enter the data from the table (see tab:tab1) into a PSPP data sheet (see fig:pic79), where +1 represents positive (+) and 0 negative (-). Alternatively, open file GeneralToxicity.sav.

Figure: Toxicity data in the data editor

Weight cases by selecting  Data -> Weight Cases, and then choose the Weight Cases By: option (see fig:pic80).

Figure: Weight cases function

Select  Analyze -> Descriptive Statistics -> Crosstabs to open the Crosstabs dialogue box.

Move the variable toxicity from the list on the left side of the dialogue box into Rows and Generic into Columns.

Click Statistics to bring up the Statistics dialogue box.

Figure: Crosstabs dialogue box.

Select the Risk check box and then click Continue to close this dialogue box.

Click OK on the Crosstabs dialogue box to display the results in the output viewer.

Figure: Crosstab statistics results in output viewer.

Compare Means
.............

There are several options including One-Sample T-Test, Independent Samples T-Test, Paired Samples T-Test, and One-Way ANOVA.

One-Sample T-Test
.................

Tests if the mean of a single variable differs from a specified constant.

One-Sample T-Test Example
.........................

Compare the mean of the measured lifetime of 100 soft white light bulbs to that claimed by the manufacturer (700 hours).

Open the file LightBulbHours.sav.

Select  Analyze -> Compare Means -> One Sample T Test.

Select the hour variable from the list on the left side of the dialogue box and then click the right arrow to move it into the Test Variables textbox.

Enter the value 700 into the Test Value textbox.

Figure: One-Sample T Test dialogue box

Click OK to view the results in the output window.

Figure: One-Sample T Test output results

Independent Samples T-Test
..........................

Compare means of the same variable taken from two independent samples. Although the test requires normally distributed data, minor departures from this assumption are tolerable, and there is no requirement that the samples are the same size.

Independent Samples T-Test Example
..................................

Compare mean heights, in centimeters, of ten twelve-year-old boys to ten twelve-year-old girls.

Enter the following height and gender data (see tab:tab2) into a data file, where 0 represents female and 1 male, or open file Height12YearOlds.sav.

Table: Height of twelve year old children

Height(cm)   Gender
152.71    0
142.57    0
155.48    0
148.79    0
167.74    0
149.51    0
142.00    0
150.21    0
171.19    0
141.99    0
152.67    1
139.65    1
152.19    1
156.94    1
151.86    1
157.79    1
152.49    1
157.52    1
156.95    1
141.61    1

Name the first variable Height and the second Gender.

Select  Analyze -> Compare Means -> Independent Samples T Test.

Select Height from the list on the left side of the dialogue box and then click the upper right arrow to move it into the Test Variables box.

Figure: Independent-Samples T Test dialogue box

Select Gender and click the lower right arrow to move the variable into the Define Groups area.

Click the Define Groups button at the bottom of the dialogue box.

Figure: Define variables and groups in the Independent-Samples T Test dialogue.

Enter 0 into the Group1 Value textbox of the Define Groups dialogue box.

Enter 1 into the Group2 Value textbox of the Define Groups dialogue box.

Select Continue.

Figure: Organize data into groups.

Click OK on the Independent-Samples T Test dialogue box to examine the results in the output viewer.

Figure: Results of the Independent-Samples T Test in the output viewer.

Paired Samples T-Test
.....................

Compare means of two sets of quantitative data, where data sets are organized into pairs with a definite relationship, e.g., one set of data might represent a measurement taken before some event and the other a measurement after. Each pair is then the measurement before coupled with the measurement after.

Paired Samples T-Test Example
.............................

Compare the means of the following measurements (see fig:pic90) from nine asthmatics of their peak expiratory flow rate before and after a walk on a cold winters day.

Figure: Before and after data

Enter the data in see fig:pic90 into a new data file.

Select  Analyze -> Compare Means -> Paired Samples T Test.

Highlight the Before variable with the mouse and then click the right arrow to place it in the Test Variables dialogue box under Var1.

Figure: Paired Samples T Test dialogue box.

Repeat the same steps with the After variable to place it under Var2.
      sp 1

Click OK to display the results in the Output window.

Figure: Paired Samples T Test output results.

One-Way ANOVA
.............

Indicates if there are significant differences between means of three or more independent groups, where the independent variable consists of two or more categorical independent groups and the dependent one is either interval or ratio. Note: this only tells you if the means of the groups are significantly different and not which ones.

Optional Statistics include:

Descriptives (mean, standard deviation, standard error of the mean, minimum, maximum, and 95% confidence intervals for each dependent variable)

Homogeneity of variance test that calculates the Levene statistic to look for the equality of variances

Specify contrasts the you want tested by the t statistic with the Contrasts button in the dialogue box.

One-Way ANOVA Example
.....................

Determine if the mean of each smoker group's lung capacity varies, where the different groups include non-smoker, light-smoker, medium-smoker, and heavy-smoker.

Open the data file Smokers.sav. This lists forced expiratory flow measurements under the variable FEF and the corresponding group type (non-smoker=0, light-smoker=1, medium-smoker=2, heavy-smoker=3) under Groups.

Figure: Data describing the lung capacity of several groups of smokers.

Select  Analyze -> Compare Means -> One-Way ANOVA

Figure: One-Way ANOVA dialogue box

Click on FEF from the list of variables on the left side of the dialogue box then select the upper right arrow to move it into the Dependent Variables textbox.

Figure: Select dependent variable in One-Way ANOVA dialogue box

Select the Group variable and click the lower right arrow button to place it inside the Factor textbox.

Figure: Dependent and independent variables in the One-Way ANOVA dialogue.

Click OK to displays the results in the output viewer.

Figure: One-Way ANOVA output

Contrast is a weighted sum of the means and enables you to test your research hypothesis as opposed to the statistical one.

ANOVA Contrasts Example
.......................

Open the data file Smokers.sav. This lists forced expiratory flow measurements under the variable FEF and the corresponding group type (non-smoker=0, light-smoker=1, medium-smoker=2, heavy-smoker=3) under Groups.

Check if the mean lung capacity of non-smokers varies from that of smokers, independent of how many they smoke. There are four different groups, of which three are smokers of different intensities. This means the non-smoking group should have a mean with a weighting of unity and the others a weighting of one-third.

Select Contrasts on the One-Way ANOVA dialogue box.

Figure: Use contasts button to calculate weighted sum of the means.

Enter 1.0 in the Coefficients textbox and then click the Add button.

Add the values -0.333, -0.333, and -0.334 to the Coefficients list.

Figure: Contrasts dialogue box

Press Continue to close the Contrasts dialogue box.

Press OK on the One-Way ANOVA dialogue box to display the results in the output viewer.

Figure: One-Way ANOVA output

Bivariate Correlation
.....................

Computes Pearsons correlation coefficient, defined as a value between -1 and +1 that indicates the degree of association between variables. A positive value means large values of one variable are associated with large values of the other and,likewise, small values of one variable are associated with small values of the other. A negative value indicates that large values of one variable are associated with small values of the other and vise-versa.

Bivariate Correlation Example
.............................

Use this feature to investigate the correlation, if any, between ice cream sales and outside temperature.

Open a new data file.

Enter the following pairs of values listed (see tab:tab3) of the number of ice cream cones sold each day one summer at a specified store along with the corresponding daytime high temperature, or open file IceCream.sav .

Table: Ice Cream Cones Sold Versus Outside Temperature

Ice Cream Cones Sold   Temperature (Fahrenheit)
      171.00       76.00
      161.00       71.00
      156.00       66.00
      151.00       61.00
      154.00       73.00
      143.00       61.00
      146.00       64.00
      157.00       69.00
      171.00       78.00
      171.00       78.00
      166.00       76.00
      168.00       76.00
      176.00       81.00
      181.00       83.00
      181.00       86.00
      144.00       60.00
      174.00       87.00
      177.00       89.00
      178.00       86.00
      186.00       91.00
      164.00       75.00
      161.00       74.00
      163.00       72.00
      149.00       69.00
      161.00       71.00
      155.00       74.00
      170.00       86.00
      179.00       91.00
      176.00       71.00
      165.00       82.00

Select  Analyze -> Bivariate Correlation, to bring up the Bivariate Correlation dialogue box.

Select Cones and click the right arrow button to move it into the right-hand-side textbox.

Figure: Bivariate Correlations dialogue box

Repeat the same steps with the Temperature variable.

Click OK to display the results in the output viewer.

Figure: Bivariate Correlations output

Factor Analysis
...............

Helps identify the underlying variables, or factors, to explain correlations. Variables should be either interval or ratio, and not categorical.

Note: PSPP assumes the data has a nearly bivariate normal distribution for each pair of variables and that observations are independent.

Two main statistic functions are available: Extraction and Rotation (see fig:pic102).

Figure: Factor Analysis dialogue box

Extraction
..........

Figure: Factor Analysis Extraction dialogue box

Method The Method button on the Extraction dialogue box enables you to choose the method of factor extraction. Options include Principal Components Analysis and Principal Axis Factoring.

     Principal Components Analysis Use when the correlation matrix is singular. This function assembles uncorrelated linear combinations of the observed variables such that each successive component accounts for a progressively smaller portion of the variance.

     Principal Axis Factoring An iterative procedure that extracts and replaces factors from the current correlation matrix with new estimates repeatedly, until the convergence criterion for extraction is satisfied.

Analyze Choose either a correlation or covariance matrix.

Display Display the unrotated factor solution and Scree plot.

     Unrotated Factor Solution Display the unrotated factor loadings, communalities, and the solution eigenvalues.

     Scree Plot A plot of the variance for each factor.

Extract Specify to keep factors whose eigenvalues exceed a specified factor above the mean eigenvalue, or choose a specific number of factors to keep.

Maximum Iterations for Convergence Specify the maximum number of steps the algorithm can take to estimate the solution.

Rotation
........

Figure: Factor Analysis Rotation dialogue box

Method Choose the type of factor rotation method. Options include none, varimax, quartimax, and equimax.

     Varimax An orthogonal rotation of the factor axes which has the effect of differentiating the original variables by the extracted factor. This solution provides results that make it easier to identify each variable with a single factor.

     Quartimax An orthogonal rotation that minimizes the number of factors needed to explain each variable.

     Equimax A combination of the varimax and quartimax rotations.

Display Rotated Solution Display the solution in this way if you have selected a rotation method.

Maximum Iterations for Convergence Choose the maximum number of steps the algorithm can take to reach convergence. The default value is twenty-five.

Factor Analysis Rotation Example
................................

Perform factor analysis to determine the leading factors that drive people to purchase specific brands of bread with the data (see fig:pic105).

Figure: Survey data describing influential factors in purchasing.

Enter the following consumer data (see fig:pic105), or open file Bread.sav.

Select Analyze -> Factor Analysis to bring up Factor Analysis dialogue box.

Click the first variable, Reputation, and then press the right arrow button to move it into the Variables dialogue box.

Figure: Pick variables for Factor Analysis.

Repeat with all the other variables until no more remain on the left side.

Figure: All variables are selected for Factor Analysis.

Click the Extraction button.

Select the Principal Components Analysis method.

Select the Correlation matrix option under Analyse.

Select Unrotated factor solution and Scree plot under Display.

Click Continue to close this dialogue box.

Select the Rotations button in the Factor Analysis dialogue box.

Select the Varimax option under Method.

Select Display rotated solution.

Click Continue to close the dialogue box.

Click the OK button to display the results in the output viewer.

Figure: Factor Analysis output

Reliability
...........

Estimate the internal consistency reliability. Options include Split-half reliability and Chronbach's Alpha.

Figure: Reliability Analysis dialogue box

Split-half Reliability
......................

An estimation based on the correlation of two equivalent forms of the scale. This is a three-step process: 1) Randomly divide all items that measure the same construct into two sets, 2) administer the whole instrument and divide the total score for each item in half, and 3) estimate the split-half reliability by calculating the correlation of these two sets.

Chronbach's Alpha
.................

This estimation is equivalent to the average of all possible split-half estimates, and is an indication of the correlation among the variables.

Chronbach's Alpha Example
.........................

Examine the internal reliability of the following pass-fail test data (see fig:pic111), where zero represents fail and one pass.

Figure: Fail-pass test data

Enter the test data (see fig:pic111) into a new data file, or open the file PassFail.sav.

Select Analyze -> Reliability.

Click the first variable and select the right arrow to move it into the Items textbox.

Figure: Pick variables for Reliability Analysis

Repeat with the other variables until they are all listed in the Items text box.

Figure: All variables are chosen for Reliability Analysis.

Click OK to display the results. In this instance, Cronbachs Alpha is 0.61 indicating the internal consistency is questionable.

Figure: Reliability Analysis output

Non-Parametric Statistics
.........................

Provides Binomial statistics and Chi-Square for an arbitrary distribution of data. Tests the differences between the observed and expected distribution of a sample, and can also test the difference between two or more samples.

Binomial
........

Compare the observed frequencies of dichotomous data to the expected values from the binomial distribution. The primary purpose of this test is to observe if the number of outcomes for each variable differs, e.g., you can verify a fair coin by comparing the frequency of heads and tails in several coin tosses.

Binomial Example
................

The following list of HotCold and Range data (see tab:tab4) indicates the temperatures at which customers ordered their gourmet drinks on a midsummers day; available menu options include ice-cold, luke-warm, warm, or steaming-hot. The first column, HotColdis a dichotomous variable with a value of zero for ice-cold drinks and one otherwise. The next column, Range varies from 0 to 3 depending upon temperature range of the drink, where 0=cold, 1=luke-warm, 2=warm, and 3= hot.

     Table: Gourmet Drink Temperatures

     HotCold   Range
           0         0
           0         0
           1         2
           1         2
           0         0
           1         1
           1         1
           1         1
           1         2
           1         1
           1         3
           1         3
           1         2
           0         0
           0         0
           0         0
           1         1
           0         0
           0         0
           1         2
           1         2
           0         0
           1         3
           0         0

Start by examining the data in the first column; HotCold.

Copy the gourmet drink data (see tab:tab4) into a data file, or open coffeeTemperature.sav.

Select Analyze -> Non-Parametric Statistics -> Binomial.

Select HotCold and click the right arrow button  to place it in the Test Variable List textbox.

Verify Test proportion has the value 0.5.

Verify Get from data is selected under Define Dichotomy.

Figure: Binomial dialogue box

Click OK to display the results in the output viewer.

Figure: Binomial Test output

Chi-Square
..........

Used to check if distributions of categorical variables differ, where categorical variables are used to label categorical data, e.g. assign a value of 1 for values in range a to c, value of 2 for values in range d to f, and so on.

Chi-Square Example
..................

Enter the gourmet drink data (see tab:tab4) from the previous section (see Binomial Example) into a new data file.

Select Analyze -> Non-Parametric Statistics -> Chi-Square.

Select the Range variable, and then click the right arrow to place it into the Test Variable List textbox.

Figure: Chi-Square Test dialogue box

Verify that All categories equal is selected under Expected Values.

Verify that the Get from data option under Expected Range is selected.

Click OK to display the results in the output viewer.

Figure: Chi-Square Test output

ROC Curve
.........

Use to analyze binary classification systems. Examples of binary classification schemes include passing or failing newly made items during an inspection, and labeling patients to be either with or without a medical problem. The Roc Curve function returns an ROC curve with the option to display a diagonal reference line, standard error and confidence interval, as well as all coordinate points.

Figure: ROC Curve dialogue box

Test Variable
.............

Continuous numerical data holding the test results.

State Variable
..............

Indicates which category is positive.

Display
.......

Gives options for the output viewer including:

ROC curve with or without a diagonal reference line

Display standard error and confidence interval

Display coordinate points of the ROC curve

Display ROC Curve Produce a plot of one classification rate from a binary classification scheme versus the other as the criterion changes, e.g., you can plot the true positive rate versus the false positive rate for a disease as the threshold value between the two classifications varies.

Display Diagonal Reference Line Include a diagonal reference line in the plot. An ROC curve that coincides with this line indicates the distribution of each classification group is similar.

Display Standard Error and Confidence Interval Show the standard error, confidence interval, and area in a separate table in the output viewer. The area ranges in value from 0 to 1, where 1 indicates the distribution of each classification group does not overlap and 0.5 means both distributions are the same.

ROC Curve Example
.................

Make an ROC curve of the following medical test data describing the dependence of a disease with age. The age variable holds the patients ages and the corresponding diseasecolumn is either 0 indicating a negative diagnosis or 1 otherwise.

Figure: Medical test data

Open the file Disease.sav.

Select  Analyze -> ROC Curve.

Select Age from the list of variables on the left side of the dialogue box, and click the upper right arrow button to move it under  Test Variable.

Select Disease and click the lower right arrow button to move it into the State Variable box.

Select all the check boxes under Display.

Enter the number 1 in the Value of state variable box.

Figure: ROC Curve dialogue box

Click OK to display the ROC curve and accompanying tables in the output viewer.

Figure: ROC Curve output

Utilities
---------

View Variable Properties
........................

View variable properties and/or go-to it in the data editor window. Properties include variable name and label, Data format, user-missing values, measurement level, and value labels. For a definition of each variable property, (see Edit Variable Attributes).

View Variable Properties Example
................................

open hotel.sav.

Select  Utilities -> Variables to bring up the Variables dialogue box.

Select a variable from the list in the left column to view its properties on the right side of the dialogue box.

Figure: View variable properties in Variables dialogue box.

Data File Comments
..................

This feature enables you to add comments to a data file.

Figure: Comments dialogue box

Display Comments in Output
..........................

Display comments in the output viewer.

Reset
.....

Clears the current comment.

Windows
-------

Minimize all Windows
....................

Collapse all windows.  Click the PSPP icon on the tool bar to open them again.

Split
.....

Split the current data editor window (see fig:pic125).

Figure: Split data-editor window

Help
----

Provide user instructions and product version information.

Toolbar
-------

PSPP provides a tool bar across the top with short cuts to more commonly used menu commands.

Figure: Data editor toolbar