Return to Bates College Homepage

Introduction to SPSS for the PC: Sample Analyses


Part 2: Sample Analyses

Within SPSS, analyses are generated using either menu selections or command syntax.  Below is a description of how to run some common statistical analyses using menu selections.  Following each description is the command syntax used to generate the same analyses along with a brief explanation of the commands (For more help on using syntax see: Tips for SPSS Syntax).  To generate the results utilized in these examples you will need to enter the raw data set using information in Setting up data files.
 

I.      Frequencies
II.     Graphing Procedures
III.    Descriptive Statistics
IV.    Regression
V.      Correlation
VI.    One-sample t-test
VII.    Two-sample t-test
VIII.   One-way ANOVA
IX.  Two-way ANOVA
X.    Chi-square
 

Rawdata


I.    Frequencies
Use: Frequencies can be used for checking data integrity and providing measures of central tendency and variability of the mean.  Both statistical and graphical output is provided.


 
 

Command Syntax for Frequencies:

FREQUENCIES
  VARIABLES=gender math
  /STATISTICS=STDDEV RANGE MINIMUM MAXIMUM MEAN MEDIAN MODE SKEWNESS SESKEW
  KURTOSIS SEKURT
  /HISTOGRAM  NORMAL .
FREQUENCIES - This line defines which analyses will run.  In this case, Frequencies is the command that will run the frequencies analysis.
  VARIABLES=gender math - The "/variables=" subcommand identifies which variables you would like to include in the analysis.
  /STATISTICS=STDDEV RANGE MINIMUM MAXIMUM MEAN MEDIAN MODE SKEWNESS SESKEW
  KURTOSIS SEKURT - The "/statistics=" subcommand identifies which statistics you would like to run.  A full list of the possible statistics can be found by referring to the help menu in SPSS (i.e., Select Help > Topics on the menu bar which will open the Help Topics window.  Click on the Index tab.  Type "frequencies" in the box.  Click on the Display button and a Topics Found window will appear.  Highlight Frequencies Command Syntax and click on the Display button.).
  /HISTOGRAM  NORMAL. - The addition of this line indicates that you would like to generate a histogram for each variable with a  normal distribution curve.  To generate a bar graph, pie chart, or percentiles refer to the help files.


Back to Sample Analyses list
 

II. Graphing Procedures
Use:  SPSS offers a variety of graphing procedures, which allow you to visually inspect your data for errors/problems and provide you with a visual snapshot of your results.  Although several graphs are available, only two common graphs will be outline below (scatter plots and bar graphs).

1. Scatter Plots can be used to display the correlation between variables.  For example, we could graphically represent the relationship between National Assessment of Educational Progress math and writing scores.



 

Command Syntax for Scatter Plots:

GRAPH
  /SCATTERPLOT(BIVAR)=math WITH write
  /MISSING=LISTWISE
  /TITLE= 'Scatter Plot for Math and Writing Scores'.


GRAPH
  /SCATTERPLOT(BIVAR)=math WITH write - The "/scatterplot(bivar)=" subcommand provides a scatterplot for two variables (i.e., math With write).
  /TITLE= 'Scatter Plot for Math and Writing Scores'. - The "/title=" subcommand allows you to title your graph.  Place your title between apostrophes.


2. Bar Graphs allow you to show the distribution of cases into particular categories.  To demonstrate we will examine the collapsed self-esteem score for men and women.


 

Command Syntax for Bar Graphs:

GRAPH
  /BAR(GROUPED)=COUNT BY esteem2 BY gender
  /TITLE= 'Self-Esteem Scores by Gender'.
GRAPH
  /BAR(GROUPED)=COUNT BY esteem2 BY gender - The "/bar(grouped)=" subcommand generates a bar chart by a particular group (in this case gender).  For a complete list of subcommands for other graphical procedures refer to the help menu in SPSS (i.e., Select Help > Topics on the menu bar which will open the Help Topics window.  Click on the Index tab.  Type "graph" in the box.  Graph will appear in the second box.  Highlight the Command Syntax under graph.  Click on the Display button.).
  /TITLE= 'Self-Esteem Scores by Gender'.
Back to Sample Analyses list
 

