spss instruction manual final - purdue...

16
1 STAT 301 SPSS Instruction Manual This manual is to be used as a reference for aid in using SPSS for labs and homework assignments in this class.

Upload: others

Post on 08-Jul-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

1  

               

 STAT 301 

 SPSS Instruction Manual 

                       

   This manual is to be used as a reference for aid in using SPSS for labs and homework assignments in this class.   

Page 2: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

2  

 Table of Contents 

Topic  Related Chapter  Page Number 

Initial Data Entry    3 

SavingOutput    4 

Selecting a Simple Random Sample 

  5 

Graphs/Plots  Chapter 1  6 

Descriptive Statistics  Chapter 1  8 

T‐test Hypothesis Test and Confidence Interval  

Chapter 7  9 

One Way ANOVA  Chapter 12  10 

Two‐Way ANOVA  Chapter 13  11 

Correlations and Regression (both Simple and Multiple)  

Chapter 2 and 10/ Chapter 11 

13 

Chi‐Square  Chapter 2.5 and 9  16 

Page 3: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

3  

Initial Data Entry  

Open SPSS on ITap Computers:  Start ‐> Programs ‐> Standard software ‐> Statistical packages ‐> SPSS 22.0 ‐> SPSS 22.0 for Windows   

Entering Data Manually:  In the left bottom corner of the SPSS Data Editor, choose the “Data View” tab.  Enter your data values for each variable in a single column.  If you have additional variables to enter, use an additional column.    Naming Variables including type and length:  

In the left bottom corner of the SPSS data editor, choose the “Variable View” tab.  Enter the name for the first set of data in first row.  Choose the type of variable, number of decimals, and/or the width of the variable. 

 

Opening Excel files: As you open SPSS close the window that asks “what would you like to do?” In the SPSS Data Editor click onFile and choose Open and then choose Data. In Files of Type select Excel. Browse to access your Excel file and select it into File name and then click Open. Check Read variable names from the first row of data if that is the case in your Excel file and then click OK.  Opening .txt files from Perdisco in SPSS: 

1. Save the file to your desktop a. Dowload Data b. Copy and Paste the data into WordPad c. Save the file as a .txt document to your desktop 

2. Open SPSS 3. Press Cancel 4. Press the File Button to open data 

a. Scroll down within “Files of type:”  i. Choose .txt files 

b. Select your data c. Press Open 

5. Click Next 6. Press Delimited 7. Click Next 8. Click Next 9. Tell it comma delimited 10. Click Next 11. Change your variable name to X 12. Click Next 13. Click Finish 

  

Page 4: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

4  

Saving Output:  Putting SPSS Output into Labs:  You may copy (CTRL‐C) Paste Special the outputs (graphs, tables …) needed and paste them (Edit Picture) into Microsoft Word to edit.   Before you print your Word document you need to type your name and lab section/time in the top right hand corner, and then attach it to your Lab paper.  

Copying graphs from SPSS into Word:  

Edit outputs as needed (as stated in the instructions).  Copy (CTRL‐C) the outputs (graphs, tables, etc.) needed and paste them (EditPaste Special as Picture) into Microsoft Word to edit.  PNG is one format that works. 

Page 5: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

5  

Selecting a Simple Random Sample  

Taking a SRS or randomly select units for treatment groups in an experiment:  

1. At the top of the screen, click Data  Select Cases.  The “Select Cases” window will appear. 2. Click “Random sample of cases”.  Then click on “Sample”.  The “Select Cases: Random Sample” 

window will appear. 3. Click “Exactly [ ] cases from the first [ ] cases” and fill in “number of cases you want to select at 

