9
SPSS Cheat Sheet 1. Start SPSS by executing Start|Programs|SPSS Inc|SPSS Statistics 17.0 (the vertical line denotes clicking on the option presented by the previous menu) 2. Get data. How you do this will depend on the format in which your data have been saved. A. Data on hardcopy (for which you have no copy on diskette) i. Click on “Variable View” in the bottom left corner ii. To name and label a variable: In the variable’s row, click on the cell below “Name” and type the variable name; click on the cell below “Label” and type the label for this variable iii. To insert variable category values: In the variable’s row, click on the cell below “Values,” click on the ellipses (…), type the value under “Value” and the value label under “Value Label,” click “Add;” repeat for all values for the variable; click “OK” iv. Click on “Data View” in the bottom left corner v. Place cursor in cell, type in data for that cell, and hit [Enter] B. When data are in ACSII format (i.e., saved as a .txt file) i. execute command File|Read Text Data ii. type filename in the File name field, check that location and file type are as they should be, click Open. The “Text Import Wizard” dialog box will appear iii. follow the instructions for Steps 1-4 (typically, you will choose “no” under “Predefined format” in Step 1, “Fixed width” and “No variable names at top” in Step 2, and “first case on line 1”, “each line represents one case”, and “import all cases” in Step 3). At each step, check that the data look properly formatted in the preview screen at the bottom of the dialog box.