III. Descriptive statistics
Use: Descriptive statistics can be used for checking data integrity and providing measures of central tendency and variability of the mean.


Command Syntax for Descriptives:

DESCRIPTIVES
  VARIABLES=gender school write math total esteem esteem2 conf
  /STATISTICS=MEAN STDDEV MIN MAX.
Refer to the command syntax for frequencies for a description of these commands.
 Back to Sample Analyses list

IV.  Regression
Sample question:  Does confidence predict student’s total score on the National Assessment of Educational Progress test?  To answer this question, you can run a simple linear regression.


 


Command Syntax for Regression:

REGRESSION
  /STATISTICS=COEFF OUTS R ANOVA
  /DEPENDENT total
  /METHOD=ENTER conf.


REGRESSION
  /STATISTICS=COEFF OUTS R ANOVA - Refer to the command syntax for frequencies for an explanation of this subcommand.  To get a complete list of the statistics offered for the regression analysis refer to the help menu in SPSS (i.e., Select Help > Topics on the menu bar which will open the Help Topics window.  Click on the Index tab.  Type "regression" in the box.  Regression will appear in the second box.  Highlight the Command Syntax under regression.  Click on the Display button.).
  /DEPENDENT total - The "/dependent" subcommand identifies your dependent variable.
  /METHOD=ENTER conf. - The "/method=" subcommand identifies the type of regression analysis (enter runs the general regression) as well as identifies your independent or outcome variable(s).

Back to Sample Analyses list
 

V. Correlation
Sample question: Are there relationships between students' scores on the National Assessment of Educational Progress for math, their scores for writing, and their self-esteem? To answer this question, you can run a correlation analysis.



 

Command Syntax for Correlation:

CORRELATIONS
  /VARIABLES=math esteem write.
Refer to the command syntax for frequencies for a description of these commands.


Back to Sample Analyses list

VI. One-sample t-test
Sample question: Is body mass index in a sample of Lewiston fourth-graders different than 25 (which is the lower limit of "obese")? To answer this question, you can run a one-sample t-test comparing the mean body mass index in your sample to the standard value (25, in this case).
 




 

Command Syntax for Two-sample t-test:

T-TEST
/TESTVAL=25
/MISSING=ANALYSIS
/VARIABLES=bmi
/CRITERIA=CIN (.95) .

T-TEST
 / TESTVAL=25 - The "/testval=" subcommand identifies the value to which you're comparing your sample. In this case we type 25 since this is the standard BMI number that we are interested in comparing the sample to. 
  /VARIABLES=bmi. - The "/variables=" subcommand identifies the dependent variable on which you would like to run a t-test.


Back to Sample Analyses list

VII. Two-sample independent t-test
Sample question: Are there differences between males and females scores on the writing section of the National Assessment of Educational Progress? To answer this question, you can run a two sample independent t-test comparing the mean writing scores received by women to the mean scores received by men.
 



 

Command Syntax for Two-sample t-test:

T-TEST
  GROUPS=gender(1 2)
  /VARIABLES=write.
T-TEST
  GROUPS=gender(1 2) - The "/groups=" subcommand identifies the independent variable for your t-test.  In this case we type gender.  The numbers within the parentheses represent the possible values for the variable (in this case the possible values for gender are 1 and 2).
  /VARIABLES=write. - The "/variables=" subcommand identifies the dependent variables on which you would like to run a t-test.


Back to Sample Analyses list

VIII. One-way Analysis of Variance (ANOVA)
Sample question: Are there differences in students' self-reported confidence to participate in class discussions based on the type of high school attended? To answer this question you can run a one-way ANOVA, with confidence to participate in class as the dependent variable and high school type as the independent variable. Note that high school type is not a true independent variable because it was not experimentally manipulated.


 



 


Command Syntax for One-way ANOVA:

ONEWAY
  conf BY school
  /STATISTICS=DESCRIPTIVES
  /POSTHOC = TUKEY .