random” and“out of how many cases you want the selection to be(if you want to select out of all cases in your sample you will write the number corresponding to the sample size” in the two boxes respectively.   

a. Click Continue  OK. 4. You will see a new variable “filter_$”.  The selected cases for your sample or treatment group 

are those with filter_$ being equal to 1. 5. Write down your results for the sample and the mean of this sample before performing the next 

sample.       

Page 6: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

6  

Graphs/Plots:  Bar Graph: 

1. Enter the data in one column, name the variable and define the variable as “string”. When you input your data this way, you do not need to weight the cases. 

2. Graphs ‐> Legacy Dialogs ‐> Bar ‐> Simple ‐> Check “Summaries for groups of cases” ‐>  Define. 

a. Move the variable name into “Category Axis” ‐> OK 3. Double click on the graph to enter Chart Editor. 

i. Click on one bar in order to select them all.  This should be in the Properties Screen. 

1. If not, select Edit ‐> Properties ‐> ii. Choose the Fill & Border tab ‐> Click on Fill ‐> Choose the color you want ‐> 

Choose the pattern you like  ‐> Click Apply iii. Choose the Categories tab ‐> Sort by : Statistic, Direction: Descending ‐> 

Apply ‐> Close and Close the window.  

Pie Chart: 1. Enter the data in one column, name the variable and define the variable as “string”. When 

you input your data this way, you do not need to weight the cases. 2. Graphs ‐> Legacy Dialogs ‐>Pie ‐> Check “Summaries for groups of cases” ‐>  Define. 

a. Move the variable name into “Define Slices by:” b. In the Slices Represent Box 

i. Check “% of cases” c. Press OK 

3. Double click on the graph to enter Chart Editor. a. Click on Elements at the top of the window 

i. Click on “Show Data Labels” 1. This will show the percent in each slice 

b. Click on Options at the top of the window i. Click on “Title” ii. Enter the Title for the pie chart 

4. Click outside the window to exit Chart Editor  

Histogram: 1. Analyze‐> Descriptive Statistics‐> Explore.  

a. Move the variable name into “Dependent List” b. Click on Plots 

i. Select “Histogram” ii. Click Continue 

c. Click OK.  

   

Page 7: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

7  

Boxplot: 1. Graph‐>Legacy Dialogs‐>Boxplot. 

a. Select “Simple” b. Click Define 

i. Move the variable name into “Variable:” box. ii. Click OK 

  

Normal Quantile Plot and Histogram:  

1. Analyze  Descriptive Statistics  Explore.   2. Move the variable over to the “Dependent List” box.   3. Click on the “Plots” button.  4. Check the box for “Histogram” and for “Normality plots with tests.”   5. Hit “Continue” and then “OK.”   6. You want the “Normal Q‐Q Plot” (not the detrended plot). 

 

Page 8: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

8  

Descriptive Statistics:  Calculate the Mean:  

1.  At the top of the screen, click Analyze > Descriptive Statistics ‐> Descriptives.  2. Click on your variable, then click on the right arrow to move this variable into the variable box at 

the right. Click OK. 

 Mean/ Median/ Standard Deviation/ Histogram/ Stem‐and‐Leaf Plots/ Boxplots: 

2. Analyze ‐> Descriptive Statistics ‐> Explore. a. Move the variable name into “Dependent List:” b. Click on Statistics 

i. Check “Descriptives” ii. Click Continue 

c. Click on Plots i. Choose Plots of Interest 

1. Stem‐and‐Leaf or Histogram 2. If you want/need a boxplot 

a. Choose Factor Levels together b. Otherwise Click None 

ii. Click Continue d. Click OK 

.   

 5‐Number Summary:   Note: Must be done by Hand!  SPSS might give slightly differing results   It may be helpful to use SPSS to sort the data for you. 

 Sort Data: 

1. Data ‐> Sort Cases. a. Move the variable name into “Sort By:” b. Sort order 

i. Ascending c. Press OK 

 

Page 9: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

9  

T‐test Hypothesis Tests and Confidence Intervals:   

One Sample T‐test  

1.  Analyze  Compare means  One‐Sample t test  2.  Move the variable into the “Test Variable(s)” box. 

3.  Type the value of  0   under   0H   into the “Test Value” box. 

4.  By default, it will also give you the 95% confidence interval.   a.    To change the confidence level, you may click “Options” on the right bottom corner of 

the “One‐Sample T Test” window and then change it.. 5.  Continue  OK. 6.  In the output, the P‐value, Sig. 2‐tailed, is for two‐sided test.  

a.    If you have a one‐sided t test, your test P‐value should be (Sig. 2‐tailed)/2. 7.  The one sample t confidence interval = (Test value + Lower, Test value + Upper) 

  

Matched Pairs T‐test 1. Analyze  Compare Means  Paired‐Samples T‐test 2. Move the two variables A and B into “Paired Variables” box. 3. Click on “OK”. 

  

Two‐sample comparison of means (independent samples test) 1. Analyze  Compare Means Independent‐Samples T Test 2. Move  the numerical variable(this  is  the  response variable which values are measured  for  the 

entities in both samples)to the “Test Variable(s)” box 3. Move  the  string  variable  into  “Grouping  Variable”  (this  is  a  categorical  variable  with  two 

different values corresponding to the two different groups) 4. Click on “Define Groups” 

a. Input group names into the two group boxes respectively i. Must be the same as how they show up in the dataset.  

5. If needed: Click Options a. Change default 95% to 90% or 99%. 

6. Click Continue 7. Click on “OK”. 

(We don’t assume equal variances, always use bottom row)  

Other notes: 1. Please make sure your inequality matches the order in which the variables are subtracted in 

SPSS, otherwise your test statistic will be the opposite of what you expect it to be. 2. If you have a two‐sided hypothesis test, you should use the P‐value given in SPSS. 3. If you have a one‐sided hypothesis test, use a graph to determine whether one‐tail of the 

graph is shaded or “all but one tail” is shaded.  If only one tail is shaded, the P‐value is determined by dividing the SPSS P‐value by 2.  If all but one tail is shaded, the P‐value is determined by dividing the SPSS P‐value by 2 and subtracting the result from 1. 

Page 10: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

10  

One Way ANOVA:  Input data format: 

1. Define a categorical variable with as many different values as the groups under study 2. Define a quantitative variable corresponding to the response variable. Each value of the 

response would correspond to one of the values of the categorical variable 

Side by Side Boxplot: 1. Graphs ‐> Legacy Dialog ‐> Boxplot ‐>Simple ‐> Summaries for Groups of Cases 

a. Define i. Move variable of interest (the response variable)into “Variable” box ii. Move grouping variable (the categorical variable or factor) into “Category 

Axis” box 2. Click OK 

 

One Way ANOVA/ Bonferroni 1. Add acolumn for a numeric variable(VAR0003 in example below).  

a. Represent each group with its own numeric representation. So that value 1 would be at the same rows as value “first name of group” (Jersey in example below) in the 

column that has your categorical variable. 

b.    

2. Analyze ‐>Compare Means‐>One‐Way ANOVA a. Move response variable of interest into “Dependent List” box b. Move New numerical grouping variable (VAR0003 in example above)into “Factor” 

box c. Click on Post Hoc 

i. Check Bonferroni box ii. Press Continue 

d. Click on Options i. Check “Means Plot”  ii. Check “Descriptive Statistics” box iii. Continue 

e. OK  

Page 11: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

11  

Two Way ANOVA: 

 Two Way ANOVA: 

1. Analyze ‐> General Linear Model ‐> Univariate a. Move response variable of interest into “Dependent Variable” box b. Move two factors (there are two categorical variables corresponding to the two 

factors under study)into “Fixed Factors” box. c. Click Plots 

i. Move one factor into “Horizontal Axis” box ii. Move second factor into “Separate Lines” box iii. Click “Add” button to move that combination to the bottom box iv. Click Continue 

d. Click Options i. Move both factors into “Display Means for” box 

1. Check Descriptive Statistitics ii. Click Continue 

e. Click OK  Note: For the example below, if you want to switch the stick width categories on the x‐axis, you can double‐click on the means plot to go to “Chart Editor.” Then double‐click on one of the widths in the x‐axis.  Click on the “Categories” tab in the “Properties” window.  Click on one width at a time, and then the up or down arrows to move it up or down the list.  When finished, click “Apply” and then “Close.”  “X” out of the “Chart Editor” window to get back to the regular output file.  Then you can copy and paste the means plot into a Word document.  

      

Page 12: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

12  

Below is how the variables would be defined in SPSS:   

 

Page 13: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

13  

Correlations and Regression (both Simple and Multiple) 

 Scatterplot with Regression Line: 

1. Graphs ‐> Legacy Dialogs ‐> Scatter/Dot ‐> Simple/Scatter*‐>Define a. Choose X (independent/explanatory variable) and Y (dependent/response variable) 

according to the problem b. Click OK 

2. Copy and Paste into Output before continuing 3. Adding regression line 

a. Double click on the scatterplot in the output…this opens the Chart Editor Window i. Click on any point in the plot once, so that all points become circled ii. Click on the “add fit line at total” icon (add icon with scatterplot and a LSR 

line) on the top of the chart editor. iii. The LSR line will be added. 

b. Close Chart Editor Window *For multiple regression, you may want a scatterplot matrix : Choose Matrix/Scatter and include all variables 

 

Correlation and hypothesis tests for correlation: 1. Analyze ‐> Correlate ‐> Bivariate 2. Move variables into the box on the right by clicking on the arrow button 3. Click OK 

Use this Pearson’s correlation table to get the correlation and to do hypothesis tests for independence or correlation.   

Regression Equation/Normal probability plot/ Residuals/Predicted values/ Prediction Interval/ Test Statistic and P‐value for testing slope and intercept : 

1. Analyze‐>Regression‐>Linear a. Move response variable into “Dependent” box b. Move predictor into “Independent(s)” box c. Click Statisitcs 

i. Check “Confidence Intervals” box ii. Continue 

d. Click Plots i. Check “Normal Probability plot” box ii. Continue 

e. Click Save i. Check “Unstandardized” under “Residuals” ii. Check “Unstandardized” under “Predicted Values” iii. Check “Individual” under “Prediction Intervals” iv. Continue 

f. Click OK  

NOTE:  If you need the prediction interval for an x‐value not already in your data set, just type in the x‐value in the independent variable column of your data sheet.  Don’t type in anything for the y‐value.  Re‐run the regression, asking for the prediction interval.  If you already had prediction intervals on your data sheet, the new prediction interval will appear as LICI_2 and UICI_2. 

Page 14: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

14  

   

  

      

Screen shot of the “save” box of the regression setup.  Note which boxes are checked. 

This is what your data page looks like after you have run the regression.  “PRE_1” is the predicted value column.  “RES_1” is the residual column.  “LICI_1” and “UICI_1” are the lower and upper prediction intervals for individual scores. 

Page 15: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

15  

Residual Plot with Reference Line :Go back to the SPSS data Editor, you will find a column named “RES_1”, which are the saved residuals.     1. Graphs  Legacy Dialogs  Scatter/Dot  Simple Scatter Define      a. Let “Unstandardized Residuals” be Y  

b. Let explanatory variable be X.   c. Click OK  

  2. Adding reference line:   a. Double click on the scatterplot in the output, so that the “Chart Editor” window is 

popped up.     i. Click on “Options”  Y Axis Reference Line  Under the “Reference Line” tab, fill out “0” in the “Position”   Then click “Apply” and close the Editor Window. 

Page 16: SPSS Instruction Manual Final - Purdue Universityjtroisi/STAT301Fall2014/SPSSInstructionManual.pdfSPSS, otherwise your test statistic will be the opposite of what you expect it to

16  

Chi Square Test: Note: If only given counts and not raw data need to do the following steps before the test: 

1. Enter the data into SPSS in three columns, Factor 1, Factor 2, and Count” 2. Weight Cases.  

a.  Data  Weight Cases.   i. Then click on “Weight cases by”  

1. Move “Count” (the numeric variable) into the “frequency variable” box.   2. Then click on “OK.”   

(The step is completed correctly if the statement “Weight by Count” is in the output window.) If your count table looks funny, this is the step you forgot. 

 Create Tables: 

1. Analyze ‐> Descriptive Statistics ‐> Crosstabs. a. Put first categoricalvariable into the “Rows” box b. Put second categoricalvariable into the “Columns” box c. For Counts table, Click OK d. For Chi‐Square test statistic and p‐value 

i.  Click “Statistics” 1. Check “Chi‐Square” 2. Click Continue 

e. For percentage table: i. Click “Cells” 

1. Check “Total” box under Percentages 2. Click Continue 

f. OK   

Bar Graphs for Conditional Distributions: 1. Graphs ‐> Legacy Dialogs ‐> Bar ‐> Simple ‐> Define. 

a. Bars Represent “% of Cases” b. Put Factor 1 in the “Category Axis” c. Put Other Factor in the “Panel By Columns” box d. Press OK