Go back to the Home Page or go to some specific Examples Using SPSS for Windows

You may visit the SPSS Home Page here or contact SPSS by phone at 1-800-543-2185

More information about using SPSS is available here.

Using SPSS Version 12.0

Table of Contents

I. Entering SPSS, Printing from SPSS, and Exiting SPSS

II. Data Files

A. Creating Data Files

B. Editing Existing Data Files

III. Descriptive Statistics

A. Frequencies and Numerical Summaries

B. Correlation, Least Squares Line, and Residuals

C. Graphical Displays

IV. Inferential Statistics

A. One-Sample t Test

B. Paired t Test and Wilcoxon z Test

C. Two-Sample t Tests and Mann-Whitney z Test

D. One-Way ANOVA and Kruskal-Wallis Chi-Square Test

E. Repeated Measures ANOVA and Friedman's Test

F. Two-Way and Higher-Way ANOVA

G. Chi-Square Goodness-of-Fit Test

H. Chi-Square Test about Independence

I. Tests with Linear Regression and Correlation

 


Some Facts to Remember about SPSS:


I. Entering SPSS, Printing from SPSS, and Exiting SPSS

To enter SPSS:

Select the appropriate option(s) from the Start button, or double click on the appropriate SPSS icon to enter SPSS for Windows.

To print from SPSS:

To print data or to print output, select the File> Print options.

To exit from SPSS:

Select the File> Exit options.

II. Data Files

 II-A. Creating Data Files

To begin a new data file:

Select the File> New> Data options. A brand new data file will appear on the screen as several rows and columns of blank cells. There will be a Data View sheet which contains the actual data and a Variable View sheet which contains information about the variables in the data. By clicking on the appropriate tab at the bottom of the screen, one can toggle between these two sheets.

To define a new variable:

Go to on the Variable View sheet (by clicking on the appropriate tab at the bottom of the screen) where all information about variables is stored. Enter the variable name in the next available blank cell in the Name column; only names with eight or less characters beginning with a letter will be accepted. All variable names will be displayed as column headings in the Data View sheet. A longer more descriptive name for a variable may be entered in the cell which is in the Label column of the row corresponding to the variable; this is the name which will appear in output.

From the different columns of the Variable View sheet, it is also possible to define the type of variable (this is Numeric in most cases and String for case labels) set decimal place display for a variable, define codes for a variable, define a missing value code for a variable, set the size of the column corresponding to a variable, and align the display of the values of a variable.

To define codes:

In the Variable View sheet, click on the cell in the Values column which is in the row of the variable for which codes are to be defined. Notice that a button appears in the right hand side of the cell; click on this button, after which the Value Labels dialogue box is displayed. Enter a code in the Value slot, enter the corresponding label in the Value Label slot, and click the Add button. You may use the Change and Remove buttons to make alterations to your coding scheme. Click on the OK button when you are finished. Once codes have been defined, you may choose to have the labels displayed or not displayed by selecting the View> Value Labels options from the main menu.

Sometimes, you may want to define exactly the same coding scheme for a large number of existing variables. (For instance, you may want to define 1=never, 2=sometimes, and 3=always for 20 variables named Q1, Q2, Q3, ..., Q20.) If you want to enter the coding scheme simultaneously for each variable instead of for each variable separately, you can use a syntax file by performing the following steps:

(i) Select the File> New> Syntax options to enter the SPSS Syntax Editor;

(ii) In the blank screen, type the following SPSS commands (with appropriate substitutions for the italicized phrases):

VALUE LABELS variable name, variable name, ..., variable name,

code value 'label name' code value 'label name' ... code value 'label name'.

(iii) If you want to save a copy of the syntax file (which will have an .sps extension) for future reference, use the File>Save As options; it is a good idea to give the syntax file the same name as the data file for which it was created. (For example, if your data file is named survey.sav, then a corresponding syntax file can be named survey.sps; in the event that you anticipate creating more than one syntax file, you may choose the name survey1.sps for the first syntax file, the name survey2.sps for the second syntax file, etc.)

(iv) Once you use the File> Close options to exit from the SPSS Syntax Editor, you may use the File> Open> Syntax options to open any syntax file.

(v) Once you have opened a data file and a corresponding syntax file, select the Run>All options from the SPSS Syntax Editor. (If the screen looks distorted after running the commands in a syntax file, simply scroll the distortion off the screen, and when you scroll back everything should look normal again.)