ONEWAY
  conf BY school - This statement indicates the independent and dependent variable to be utilized when conducting the One-way ANOVA.  The dependent variable is listed first followed by the independent variable with "By" separating the two.
  /STATISTICS=DESCRIPTIVES - Refer to the command syntax for frequencies for an explanation of this subcommand.  To get a complete list of the statistics offered for the One-way ANOVA refer to the help menu in SPSS (i.e., Select Help > Topics on the menu bar which will open the Help Topics window.  Click on the Index tab.  Type "Oneway" in the box.  Oneway will appear in the second box.  Highlight the Command Syntax under Oneway.  Click on the Display button.).
  /POSTHOC = TUKEY. - The "/posthoc=" subcommand will generate the post hoc test listed after the equal sign (in this case Tukey's).  For a complete list of post hoc tests refer to the One-way ANOVA Command Syntax in the SPSS help files.
Back to Sample Analyses list

IX. Two-way ANOVA
Sample question: Are there differences in students' writing scores based on their gender and levels of self-esteem? To answer this question you can run a two-way ANOVA, with writing scores as the dependent variable and gender and self-esteem as the independent variables.


 


Command Syntax for Two-way ANOVA:

UNIANOVA
  write  BY gender esteem2
  /PRINT = DESCRIPTIVE
  /DESIGN = gender esteem2 gender*esteem2.
UNIANOVA
  write  BY gender esteem2 - This statement indicates the independent and dependent variable to be utilized when conducting the Two-way ANOVA.  The dependent variable is listed first followed by the independent variable(s) with "By" separating the two.
  /PRINT = DESCRIPTIVE - The "/print=" subcommand operates similar to the "/statistic=" subcommand in the One-Way ANOVA.  To get a complete list of the statistics offered for the Two-way ANOVA refer to the help menu in SPSS (i.e., Select Help > Topics on the menu bar which will open the Help Topics window.  Click on the Index tab.  Type "UNIANOVA" in the box.  UNIANOVA will appear in the second box.  Highlight the Command Syntax under UNIANOVA.  Click on the Display button.).
  /DESIGN = gender esteem2 gender*esteem2. - The "/design=" subcommand identifies the main and interaction effects to be analyzed.  To examine main effects you just need to list the variable name (e.g., gender or esteem2).  To examine interaction effects you list the variables you want to interact with a "*" between the variables (e.g., gender*esteem2).

If you are interested in running post hoc tests the following subcommand could be entered between the "/print=" and "/design=" subcommands: /POSTHOC = gender (TUKEY).  This differs slightly from the One-way ANOVA in that the independent variable for which you would like post hoc tests needs to be indicated.  Please note that this is just an example.  Post hoc test are not generated when the independent variable has only two levels.


 Back to Sample Analyses list

X. Chi-square
Sample question: Do males and females choose specific responses to the statement "On the whole, I am satisfied with myself" with the same frequency? To answer this question, you can run a Chi-square test. There are two different ways to do chi-square analyses on SPSS. If you select Analyze > Non-Parametric Tests > Chi-Square, you will only be able to do a one-way chi-square. Use the following procedure for a two-way:


 


Command Syntax for Chi-Square:

CROSSTABS
  /TABLES=esteem  BY gender
  /STATISTIC=CHISQ
  /CELLS= COUNT EXPECTED ROW COLUMN .
CROSSTABS
  /TABLES=esteem  BY gender - The "/tables=" subcommand generates a table which contains a frequency count between two or more variables.  The order in which the variables are inputted does not matter.
  /STATISTIC=CHISQ - Refer to the command syntax for frequencies for an explanation of this subcommand.  To get a complete list of the statistics offered for the Chi-Square refer to the help menu in SPSS (i.e., Select Help > Topics on the menu bar which will open the Help Topics window.  Click on the Index tab.  Type "Crosstabs" in the box.  Crosstabs will appear in the second box.  Highlight the Command Syntax under Crosstabs.  Click on the Display button.).
  /CELLS= COUNT EXPECTED ROW COLUMN . - The "/cells=" subcommand allows you to include not only the frequency count (i.e., COUNT) but also other observed or expected values.  In this case expected frequency counts (EXPECTED), row percentages (ROW), and column percentages (COLUMN) are generated.  A full list of the observed and expected values can be found in the Crosstabs Command Syntax in the SPSS help files.
Back to Sample Analyses list
 
 
© 2004 Bates College. All rights reserved.
Maintained by Brian Pfohl