Sei sulla pagina 1di 27

GETTING STARTED with SPSS - Part I

SPSS (originally named Statistical Package for the Social Sciences is a widely used software package for performing statistical analyses and generating graphical displays. It is one of the oldest packages in the retail market, having begun as a small deck of punch cards in 1968. It is designed to accommodate the statistical computing needs of social scientists, but is increasingly used by analysts from other disciplines as well. Recently, IBM announced that it is purchasing SPSS for $1.2 billion. With version 18, which has recently been released, the product name has changed to PASW (Predictive Analytic Software). SPSS 17 windows version is compatible with Windows Vista. Appendix A provides more details on system requirements for SPSS/PASW 17 and PASW 18 for Windows, MAC and Linux. Additional information may be found on the SPSS, Inc. website: http://www.spss.com.

SMU's Standard Configuration for SPSS 17: SMUs standard configuration for an SPSS installation is SPSS Base, Regression Analysis and Advanced Models. SMU also has a limited number of licenses available for Tables, Tables Original, Trends, Trends Original, Categories, Exact Tests, Conjoint, Missing Values and Amos. Software installation requests may be made by calling the SMU Help Desk at x84357 (x8HELP) or online at http://www.smu.edu/help/support/itshelpdesk.asp (click on Online Support Center). For assistance with statistical analyses or use of statistical software packages, contact N. Shirlene Pearson at pearson@smu.edu or x83034. Topics covered in Getting Started with SPSS 17 -- Part I: Overview of the Data Editor Bringing data into SPSS SPSS data file structure Variable profiles Working with multiple data sources Summary statistics for categorical data Creating and editing charts Exporting output SPSS Syntax

Invoking SPSS. SPSS can be invoked by clicking on the desk top SPSS icon or via the Start Menu by selecting Program Files SPSSInc Statistics 17.0 SPSS 17.0.

Page 1 of 27

SPSS Statistics Data Editor


Upon opening, SPSS displays its Data Editor window, which has two tabs at the bottom: Data View and Variable View. The tab of the current view is highlighted in yellow. Data View is where the actual data is displayed. Data values may be entered or edited within Data View. Variable View is where variable properties are displayed. These properties may be created before entering data or modified afterward within Variable View. The menus across the top of the Data Editor window remain the same regardless of which view is selected and consist of: File, Edit, View, Data, Transform , Analyze, Graphs, Utilities, Add-ons, Window, and Help. Note: For some reason, there are two Add-ons buttons in SPSS 17 on my PC. One is active and the other is inactive. This does not appear to be the case for other PCs running SPSS 17.

The File, Edit and View menus are similar to what you might expect to find in other applications. The Data menu allows you to manipulate your dataset by using tools designed for this purpose. You can easily transpose, sort, split your file, etc. The Transform menu enables you to transform the values of one or more variables according to a set of rules, so you do not have to manually change individual data values. This is where you can, for example, replace all missing values with some other specified value, recode variables to create new ones, or create a new variable from a computing operation performed on one or more variables. The Analyze menu allows easy access to the core SPSS functionality that is installed. This menu contains all available non-graphical statistical analyses and will vary depending on the particular SPSS configuration you have installed. Page 2 of 27

Statistics in SPSS Base include: Descriptive statistics: cross tabulation, frequencies, descriptives, explore, descriptive ratio statistics Bivariate statistics: means, t-tests, ANOVA, correlation (bivariate, partial, distances), nonparametric tests Prediction for numerical outcomes: linear regression Prediction for identifying groups: factor analysis, cluster analysis (two-step, Kmeans, hierarchical), discriminant analysis

The Graphs menu, as the name implies, provides tools for generating and customizing a wide variety of graphical displays. Customized graphics can be stored as templates for future use with other datasets. The Utilities menu provides tools for more efficiently working with your datasets and for running saved SPSS scripts. The Add-ons menu provides an overview of SPSS modules and packages that may be purchased separately from SPSS Base. Most of these add-ons require that you have SPSS Base installed. Modules not installed on your computer will appear in the Add-ons menu. Modules that are installed will show up in the Analyze menu, but not the Add-ons menu. The Window menu allows you to split the active Data View window into either two or four panes for navigating the dataset. This enables you to view up to four different areas of the dataset at the same time. This option is not available in Variable View, and is grayed-out in Variable View. From this menu, you can also minimize all windows or select any active window that may be open. The Help menu provides information About the currently installed version, tutorials, documentation, and a link to Check for Updates. This latter choice is a convenient way to determine whether your installation needs patches that may be available. It even has a Statistics Coach to help guide you in your choice of analyses. SPSS Base installed software contains all add-ons that require SPSS Base, but none of the add-ons are activated without an activation code and your registering the add-on with SPSS. This is accomplished within the Help menu by selecting Product Registration.

Bringing Data into SPSS.


There are three principle ways that data may be brought into SPSS: direct data entry, reading data from a data file or reading data from a database.

Page 3 of 27

Data entry data may be entered manually into Data View or copy/cut and pasted from other applications such as other SPSS datasets, Excel spreadsheets, etc. However, the copy/cut and paste method is not fool-proof and you should take care that the data is transferred properly. Reading from a data file SPSS supports the importation of data from a variety of file formats: SPSS (*.sav, *.sys, *.por), Systat (*.syd, *.sys), Excel (*.xlm, *.xlsx, *.xlsm), Lotus (*.w*), Sylk (*.slk), dBase (*.dbf), SAS (*.sas7bdat, *.sd7, *.sd2, *.ssd01, *.xpt), Stata (*.dta), and Text (*.txt, *.dat). Reading from a database SPSS also supports the importation of data from databases such as dBase and MS Access Database, as well as any database on your computer that uses ODBC (Open Database Connectivity) drivers, such as FoxPro Database, FoxPro Tables, Xtreme Sample Database, Microsoft SQL Server, XLS, Text, xBase, Paradox, ODS, Oracle, RedISAM, FoxBase, Btrieve, Integra-SQL, DEC Rdb, SQLBase, Informix, Ingres, DB2, SQL/DS, Teradata, SQL/400, et al. Open an SPSS Data File demo.sav file located in the SPSS Samples directory SPSS provides a wealth of example data in eleven (11) different languages. These samples are installed as part of the base package and are located in c:\Program Files\SPSSInc\Statistics17\Samples. The English samples are in the subdirectory English: c:\Program Files\SPSSInc\Statistics17\Samples\English In the File menu Open Data

An Open Data window appears. Click on My Computer and navigate to the SPSS Statistics17 Samples directory

Page 4 of 27

C drive Program Files SPSSInc Statistics17 Samples English demo.sav Click Open When opening a data file, two windows appear: SPSS Data Editor (above) and SPSS Viewer (below). Results from running statistical procedures are shown in SPSS Viewer -- tables, graphs or text (including script commands).

Read data from an Access database: demo.mdb file in the SPSS Samples directory. In the File menu Open Database New Query

A Database Wizard Welcome dialog box appears. Select MS Access Databases. Click Next. An ODBC Driver Login window appears. Type the path to the database to open, or click browse and proceed as before with opening data files. Select dataset demo.mdb. Page 5 of 27

A Database Wizard dialog box opens with a Select Data window allowing you to select the tables and variables you want to import from the Available Tables panel on the lefthand side. If all you see is the demo table, then click on the "+" inside the box next to it to view all available variables (fields) in the dataset (table).

Select all available by highlighting the database name demo at the top of the list and click the add button with the arrow pointing to the right. Your selections will appear in the Retrieve Fields panel on the right-hand side. You may deselect individual fields by clicking on them and then clicking the deselect arrow pointing to the left. When you are finished selecting variables and tables, click the Next button at the bottom of the window. A Limit Retrieved Cases windows opens in which you may select the records (cases) to import. If you only want to import a subset of the records in the database, you may specify a rule or set of rules for extracting the subset. You can also opt to select a random sample from the database. If you want all data imported, then select no options in this window. Click Next to continue.

A Define Variables window allows you to edit the variable Name and Data Type before importing. A Recode to Numeric box will appear next to string variables. By checking this box, string variable values will be recoded to integer values while

Page 6 of 27

retaining the original string values as labels. Click the Recode to Numeric next to Gender.

Click Next to continue. The SQL statement created from your selections in the Database Wizard appears in the Results window. This SQL command can be executed now or saved for later use. To execute it now, click the Finish button to retrieve the data.

All of the data in the Access database that you selected to import now appear in an SPSS Data Editor window.

SPSS Data File Structure.


SPSS data files structure assumes that variables are arranged in columns and individual cases (records) in rows, and can be viewed through the Data View window in Data Editor. This tabular format is the typical arrangement for most statistical packages. The names of the variables appear as headers of each column. If not supplied, SPSS will provide default variables names VARxxxxx, where xxxxx is a sequentially specified Page 7 of 27

number with leading zeroes beginning with VAR00001, VAR00002, and so on. SPSS also provides row numbers along the left-hand margin of the table.

Variable Profiles.
SPSS provides for storage, specification and editing of variable attributes. This enables you to fully document your variables and provide labels for display purposes. Internally SPSS is designed to act on numbers. SPSS recommends that you encode all character data with numbers, usually integers. Variable profiles are viewed and edited in the Variable View window and include up to 10 variable attributes for each variable: Name, Type, Width, Decimals, Label, Values, Missing, Columns, Align and Measure. These attributes are listed as column headers in Variable View.

The name and other attributes of each variable appear across rows, with one row per variable. When creating a variable in Variable View (and in the absence of data), SPSS uses a default profile: Name (if not specified, will use default VARxxxxx), Type = numeric, Width = 8, Decimals = 2, Labels (blank), Values = None, Missing = None, Columns = 8, Align = Right, Measure = Scale. When entering data values into Data View without first specifying the variable attributes, SPSS will create an assumed profile based on the first data value entered. For example, if the first data value is all letters, then SPSS assumes that the variable is string. Variable Name. Like most statistical software packages, SPSS has constraints on the structure of variable names. These constraints include not only those created within Data Editor, but those imported with datasets from other sources. Care should be taken when transferring data from one software package format into another, as naming conventions vary, and what is allowed in one format may not be allowed in another. SPSS variable naming rules are: 1. The default variable name is a prefix VAR and a sequential 5-digit number (VAR00001, VAR00002, etc.) 2. Name lengths cannot exceed 8 characters. 3. Names must begin with a letter. Remaining characters may be any letter, any digit, or the symbols @, #,_, or $. 4. Variables cannot end in a period. 5. Blanks and special characters (e.g. !, ?. , and *) are not allowed. 6. Each variable name must be unique; duplication is not allowed. Page 8 of 27

7. Variable names are not case sensitive. The names VAR0001, Var00001 and var0001 are identical to SPSS. 8. Certain keywords cannot be used as variable names: ALL, AND, BY, EQ, GE, GT, LE, LT, NE, NOT, OR, TO, WITH. Open a new Data Editor window. In File menu New Data In Window menu notice 3 windows appear at the bottom: two SPSS Data Editors (demo.sav and Untitled) and one SPSS Viewer. Output from each of the Data Editor analyses will be displayed in the (single) SPSS Viewer in the order in which they are generated, so output may be interleaved. Variable Type. The Windows version of SPSS provides for creation of eight commonly used data types, but will allow additional types to be imported from other applications. These eight types are: numeric, comma, dot, scientific notation, date, dollar, custom currency and string. In the new Data Editor, click on a cell under the column titled Type in Variable View, and click on the button that appears in the cell. SPSS automatically creates a default profile and a Variable Type window appears. Within this window, you may select the variable type and adjust related options. Numeric, comma, dot, scientific notation, dollar and custom currency options are width and decimal places. Many date format options are available. String has only one option -the number of characters. Variable input formats determine how raw data is stored and output formats determine how data is displayed. For numeric, comma, and dot formats, you can enter values with any number of decimal positions (up to 16), and the entire value is stored internally. The Data View displays only the defined number (as specified in Variable View) of decimal places and rounds values with more decimals. However, the complete value for these data types is used in all computations. Numeric A variable whose values are numbers, can include a leading + or -,

Page 9 of 27

and a decimal indicator. The default decimal indicator is a period ".", but other symbols can be chosen for this indicator. The maximum width is 40 characters, and the maximum number of decimal places is 16. Comma A numeric variable whose values are displayed with commas delimiting every three places and displayed with the period as a decimal delimiter. The Data Editor accepts numeric values for comma variables with or without commas or in scientific notation. Values cannot contain commas to the right of the decimal indicator. Dot A numeric variable whose values are displayed with periods delimiting every three places and with the comma as a decimal delimiter. The Data Editor accepts numeric values for dot variables with or without periods or in scientific notation. Values cannot contain periods to the right of the decimal indicator. Scientific Notation A numeric variable whose values are displayed with an embedded E and a signed power-of-10 exponent. The Data Editor accepts numeric values for such variables with or without an exponent. The exponent can be preceded by E or D with an optional sign or by the sign alone--for example, 123, 1.23E2, 1.23D2, 1.23E+2, and 1.23+2. Date A numeric variable whose values are displayed in one of several calendar-date or clock-time formats. Select a format from the list. You can enter dates with slashes, hyphens, periods, commas, or blank spaces as delimiters. The century range for twodigit year values is determined by your Options settings (from the Edit menu, choose Options, and then click the Data tab). Internally, dates are stored as the number of seconds from October 14, 1582. Prior to 1582, every year divisible by 4 was a leap year. Since a year contains only 365.242199 days (slightly less than 365.25 days), an error of ten days accumulated over the centuries. To compensate for this error, Pope Gregory XIII (after whom the Gregorian Calendar is named) decreed that the ten days between October 5, 1582 and October 14, 1582 would be eliminated from the calendar. This made October 1582 the shortest month, with only 21 days. After 1582, years divisible by 100 are not leap years unless they are also divisible by 400. Thus, 1900 is not a leap year, but 2000 is. Perpetual Calendar by Herb Weiner, http://www.wiskit.com/calendar.html Dollar A numeric variable displayed with a leading dollar sign ($), commas delimiting every three places, and a period as the decimal delimiter. You can enter data values with or without the leading dollar sign. Custom Currency A numeric variable whose values are displayed in one of the custom currency formats that you have defined on the Currency tab of the Options Page 10 of 27

dialog box. Defined custom currency characters cannot be used in data entry but are displayed in the Data Editor. String A variable whose values are not numeric and therefore are not used in calculations. The values can contain any characters up to the defined length. Uppercase and lowercase letters are considered distinct. This type is also known as an alphanumeric variable. All values are right-padded to the maximum width. For a string variable with a maximum width of three, a value of No is stored internally as 'No ' (a blank is padded on the right) and is not equivalent to ' No' (blank is padded on the left). Creating Variable Profiles. First, activate the Variable View window in the new Data Editor, then select the first empty cell under the Name column. Type in the word Group for the variable name and press enter. SPSS automatically populates the remaining attributes according to the default profile. You may now customize any of the attributes by first selecting the cell in the row under the heading of the attribute to be changed.

As you create this profile in Variable View, a corresponding column is created in Data View. No data will appear in this column, but may be entered later by opening a dataset, direct manual data entry, or via copy/cut and pasting from other datasets. Note: If you copy and paste data from applications such as Excel, and the data you copy includes a variable header (name), then SPSS will assume that this header is a data value. If the data is numeric and the header is character, then the first cell of the pasted column will appear as a missing value whenever that column in Data View corresponds to a variable with a predefined profile in Variable View. If the header appears to SPSS as numeric, then it will appear as a data value in the first cell. Enter 123456789 in the first cell under Group in Data View. Notice that the column next to Group has a grayed-out header called var. This means that there is no variable profile for this column and it can be freely used to create a new variable. Now enter "Hello" in the first cell of the second column and press enter. SPSS has provided a default name (VAR00001) for the variable in the second column and a profile in Variable View, which is different from the default profile it provided for Group. VAR00001 has a Page 11 of 27

variable type of string with a width of 5 and the decimals value is grayed out, since this attribute is not applicable to string variables. SPSS automatically determines variable attributes based on the data entered in Data View, if not already defined in Variable View. Here SPSS decided that VAR00001 must be a string variable and allocated a width of 5, since Hello contains 5 characters.

If we wish to enter additional data under VAR0001 that has more than 5 characters, we will need to increase the width or the data will be lost. In Data View, add " out there" to "Hello." What happens? In Variable View, select the second cell under width corresponding to VAR0001 and change the 5 to 15. Now, in Data View, again add " out there" to "Hello." What happens?

Inserting variables.
Select row 10 in Variable View and in the Edit menu Insert Variable.

SPSS automatically fills out the additional rows with default variable names and profiles. And in Data View, there will be corresponding columns created for each new variable. You can also copy an existing variable profile and paste it in an empty row to create a new variable with that same profile, but with a different name.

Deleting Variables.
Variables may be deleted in Data View by selecting the appropriate column(s) right click the mouse cut. Page 12 of 27

Delete the previously created variable named Group and notice that it is removed from both Data View and Variable View. Alternately, you may delete variables within Variable View by selecting the row corresponding to the variable to delete right click clear. This will also delete the corresponding column of data in Data View. Select row 8 and right click to choose clear. Notice that VAR0008 no longer appears in Data View.

Deleting Records.
An individual record (or contiguous rows of records) may be deleted in Data View by selecting the row(s) corresponding to the record(s) right click the mouse clear. Deleting records does not affect profile entries in Variable View, even if all records are deleted in Data View. Delete the first record with "Hello out there" in the first column. This record is deleted, but the Variable Profile is left unchanged. Editing Variable Profiles. Variable profiles may be changed in Variable View by first selecting the table cell of the profile attribute to be changed (column) corresponding to a given variable (row). To change Type for the first variable, select String Numeric.

When you selected Numeric, a new Variable Type window appears allowing you to change the Width and Decimal Places, which may also be changed in Variable View. Change Width to 8 and Decimal Places to 2 OK.

Page 13 of 27

In Variable View, the Measure attribute is unchanged. Change Measure to scale by clicking on the cell containing nominal and selecting scale from the drop-down menu. Next set Columns from to 8 and Align to Right. All eight variables in Variable View should have the same attribute values. Some Effects of Changing Variable Profiles. This example will serve to illustrate some of the effects of changing variable types after data has been entered. In Data View, type 123456789 in the first cell under VAR0001 right click this cell copy. Select the first cell under each of the other 7 variables by sweeping across right click paste. The first cell under each variable should have the value 123456789.0. Go back to Variable View and change the Type for each (except VAR0001) as follows: VAR0002 Comma OK VAR0003 Dot OK VAR0004 Scientific OK VAR0005 Date OK VAR0006 Dollar OK VAR0007 Custom OK VAR0008 String OK

Now go to Variable View and change VAR0008 back to numeric. What is the data value in Data View? Changing between measurement types can cause loss of information in some instances. In this case the number 123456789.0 was changed to 120000000.

Page 14 of 27

Change VAR00005 Type from Date to String and then back to Numeric. What is the data value in Data View for VAR00005? Close the current Data Editor and open a new one. Variable Measure. Another important variable attribute is measure, which indicates whether the ordering of the data values and/or the distance between them is meaningful. Numeric data has a natural ordering and the distance between values is meaningful. For example, if our variable is Miles from Downtown, then we know that a house located 1.5 miles from downtown is less distance than one located 6.2 miles from downtown, and the distance between the two houses is 6.2 - 1.5 = 4.7 miles. However, suppose we have a variable named Job Satisfaction, where the data values are coded as 5 = "Very satisfied", 4 = "Satisfied", 3 = "Neither satisfied nor dissatisfied", 2 = "Dissatisfied", and 1 = "Very dissatisfied." We have a natural ordering of these values, but distance between values is no longer a measurable (meaningful) quantity. These coded values were chosen arbitrarily, and we could just as easily have chosen a different set of numbers, such as {1, 2, 5, 7, 10}. SPSS provides for three measurement levels that can be specified in Variable View: scale, ordinal and nominal. Scale. A scale variable has numeric values whose ordering is meaningful and equal distances between measurements correspond to equal differences in the amount of the attribute being measured. In our example above, Miles from Downtown is a scale variable. Ordinal. An ordinal variable is one in which values have a natural ordering, but the distance between adjacent values is either not measurable or provides no information about the actual differences of the attribute being measured. In our example above, Job Satisfaction is an ordinal variable. We can calculate a difference between the coded values, but this difference is not a true measure of the distance between the real values. We could just as easily used the actual labels as the values. Nominal. A nominal variable (also known as categorical) is one in which the values indicate non-overlapping groups with no information about the ordering of the groups or distance between them. Examples of nominal variables are: gender, ethnicity, automobile make, states in the United States, etc. Adding Variable Labels. SPSS provides two attributes for adding labels to be used when displaying analysis results: Label and Values.

Page 15 of 27

The Label attribute stores the preferred name of the variable to be used instead of the variable name (VAR00001 etc.) that is stored in the Name attribute. This overcomes the naming constraints imposed on the variable Name attribute, as outlined above. The Values attribute allows you to provide labels for the different levels of the data values themselves. In Variable View, click on the first empty cell under Label. Enter "Gender." All other attributes have been given default values. Now select the cell next to it under Values and click to open the Value Labels window.

Enter 0 in the Value text box Male in the Label text box click the Add button. Now enter 1 in Value text box Female in Label text box click the add button OK. Male and Female will now be used as labels when outputting results rather than 0 and 1. Male and Female are the value labels, and 0 and 1 the data values for the variable VAR00001 with name label Gender. Missing Values. Recall that each row is a record (subject), and each designated column is a variable with data that has been collected corresponding to the subject. Sometimes we may not have data for all variables for one or more subjects. A missing value is a lack of data for some variable corresponding to a subject. This is a common problem in many application areas and frequently happens in surveys when a respondent only answers some (but not all) of the questions. SPSS recognizes two different types of missing values: System-missing values. SPSS uses the decimal indicator as the missing value indicator for all cells that are blank (either . or ,).

Page 16 of 27

User-missing values. The user may also specify one or more missing value indicators, often used to flag reasons for the missing data. For example, suppose you are conducting a clinical trial where patients come into a research center every month for testing (blood work, blood pressure, etc.) The researcher may use -99 to indicate those values that are missing because an instrument recording a particular variable malfunctioned during the testing, and may use -999 to indicate that the subject failed to keep a scheduled appointment for a particular testing session. If user missing values are defined, then SPSS will show a breakdown of the missing values by reason when outputting summary data counts or percentiles. User missing values may be defined via the Missing attribute in Variable View. Click on a cell under this column and a Missing Values window appears with three options for user specified missing values:

No missing values - No user-missing values. All values treated as valid. This is the default. Discrete missing values - User can specify up to three discrete (individual) user-missing values for a variable. You can define discrete missing values for numeric or short string variables. Range plus one discrete missing value - All values between low and high values are flagged as missing, as well as one discrete value outside the range. Not available for short string variables.
Note: A short string variable is a string variable whose width is 8 or less.

Close the Untitled Data Editor In File menu Close and select the demo.sav Data Editor window. Display Labels instead of Values. SPSS allows you to toggle between viewing the data values used internally for computation and any labels specified. Sometimes viewing the labels makes data exploration a little easier. Using the demo.sav Data Editor In the View menu Value Labels Page 17 of 27

Or you can use the Value Labels button in the toolbar at the top. Data Values view Value Labels view

Working with Multiple Data Sources.


Close SPSS and reopen it. File menu Open Data

Find the demo.sav file and reopen it. My Computer C: drive Program Files SPSSInc Statistics17 Samples English demo.sav. From the demo.sav Data Editor, open Employee data.sav. File menu Open Data Employee data.sav. Three windows are now open, two Data Editor windows and one SPSS Viewer window called Output1. To activate a dataset, simply click on its Data Editor window. Only one dataset may be active at a time. Only the variables in the active dataset are available for analysis. However, data can be copied from one dataset to another and then used for analysis with that dataset. Transferring Variable Profiles between Data Editors. Variable profiles may be copied from one dataset to another. Copy Variable Profiles in Employee data.sav: Activate Employee data.sav Activate Variable View Select rows 2 4 Right click mouse Copy

Page 18 of 27

Paste profiles in empty rows in demo.sav: Activate demo.sav Activate Variable View Select rows 30 32 Right click mouse Paste

Notice that SPSS gave VAR00001 as the name of the first variable instead of Gender. This is because demo.sav already has a variable named Gender and SPSS does not allow two variables to have the same name. Transferring Data Values between Data Editors. Copy Data Values in Employee data.sav: Activate Employee data.sav Activate Data View Select columns 2 4 Right click mouse Copy

Paste data in appropriate columns in demo.sav: Activate demo.sav Activate Variable View Select columns 30 32 (named VAR0001, bdate and educ) Right click mouse Paste

Page 19 of 27

The data should now appear in the data.sav columns. In this case, there are fewer cases in Employee data.sav than in demo.sav. Scroll to row 474 in data.sav. This is the extent of the Employee data.sav records. All rows beyond this are flagged as having missing values ("."). SPSS Viewer. Results from running a statistical procedure are shown in the SPSS Viewer. This can be tables, charts, graphs or text (include script commands). Close Employee data.sav and activate the Viewer. The text in the windows are the SPSS commands to open the two datasets that we just opened. and to close Employee data.sav.

Summary Statistics for Categorical Data.


Categorical data is data in which each individual is assigned to a category and encompasses both ordinal and nominal data types. Categorical data is also referred to as qualitative data. For this type of data, common summary statistics are often reported for each individual category in additional to overall statistics. SPSS Frequency procedure is designed to provide this type of summary for categorical variables. In the Analyze menu Descriptive Statistics Frequencies A Frequencies dialog window will open allowing you to select the variables to analyze. We are going to choose Owns PDA (ownpda) and Owns TV (owntv) by selecting each and clicking on the add arrow in the middle of the dialog box. The arrow changes direction depending whether a variable is selected in the right- or left-hand panel. Thus, variables can be returned to the left-hand side to deselect them.

Page 20 of 27

Click on the Statistics button in the upper righthand corner of the Frequencies dialog box. You can now add the statistics that you want, in addition to the counts, for each variable. Select the mean and Std. deviation (standard deviation). and click continue. When finished selecting variables and options, click OK.

Frequency tables will now be added to the SPSS Viewer window, in addition to the commands used to generate them.

Creating and Editing Charts.


SPSS provides a Chart Builder to enable the user to generate and customize a wide assortment of graphical displays. To invoke Chart Builder In the Graphs menu Chart Builder

Page 21 of 27

The Chart Builder window appears. It consists of three zones: Variables list, Chart preview window and chart building tools in a tabbed area at the bottom. We will construct a Bar Chart. Choose the Gallery tab in the tools zone (at the bottom), if not already selected. Drag the first graph icon in the first row to the Chart previewer and drop it.

Find Job Satisfaction in the Variables list. Right click on Job Satisfaction.

Job Satisfaction shows as a scale variable, but should be an ordinal variable as it's values are 1 = "Highly dissatisfied," 2 = "Dissatisfied," 3 = "Neutral," 4 = "Satisfied," and 5 = "Highly satisfied." You can temporarily change a variable's type within Chart Builder without affecting its variable profile in Variable View. The ruler icon to the left of Job satisfaction in the Variables list indicates it is a scale variable. Ordinal variables have a bar chart icon to their left. Nominal have three circles. To change Job Satisfaction's type, select ordinal. A bar chart should now appear to the left of Job Satisfaction in the Variables pane. Drag Job Satisfaction to the Chart Previewer and drop it in the XAxis? box. Count is automatically provided as the Y-Axis label.

Page 22 of 27

Adding a Title to a graph. Click on the Titles/Footnotes tab in the lower zone of Chart Builder. Check the Title1 box. This chart element has been added to the Elements Properties window. You may now enter a chart title in the Content text box in the Element Properties window.

Enter "Distribution of Job Satisfaction" and click the Apply button. "T1" appears at the top of the bar chart as a placeholder for the title you just entered. The title does not appear in Chart Builder, but will display when the chart is generated by clicking the OK button in the Chart Builder window. After clicking this OK button, the bar chart and SPSS commands are added to SPSS Viewer. Y-axis values also appear after the chart is generated. SPSS Viewer. SPSS Viewer has two panes. The right-hand pane collects all SPSS commands and output. The lefthand pane is an outline of all work during this session. To view previous work, such as the Frequencies output, click on Frequencies. To hide Frequencies, click on the "-" box next to it in the left-hand pane.

Exporting output. Output may be exported to the following file formats: Excel (*.xls, HTML (*.htm), Portable Document Format (*.pdf), Power Point (*.ppt), Text (*.txt), or Word/RTF Page 23 of 27

(*.doc). Additionally, graphs may be exported to PNG file (*.png), Bitmap (*.bmp), Enhanced Metafile (*.emf), Encapsulated Postscript (*.eps), JPEG (*.jpg), or Tagged Image File (*.tif). The default is to export to a Word document.
Note: Export to PowerPoint is only available with on Windows operating systems and is not available with the student version.

In SPSS Viewer, select the output you wish to export by left clicking on it. In the upper left-hand corner, you can opt to export everything in the Output window of SPSS Viewer, All visible (open books in the outline pane), or Selected (objects selected in the Output window). Left click on the chart in the SPSS Viewer Output window. Select the type of output desired in either the Document or Graphics area by using the pulldown menu under Type. (If your output is textual only, the graphics selection area will be grayed out.) Browse to the directory on your computer where you wish to store the output and give the output a name. When finished, click OK. In the case of nongraphical output, the storage designation will be in the File name text box. Click on Selected in the Output to Export area. In the Type menu, select None (Graphics only). Now you may select a Graphics Type, such as jpeg, png, etc. and designate a place to store the graphic along with its name in the Root File Name. You may also copy and paste output to Excel, Word or PowerPoint. SPSS Syntax. SPSS Syntax files are used to store scripts for later use. You may customize your output and later wish to use the same sequences of commands on a new dataset. Open a new syntax file by Page 24 of 27

In Data Editor or SPSS Viewer File menu New Syntax

An SPSS Syntax Editor window opens. In the SPSS Viewer, select the commands you wish to store in the syntax file, copy and paste them into the right-hand syntax pane.

Right click on the commands to open and close the two files: demo.sav and Employee data.sav Left click Copy, and to generate the Frequency output. Paste into the Syntax file. The left-hand pane shows the commands without the parameter specifications. Save this syntax file as Syntax demo.sps (remember where you saved it). Close all SPSS files, including the syntax file. Now find Syntax demo.sps and double click on it. This invokes SPSS and opens the syntax file.

To run the syntax file In the run menu All Page 25 of 27

This should open the two datasets and close Employee data.sav leaving only demo.sav open, and then it will run the Frequency command. However, in SPSS 17 this no longer works. In the Syntax window, left click to the left of the command to open the Employee.sav dataset and the two commands to close the two *.sav files. Res dots should appear to the left of these three command lines. The red dots indicate that these commands have been deselected. To run the commands that are selected, choose Selection from the Run menu.

This will open the demo.sav file and run the Frequencies analysis.

Page 26 of 27

APPENDIX A: SPSS/PASW 17.0 & 18.0 System Requirements


SPSS/PASW Statistics All Super VGA (800x600) or a higherresolution monitor CD-ROM drive Windows Microsoft Windows XP (32-bit versions) or Vista (32-bit or 64-bit versions) Intel or AMD x86 processor running at 1GHz or higher For connecting with PASW Statistics Base Server, a network adapter running the TCP/IP network protocol Internet Explorer 6 or above Mac OS X Intel processor Minimum free drive space: 800MB Java Standard Edition 5.0 (J2SE 5.0) Linux Intel or AMD x86 processor running at 1 GHz or higher Minimum free drive space: 800MB Kernel 2.6.9.42 or higher glibc 2.3.4 or higher XFree86-4.0 or higher libstdc++5 Konqueror 3.4.1 or higher, or Firefox 1.0.6 or higher, or Netscape 7.2 or higher Minimum free drive space: 650MB Minimum free drive space: 800MB Base 17.0 512MB RAM; 1GB recommended version 18 1GB RAM or more recommended

Apple Mac OS X 10.4 (Tiger) or Mac OSX 10.5 (Leopard) Safari 1.3.1, Mozilla Firefox 1.5 or higher, or Netscape 7.2 or higher

Apple Mac 10.5x (Leopard) and 10.6x (Snow Leopard). (32-bit and 64-bit) Safari 32 bit Only Kernel 2.6.26.25 Glibc 2.8 XFree86-4.7 Libstdc++6 Mozilla Firefox

Page 27 of 27

Potrebbero piacerti anche