SPSS Cheat Sheet - Indiana Universityphp.spea.iupui.edu/aholmes/h518/spsscheatsheet.doc · Web viewThe first category is graphs that are generally used for nominal data (e.g., bar

Embed Size (px)

Citation preview

SPSS Cheat Sheet

1. Start SPSS by executing Start|Programs|SPSS Inc|SPSS Statistics 17.0 (the vertical line denotes clicking on the option presented by the previous menu)

2. Get data. How you do this will depend on the format in which your data have been saved.

A. Data on hardcopy (for which you have no copy on diskette)

i. Click on “Variable View” in the bottom left cornerii. To name and label a variable: In the variable’s row, click on the cell below “Name” and

type the variable name; click on the cell below “Label” and type the label for this variableiii. To insert variable category values: In the variable’s row, click on the cell below “Values,”

click on the ellipses (…), type the value under “Value” and the value label under “Value Label,” click “Add;” repeat for all values for the variable; click “OK”

iv. Click on “Data View” in the bottom left cornerv. Place cursor in cell, type in data for that cell, and hit [Enter]

B. When data are in ACSII format (i.e., saved as a .txt file)

i. execute command File|Read Text Dataii. type filename in the File name field, check that location and file type are as they should

be, click Open. The “Text Import Wizard” dialog box will appeariii. follow the instructions for Steps 1-4 (typically, you will choose “no” under “Predefined

format” in Step 1, “Fixed width” and “No variable names at top” in Step 2, and “first case on line 1”, “each line represents one case”, and “import all cases” in Step 3). At each step, check that the data look properly formatted in the preview screen at the bottom of the dialog box.

iv. Under Step 5: Click on V1 and type in first variable name in box at top, click on V2 and type in second variable name…. When all variables are done, click <Next>

v. Under Step 6: click “Finish” (do not save file format or paste syntax)

Note: if you want to add variable labels, click “Variable View” and proceed as with hard copy data.

C. When data are saved preformatted (e.g., in SPSS as *.sav, or Excel as *.xls)

i. execute File|Open|Data; type filename in File Name field, check that location and file type are as they should be, click Open

Note: for Excel files, you need to note whether the first line in the spreadsheet is made up of variable names or data.

3. Run Program

Running a program in SPSS 17.0 involves selecting the type(s) of statistics you want to calculate from the tool bar at the top of the screen, and the variables you want to analyze in the subsequent dialog box. There are three basic types of analyses you may perform.

A. Data Transformation

To manipulate variables, click on “Transform” on the top menu bar. You can perform most manipulations using either Transform|Compute or Transform|Recode (the former works best for continuous variables, the latter for discrete variables).

i. Compute - in the case of Transform|Compute, you have to put the name of the new variable under “Target Variable” (e.g., “Y”) and the algebraic expression that generates the new variable under “Numeric Expression” (e.g., a+b*X). The “If” option may be employed if you want the transformation to be performed only for certain cases (e.g., for those cases where Z>0).

ii. Recode – in the case of Transform|Recode, you have to decide whether to recode an existing variable (the risky option) or create a new variable (the safer option). In the latter case, you put the original variable in the dialog box on the left, the name of the new variable in the dialog box in the upper right, and click “Old and New Values.” A second dialog box will appear in which you identify the value (or range of values) for the old variable on the left, and the value for the new variable on the right, then click “Add” (in the example below, the original range of 1 to 10 is assigned a 1, while the range 11-20 is assigned a 2). When you have entered all the recoding algorithms, click “Continue” and “OK.”

B. Graph Generation

i. Creating Graphs. To create graphs to summarize variables, click on “Graphs|Legacy Dialogs” on the top menu bar. The options that appear are grouped into four categories, roughly corresponding to the level of measurement of the variable you are trying to describe. The first category is graphs that are generally used for nominal data (e.g., bar chart, pie chart); the second category is used mostly for ordinal data (e.g., the boxpot), and the third category is graphs used for interval data (e.g., the histogram and time trend). Once you select a chart type, you may be presented with a list of options (generally, the default setting is what you want), then a dialog box that allows you to choose the variable to be summarized:

i. bar chart – put the variable to be described into the “Category Axis” boxii. pie chart – put the variable to be described into the “Define Slices by” boxiii. histogram – put the variable to be described into the “Variable” box

Bar Chart Pie Chart Histogram

ii. Editing Graphs. When you create a graph in SPSS, the chart will appear in a separate window called the Output Editor. If you double click the image in the Output Editor, you will be transferred to a Chart Editor window in which you can change the formatting of your graph. Generally, if you click in the area you want to edit, a formatting box will appear that will allow you to do so (note that some formatting boxes have multiple tabs). For instance, in the image below, the area to the left of the vertical axis was clicked, causing the dialog box that allows changes to the vertical axis labels, ticks, scale etc. to appear. By choosing the scale tab in this box, you can change the origin or other features of the vertical axis.

Clicking near the horizontal axis will similarly allow you to change the format along that axis, whereas clicking in the interior of the graph will allow you to change the appearance of the image itself (color, shading). Legends and titles can be inserted using the icons in the menu bar at the top of the window. When you have the graph appearing as it should, just close the Chart Editor window by clicking on the upper right X, and the changes will be saved automatically in the Output Editor window.

C. Statistical Analyses

The statistical analysis tools used in this class fall under three broad categories: descriptive statistics, t-tests, regression, and non-parametric statistics (the latter is used for Chi-squared tests of goodness of fit).

i. Descriptive Statistics – click Analyze|Descriptive Statistics|Frequencies, and a dialog box will appear. Transfer the variables you want described from the list on the left to the “Variable[s]” box on the right, click on Statistics, and choose the summary statistics that are appropriate (see below). Click “Continue” and “OK” to produce the desired output (note: if you have many different values, you may want to de-select the “Display Frequency Tables” or you will get a table with every single value and its corresponding frequency in your output).

ii. t-tests – SPSS will perform one sample, independent sample, and dependent sample (paired) t-tests. Any of these can be achieved by clicking Analyze|Compare Means and choosing the appropriate t-test (see below). The resulting dialog box will ask for the variable(s) being assessed and, in the case of the one-sample t-test, a value of interest (the “test value”). Note that the output generated will include a “Sig” value – this is the two-sided p-value. If you want to perform a one-sided test, you need to divide this value by 2.

iii. regression – SPSS performs a variety of regression analyses, but we will primarily be interested in ordinary least squares (OLS), or linear regression. To perform such an analysis, click Analyze|Regression|Linear, and put the dependent variable (y) in the dependent variable box at the top of the dialog box, and your independent variables (the x’s) in the Independent[s] box (see below). To save predicted values, click the “Save” box below, and select “Unstandardized” under “Predicted Values.”

iv. Chi-square tests – SPSS stores the Goodness of Fit test under Non-parametric statistics. To obtain such a test, you need to click Analyze|Non-parametric tests|Chi-square, and move the variable being tested into the dialog box. Note that you have the option of performing a test of constant proportions (the default) or non-constant proportions (under “Expected values,” choose “Values” and enter the target proportions according to the number assigned to each category of interest, starting with the lowest).

Note that the Chi-squared test for dependence is located under the crosstabs option under Descriptive Statistics, not under non-parametric tests.

Descriptive statistics t-tests Linear regression

Note: SPSS has a feature that can be very handy when conducting analyses. If you right click on a variable name in a dialog box, it will provide a brief description of that variable, including its label and level of measurement. This feature is particularly helpful in data sets with multiple variants of the same concept.

4. Prepare your output for distribution

SPSS output has two serious limitations: (1) it will include a large amount of information extraneous to your analysis and (2) you cannot add interpretation to the numbers produced. We can overcome both these shortcomings by taking advantage of the compatibility of SPSS 17.0 and Microsoft Word. To transfer SPSS output to a Word document:

a. in the output viewer, place cursor inside box of output you want to transfer to a Word document and click (a box will appear around the output that will be transferred)

b. execute Edit|Copy c. open Microsoft Wordd. type title, name etc., in the Word document; create a space for the SPSS outpute. put cursor in space where you want SPSS output, execute Edit|Paste (if you want to convert a

table of statistics to an image, click on the Paste option in the upper right corner and select one of the picture file options)

Although convenient, for many applications, you are better off entering the output into a properly formatted table to improve readability.

5. Final note

SPSS 17.0 has an on-line help facility that can be useful when you are not sure how to perform a certain test. You can use the online help feature by executing the command Help|Tutorial. In particular, you may want to review

“Help|Tutorial|datafile” (Reading Text Data Files covers ASCII data as above)“Tutorials|Getting Data|Basic Structure of an SPSS Data File” “Tutorials|Creating Tables and Calculating Statistics|Selecting a Procedure”“Tutorials|Using Results in Other Applications|Pasting Results as Metafiles”“Tutorials|Getting Help”