To save data in an SPSS data file:

Select the File>Save options or the File>Save As options, making certain that the file is saved in the desired directory.

II-B. Editing Existing Data Files

To open an existing data file:

Select the File> Open> Data options, making certain that the desired directory is accessed.

To delete a variable:

Click on the column heading in the Data View sheet with the name of the variable to be deleted, and select the Edit> Clear options; or click on the row heading in the Variable View sheet with the name of the variable to be deleted, and select the Edit> Clear options. 

To recode values of a variable:

Select the Transform> Recode options, after which you will have a choice of recoding into the same variable or recoding into a new variable. Once the variable(s) to be recoded are selected and, if necessary, the new variable names are entered, the Old and New Values button can be used to accomplish the recoding.

To select specific cases:

Select the Data> Select Cases options, after which the Select Cases dialogue box is displayed. By selecting the If condition is satisfied option and clicking on the If button, the Select Cases: If dialogue box is displayed. A formula which defines the cases to be selected can now be entered.

To create variables by using transformation:

Select the Transform> Compute options, after which the Compute Variable dialogue box is displayed. Once the new variable name is entered in the Target Variable slot, a formula to calculate the values for the new variable can be entered in the Numeric Expression slot. Unfortunately, once you create a new variable using the Transform> Compute options, the formula used to create the new variable will be lost. If you want to keep a record of the formula used to create a new variable, you can use a syntax file by performing the following steps:

(i) Select the File> New> Syntax options to enter the SPSS Syntax Editor;

(ii) In the blank screen, type the following SPSS commands (with appropriate substitutions for the italicized phrases):

EXECUTE .

COMPUTE name for new variable = formula .

.

.

.

COMPUTE name for new variable = formula .

EXECUTE .

(iii) Use the File>Save As options to save the commands in an SPSS syntax file (which will have an .sps extension); it is a good idea to give the syntax file the same name as the data file for which it was created. (For example, if your data file is named survey.sav, then a corresponding syntax file can be named survey.sps; in the event that you anticipate creating more than one syntax file, you may choose the name survey1.sps for the first syntax file, the name survey2.sps for the second syntax file, etc.)

(iv) Once you use the File> Close options to exit from the SPSS Syntax Editor, you may use the File> Open> Syntax options to open any syntax file.

(v) Once you have opened a data file and a corresponding syntax file, select the Run> All options from the SPSS Syntax Editor. You will then see the new variable created in your data file as the SPSS commands execute. (If the screen looks distorted after running the commands in a syntax file, simply scroll the distortion off the screen, and when you scroll back everything should look normal again.)

(vi) You may or may not choose to save your data file with the new variable(s) added. If you choose not to save the data file, you can create the new variables any time you wish by simply running the syntax file commands again. This will be necessary if you ever make changes to the data which affect the values of the new variable(s).

III. Descriptive Statistics

 III-A. Frequencies and Numerical Summaries

To list the distinct values of a variable together with corresponding frequencies:

Select the Analyze> Descriptive Statistics> Frequencies options, after which the Frequencies dialogue box is displayed. Frequency distributions will be constructed for the variables whose names are selected and placed into the Variable(s) slot. The results will be displayed in an output window after clicking the OK button.

To obtain numerical summaries for all data:

Select the Analyze> Descriptive Statistics> Descriptives options, after which the Descriptives dialogue box is displayed. Numerical summeries will be obtained for the variables whose names are selected and placed into the Variable(s) slot. Click on the Options button to enter the Descriptives: Options dialogue box where variables and various descriptive numerical summaries can be selected; click on the Continue button to return to the Descriptives dialogue box. The results will be displayed in an output window after clicking the OK button.

OR

Select the Analyze> Descriptive Statistics> Frequencies options, after which the Frequencies dialogue box is displayed. Both frequency distributions and numerical summaries will be displayed for the variables whose names are selected and placed into the Variable(s) slot. Click on the Statistics button to enter the Frequencies: Statistics dialogue box where various descriptive numerical summaries can be selected; click on the Continue button to return to the Frequencies dialogue box. The results will be displayed in an output window after clicking the OK button.

To obtain numerical summaries for separate groups:

Select the Analyze> Compare Means> Means options, after which the Means dialogue box is displayed. In the Independent List section, place the names of the variables which define the desired groups; in the Dependent List section, place the names of the variables for which numerical summaries are to be calculated. Click on the Options button to enter the Means: Options dialogue box where variables and various descriptive numerical summaries can be selected; click on the Continue button to return to the Means dialogue box. The results will be displayed in an output window after clicking the OK button.

