The following table shows general guidelines for choosing a statistical analysis. We emphasize that these are general guidelines and should not be construed as hard and fast rules. Usually your data could be analyzed in multiple ways, each of which could yield legitimate answers. The table below covers a number of common analyses and helps you choose among them based on the number of dependent variables (sometimes referred to as outcome variables), the nature of your independent variables (sometimes referred to as predictors). You also want to consider the nature of your dependent variable, namely whether it is an interval variable, ordinal or categorical variable, and whether it is normally distributed (see What is the difference between categorical, ordinal and interval variables? for more information on this). The table then shows one or more statistical tests commonly used given these types of variables (but not necessarily the only type of test that could be used) and links showing how to do such tests using SAS, Stata and SPSS.
Number of 
Nature
of 
Test(s) 
How to SAS 
How to Stata 
How to SPSS 

1 
0
IVs 
interval & normal  onesample ttest 
SAS  Stata  SPSS 
ordinal or interval 
onesample median 
SAS  Stata  SPSS  
categorical 
binomial test 
SAS  Stata  SPSS  
categorical  Chisquare goodnessoffit 
SAS  Stata  SPSS  
1 IV with 2 levels 
interval & normal  2 independent sample ttest 
SAS  Stata  SPSS  
ordinal or interval 

WilcoxonMann Whitney test  SAS  Stata  SPSS  
categorical 
Chi square test 
SAS  Stata  SPSS  
Fisher's exact test  SAS  Stata  SPSS  
1 IV with 2 or more levels (independent groups) 
interval & normal  oneway ANOVA 
SAS  Stata  SPSS  
ordinal or interval 
Kruskal Wallis 
SAS  Stata  SPSS  
categorical 
Chi square test 
SAS  Stata  SPSS  
1 IV with 2 levels 
interval & normal  paired ttest 
SAS  Stata  SPSS  
ordinal or interval 
Wilcoxon signed ranks test 
SAS  Stata  SPSS  
categorical 
McNemar 
SAS  Stata  SPSS  
1
IV with 2 or more levels 
interval & normal  oneway repeated measures ANOVA 
SAS  Stata  SPSS  
ordinal or interval 
Friedman test 
SAS  Stata  SPSS  
categorical 
repeated measures logistic regression 
SAS  Stata  SPSS  
2 or more IVs 
interval & normal  factorial ANOVA 
SAS  Stata  SPSS  
ordinal or interval 
ordered logistic regression 
SAS  Stata  SPSS  
categorical 
factorial 
SAS  Stata  SPSS  
1 interval IV 
interval & normal  correlation 
SAS  Stata  SPSS  
simple linear regression 
SAS  Stata  SPSS  
ordinal or interval 
nonparametric correlation 
SAS  Stata  SPSS  
categorical 
simple logistic regression 
SAS  Stata  SPSS  
1
or more interval IVs and/or 1 or more categorical IVs 
interval & normal  multiple regression 
SAS  Stata  SPSS  
analysis of covariance  SAS  Stata  SPSS  
categorical 
multiple logistic regression 
SAS  Stata  SPSS  
discriminant analysis  SAS  Stata  SPSS  
2 or more 
1 IV with 2 or more levels 
interval & normal  oneway MANOVA  SAS  Stata  SPSS 
2 or more 
2 or more 
interval & normal  multivariate multiple linear regression 
SAS  Stata  SPSS 
2 sets of 
0 
interval & normal  canonical correlation 
SAS  Stata  SPSS 
2 or more 
0 
interval & normal  factor analysis 
SAS  Stata  SPSS 
Number of 
Nature
of 
Test(s) 
How to SAS 
How to Stata 
How to SPSS 
This page was adapted from Choosing the Correct Statistic developed by James D. Leeper, Ph.D. We thank Professor Leeper for permission to adapt and distribute this page from our site.
The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.