To construct a contingency table:

Select the Analyze> Descriptive Statistics> Crosstabs options, after which the Crosstabs dialogue box is displayed. The row and column variables are defined by selecting and placing the appropriate variable names into the Row(s) and Column(s) slots. Click on the Cells button to enter the Crosstabs: Cell Display dialogue box where row and/or column percentages can be selected; click on the Continue button to return to the Crosstabs dialogue box. The results will be displayed in an output window after clicking the OK button.

III-B. Correlation, Least Squares Line, and Residuals

To obtain correlations:

Select the Analyze> Correlate> Bivariate options, after which the Bivariate Correlations dialogue box is displayed. In the Variables section, place the names of the variables between which correlations are desired; in the Correlation Coefficients section, select the type(s) of correlation(s) desired (Pearson, Kendall's tau-b, Spearman); at the bottom of the dialogue box, the option of selecting Flag significant correlations is available; in the Test of Significance section, the option of displaying one-tailed P-values or two-tailed P-values is available. The results will be displayed in an output window after clicking the OK button.

To obtain a least squares regression equation and the corresponding predicted values and residuals:

Select the Analyze> Regression> Linear options, after which the Linear Regression dialogue box is displayed. In the Dependent slot, enter the name of the Y variable; in the Independent(s) section, enter the name(s) of the X variable(s). Make certain that Enter is displayed in the Method slot. To create two new variables, one containing the predicted values and one containing the residuals, click on the Save button to display the Linear Regression: Save dialogue box; in the Predicted Values section select Unstandardized, and in the Residuals section select Unstandardized. Click on the Continue button to return to the Linear Regression dialogue box. The results will be displayed in an output window after clicking the OK button.

III-C. Graphical Displays

To construct a boxplot for one variable or multiple boxplots, one for each of several variables all measured using the same units on the same items:

Select the Graphs> Boxplot options, after which the Boxplot dialogue box is displayed. Select the Simple option and the Summaries of separate variables option, and click on the Define button, after which the Define Simple Boxplot dialogue box is displayed. Place the appropriate variable name(s) into the Boxes Represent slot. (If there is more than one variable, the variables should all be measured using the same units.) After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, by selecting the Chart> Transpose Chart options in the chart editor window, you can switch the orientation of the boxplot(s) between horizontal and vertical. (You can leave the chart editor window by selection the File> Close options.)

To construct multiple boxplots corresponding to different groups for one variable:

Select the Graphs> Boxplot options, after which the Boxplot dialogue box is displayed. Select the Simple option and the Summaries for groups of cases option, and click on the Define button, after which the Define Simple Boxplot dialogue box is displayed. Enter the appropriate variable name into the Variable slot, and enter the appropriate variable name into the Category Axis slot. After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, by selecting the Chart> Transpose Chart options in the chart editor window, you can switch the orientation of the boxplot(s) between horizontal and vertical. (You can leave the chart editor window by selection the File> Close options.)

To construct a bar chart:

Select the Graphs> Bar options, after which the Bar Charts dialogue box is displayed. Select the Simple option and the Summaries for groups of cases option, and click on the Define button, after which the Define Simple Bar dialogue box is displayed. Place the appropriate variable name into the Category Axis slot. In the Bars Represent section, select what the bar heights will represent, which could be N of cases to designate raw frequency, % of cases to designate relative frequency, or Other summary function to designate a function, such as the mean, of some selected variable (using the Variable to designate the variable and the Change Summary button to designate a function other than the mean). After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. (You can leave the chart editor window by selection the File> Close options.)

To construct a stacked bar chart:

Select the Graphs> Bar options, after which the Bar Charts dialogue box is displayed. Select the Stacked option and the Summaries for groups of cases option, and click on the Define button, after which the Define Stacked Bar dialogue box is displayed. Place the appropriate variable name into the Category Axis slot, and place the appropriate variable name into the Define Stacks by slot; in the Bars Represent section, select what the bar heights will represent. After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, to make all bars the same height, which makes it easier to compare relative frequencies, first double click on one of the bars in the stacked bar chart to display the Properties dialog box, next select the Bar> Options tab in the dialog box, then click on the Change scale to 100% option, and finally click on the Apply button followed by the Close button. (You can leave the chart editor window by selection the File> Close options.)

To construct a pie chart:

Select the Graphs> Pie options, after which the Pie Charts dialogue box is displayed. Select the Summaries for groups of cases option, and click on the Define button, after which the Define Pie dialogue box is displayed. Place the appropriate variable name into the Define Slices by slot. In the Slices Represent section, select what the bar heights will represent, which could be N of cases to designate raw frequency, % of cases to designate relative frequency, or Other summary function to designate a function, such as the sum, of some selected variable (using the Variable to designate the variable and the Change Summary button to designate a function other than the mean). After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, to display labels for each slice of the pie, first click on the pie chart to select it, and then select the Chart> Show Data Labels options to display the Properties dialog box. In the Properties dialog box, select the Data Value Labels tab, and use the arrow keys on the right to make certain that Count, Percent, and the proper variable name are all displayed in the Contents section.  Finally, click on the Apply button followed by the Close button. (You can leave the chart editor window by selection the File> Close options.)

To construct a histogram:

Select the Graphs> Histogram options, after which the Histogram dialogue box is displayed. Place the appropriate variable name into the Variable slot. After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window, where the interval lengths and scales can be adjusted..(You can leave the chart editor window by selection the File> Close options.)

To construct a scatterplot (with the least squares line, if desired):

Select the Graphs> Scatter options, after which the Scatterplot dialogue box is displayed. Select the Simple option and click on the Define button, after which the Simple Scatterplot dialogue box is displayed. Place the appropriate variable name into the Y Axis slot, and place the appropriate variable name into the X Axis slot. After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, to display the least squares line on the scatterplot, click on one of the points in the scatterplot, after which all the points will be selected.  Then, select the Add Chart Element> Fit Line at Total options, after which you should see the least squares line on the scatterplot; you can just click the Close button in the dialog box which is displayed. (You can leave the chart editor window by selection the File> Close options.)

To construct a scatterplot with one X variable and two or more Y variables all measured using the same units on the same items:

Select the Graphs> Scatter options, after which the Scatterplot dialogue box is displayed. Select the Overlay option, and click on the Define button, after which the Overlay Scatterplot dialogue box is displayed. Select the X variable, select a Y variable and place this pair of variable names into the Y-X Pairs section, clicking on the Swap Pair button as necessary; repeat this process until each desired Y variable has been paired with the X variable. After clicking the OK button, the chart will be displayed in an output window. Different color points will be used to distinguish between different Y variables. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, each Y variable series can be represented with points displayed in various shapes. (You can leave the chart editor window by selection the File> Close options.)

To construct a residual plot:

Select the Graphs> Scatter options, after which the Scatterplot dialogue box is displayed. Select the Simple option and click on the Define button, after which the Simple Scatterplot dialogue box is displayed. Place the variable name of the residuals into the Y Axis slot, and place the appropriate variable name into the X Axis slot. After clicking the OK button, the chart will be displayed in an output window. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. For example, to add a horizontal line at zero (0), click on one of the points in the plot, after which all the points will be selected.  Then, select the Add Chart Element> Fit Line at Total options, after which you should see the horizontal line at zero (0) on the plot; you can just click the Close button in the dialog box which is displayed. (You can leave the chart editor window by selection the File> Close options.)

To construct an interaction plot:

CHECK??????????Select the Graphs> Line options, after which the Line Charts dialogue box is displayed. Select the picture corresponding to Drop-line, and click on the Define button. In the Define Drop-line dialogue box which is displayed, select one of two categorical variables for the Category Axis slot (often the categorical variable with the larger number of categories), and select the second categorical variable for the Define Points by slot. In the Points Represent section of the dialogue box, select Other summary function; then, place the desired numerical variable in the Variable section. (The default summary function is the mean, since this is used most often, but the Change Summary button can be used to select a different summary function.) The chart will be displayed in an output window after clicking the OK button. To make modifications to this chart, double click on the chart in order to display it in a chart editor window. (You can leave the chart editor window by selection the File> Close options.)

To edit an existing chart:

Double click on the chart to display the chart in a chart editor window; the available options will depend on the type of chart. Various options can be accessed either by double clicking on various parts of the chart in the editor window or by selecting various parts of the chart and making selections from the menu at the top of the editor window. (You can leave the chart editor window by selection the File> Close options.)

IV. Inferential Statistics

IV-A. One-Sample t Test

To perform a one-sample t test:

Select the Analyze> Compare Means> One-Sample T Test options, after which the One-Sample T Test dialogue box is displayed. Place the name(s) of the variable(s) on which the test is to be performed in the Test Variable(s) section, and type the hypothesized value for the mean in the Test Value slot. The same hypothesized value will be used for all variables. The results will be displayed in an output window after clicking the OK button.

IV-B. Paired t Test and Wilcoxon z Test

To perform a paired t test:

Select the Analyze> Compare Means> Paired-Samples T Test options, after which the Paired-Samples T Test dialogue box is displayed. Select two variables both measured using the same units, and place this pair of variable names into the Paired Variables section; repeat this process until each desired pair of variables has been entered. The results will be displayed in an output window after clicking the OK button.

To perform a Wilcoxon z test:

Select the Analyze> Nonparametric Tests> 2 Related Samples options, after which the Two-Related-Samples Tests dialogue box is displayed. Select two variables both measured using the same units, and place this pair of variable names into the Test Pair(s) List section; repeat this process until each desired pair of variables has been entered. Make certain that Wilcoxon is selected in the Test Type section of the dialogue box. The results will be displayed in an output window after clicking the OK button.

IV-C. Two-Sample t Tests and Mann-Whitney z Test

To perform a two-sample t test:

Select the Analyze> Compare Means> Independent-Samples T Test options, after which the Independent-Samples T Test dialogue box is displayed. In the Test Variable(s) section, place the name(s) of the variable(s) on which the test is to be performed; in the Grouping Variable slot, place the name of the variable which defines the two groups being compared. Click on the Define Groups button, and in the Group 1 and Group 2 slots type the numerical codes used to define the two groups being compared. The results will be displayed in an output window after clicking the OK button.

To perform a Mann-Whitney z test:

Select the Analyze> Nonparametric Tests> 2 Independent Samples options, after which the Two-Independent-Samples Tests dialogue box is displayed. In the Test Variable List section, place the name(s) of the variable(s) on which the test is to be performed; in the Grouping Variable slot, place the name of the variable which defines the two groups being compared. Click on the Define Groups button, and in the Group 1 and Group 2 slots type the numerical codes used to define the two groups being compared. Make certain that Mann-Whitney U is selected in the Test Type section of the dialogue box. The results will be displayed in an output window after clicking the OK button.

IV-D. One-Way ANOVA and Kruskall-Wallis Chi-Square Test

To perform a one-way ANOVA:

Select the Analyze> Compare Means> One-Way ANOVA options, after which the One-Way ANOVA dialogue box is displayed. In the Dependent List section, place the name(s) of the variable(s) on which the test is to be performed; in the Factor slot, place the name of the variable which defines the groups being compared. By clicking on the Options button, and then selecting the Descriptive option and the Homogeneity-of-variance option in the One-Way ANOVA Options dialogue box, the mean and standard deviation for each sample and the results of of Levene's test for equality of variance will be included in the output; click on the Continue button to return to the One-Way ANOVA dialogue box. To include the results of multiple comparison with the output, such as the results from Bonferroni's method, Tukey's method, or Scheffe's method, click the Post Hoc button in the One-Way ANOVA dialogue box, and select the desired options; click on the Continue button to return to the One-Way ANOVA dialogue box. The results will be displayed in an output window after clicking the OK button.

To perform a Kruskal-Wallis chi-square test:

Select the Analyze> Nonparametric Tests> K Independent Samples options, after which the Tests for Several Independent Samples dialogue box is displayed. In the Test Variable List section, place the name(s) of the variable(s) on which the test is to be performed; in the Grouping Variable slot, place the name of the variable which defines the groups being compared. Click on the Define Groups button, and in the Minimum and Maximum slots type respectively the smallest and largest numerical codes used to define the groups being compared. Make certain that Kruskall-Wallis H is selected in the Test Type section of the dialogue box. The results will be displayed in an output window after clicking the OK button.

IV-E. Repeated Measures ANOVA and Friedman's Test

To perform a repeated measures ANOVA:

Select the Analyze> General Linear Model> Repeated Measues options, after which the Repeated Measures Define Factor(s) dialogue box is displayed. In the Within-Subject Factor Name slot, type a name which would be appropriate to describe the variable which is repeatedly measured on each item or subject; then, in the Number of Levels slot, type the number of measurements of that variable on each item or subject. Click on the Add button, after which the name followed by the number of levels in parenthesis should appear in the first line of a list in the middle of the dialogue box. Additional names of variables for which repeated measurements were made along with corresponding numbers of levels can be added. Click on the Define button after which the Repeated Measures dialogue box is displayed. In the Within-Subjects Variables section, you should see a slot for each level of each repeated variable; in each slot, place the name of the corresponding variable from the data. The results will be displayed in an output window after clicking the OK button.

(Note: If there are any Between Subjects Factors, the results of multiple comparison can be included with the output, such as the results from Bonferroni's method, Tukey's method, or Scheffe's method, by clicking the Post Hoc button in the Repeated Measures dialogue box, selecting the desired options, selecting the desired factors, and clicking on the Continue button to return to the Repeated Measures dialogue box..)

To perform Friedman's test:

Select the Analyze> Nonparametric Tests> K Related Samples options, after which the Tests for Several Related Samples dialogue box is displayed. In the Test Variables section, place the names of the variables which represent the repeated measurements of a given variable. Make certain that Friedman is selected in the Test Type section of the dialogue box. By clicking on the Statistics button and selecting the Descriptive option and the Quartiles option, the mean, standard deviation, and quartiles for each variable will be included in the output; click on the Continue button to return to the Tests for Several Related Samples dialogue box. The results will be displayed in an output window after clicking the OK button.

IV-F. Two-Way and Higher-Way ANOVA

To perform a two-way or higher-way ANOVA:

Select the Analyze> General Linear Model> Univariate options, after which the Univariate dialogue box is displayed. In the Dependent Variable slot, place the name of the variable on which the two-way ANOVA tests are to be performed; in the Fixed Factor(s) section, place the names of the two or more grouping variables which define the groups being compared. Click on the Options button to enter the Univariate: Options dialogue box; in the Factor(s) and Factor Interactions section, select the items corresponding to desired means, and click on the arrow pointing toward the Display Means for section of the dialogue box; click on the Continue button to return to the Univariate dialogue box. The results will be displayed in an output window after clicking the OK button.

IV-G. Chi-Square Goodness-of-Fit Test

To perform a chi-square goodness-of-fit test:

Select the Analyze> Nonparametric Tests> Chi-Square options, after which the Chi-Square Test dialogue box is displayed. In the Test Variable List section, enter the name of the categorical variable on which the test is to be performed. (More than one categorical variable name can be entered if the number of categories is the same for each variable to be tested, all these variables have the same coding scheme, and the same hypothesized proportions are being used for each variable.) If the hypothesized proportions are all equal, the All categories equal option in the Expected Values section can be selected; otherwise, enter the hypothesized proportions by first selecting the Values option in the Expected Values section, and then entering each hypothesized proportion in the Values slot followed by clicking on the Add button. The order in which the hypothesized proportions are entered must correspond to the ordering of numerical codes used to define categories. In order to define categories from ranges of values, the Use specified range option (instead of the Get from data option) can be selected in the Expected Range section. The results will be displayed in an output window after clicking the OK button.

IV-H. Chi-Square Test in a Contingency Table

To perform a chi-square in a contingency table:

Data must be available in one of two ways: (1) two columns each representing one categorical variable, or (2) three columns where two of the columns each represent one categorical variable and the remaining column contains the frequencies for each combination of categories defined by the other two columns; the column containing the frequencies must be used to weight the cases by using the Data> Weight Cases options. Select the Analyze> Descriptive Statistics> Crosstabs options, after which the Crosstabs dialogue box is displayed. The row and column variables are defined by selecting and placing the appropriate variable names into the Row(s) and Column(s) slots. Click on the Statistics button to enter the Crosstabs: Statistics dialogue box, and select the Chi-Square option in the upper left corner; click on the Continue button to return to the Crosstabs dialogue box. By clicking on the Cells button in the Crosstabs dialogue box, the Crosstabs: Cell Display dialogue box will be displayed where observed frequencies, expected frequencies, row percentages, column percentages, etc. can be selected; click on the Continue button to return to the Crosstabs dialogue box. The results will be displayed in an output window after clicking the OK button.

IV-I. Tests with Linear Regression and Correlation

To perform ANOVA with linear regression and correlation:

Refer to the the instructions in the section titled To obtain a least squares regression equation and the corresponding predicted values and residuals in section III-B (Correlation, Least Squares Line, and Residuals).

To perform tests with correlations:

Refer to the instructions in the section titled To obtain correlations in section III-B (Correlation, Least Squares Line, and Residuals).