You are on page 1of 8

6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

, ,
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? (https://stats.idre.ucla.edu/other/mult-pkg/whatstat/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 Nature of Dependent Variable(s) Test(s) How to SAS How to Stata How to SPSS
Dependent Independent (https://stats.idre.ucla.edu/other/mult-
Variables Variables pkg/whatstat/what-is-the-difference-

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 1/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

between-categorical-ordinal-and-
interval-variables/)

1 0 IVs (1 population) SAS


Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
one-sample statistical-analysis- statistical-analysis-
interval & normal should-i-
t-test should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#1sampt) spss/#1sampt)
sas/#1sampt)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
one-sample statistical-analysis- statistical-analysis-
ordinal or interval should-i-
median should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#1sampm) spss/#1sampm)
sas/#1sampm)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
statistical-analysis- statistical-analysis-
categorical (2 categories) binomial test should-i-
should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#bitest) spss/#bitest)
sas/#bitest)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
Chi-square statistical-analysis- st
statistical-analysis- statistical-analysis-
categorical goodness- should-i-
should-i-usestatistical- should-i-usestatistical-
of-fit usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#chifit) spss/#chifit)
sas/#chifit)

1 IV with 2 levels SAS


(independent Stata SPSS
(/sas/whatstat/what- (/
groups) 2 (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
independent statistical-analysis- statistical-analysis-
interval & normal should-i-
sample t- should-i-usestatistical- should-i-usestatistical-
usestatistical-
test analyses-using- analyses-using-
analyses-using-
stata/#2ittest) spss/#2ittest)
sas/#2ittest)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
Wilcoxon- statistical-analysis- st

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 2/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

y
statistical-analysis- statistical-analysis-
ordinal or interval Mann should-i-
should-i-usestatistical- should-i-usestatistical-
Whitney test usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#wilc) spss/#wilc)
sas/#wilc)

categorical SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
Chi-square statistical-analysis- statistical-analysis-
should-i-
test should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#chisq) spss/#chisq)
sas/#chisq)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
Fisher’s statistical-analysis- statistical-analysis-
should-i-
exact test should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#exact) spss/#exact)
sas/#exact)

1 IV with 2 or more SAS


levels (independent Stata SPSS
(/sas/whatstat/what- (/
groups) (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
one-way statistical-analysis- statistical-analysis-
interval & normal should-i-
ANOVA should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#1anova) spss/#1anova)
sas/#1anova)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
Kruskal statistical-analysis- statistical-analysis-
ordinal or interval should-i-
Wallis should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#kw) spss/#kw)
sas/#kw)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 3/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

y
Chi-square statistical-analysis- statistical-analysis-
categorical should-i-
test should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#chisq) spss/#chisq)
sas/#chisq)

1 IV with 2 levels SAS


(dependent/matched Stata SPSS
(/sas/whatstat/what- (/
groups) (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
statistical-analysis- statistical-analysis-
interval & normal paired t-test should-i-
should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#pairt) spss/#pairt)
sas/#pairt)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
Wilcoxon statistical-analysis- st
statistical-analysis- statistical-analysis-
ordinal or interval signed ranks should-i-
should-i-usestatistical- should-i-usestatistical-
test usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#wilcsign) spss/#wilcsign)
sas/#wilcsign)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
statistical-analysis- statistical-analysis-
categorical McNemar should-i-
should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#Mcnemar) spss/#Mcnemar)
sas/#Mcnemar)

1 IV with 2 or more SAS


levels Stata SPSS
(/sas/whatstat/what- (/
(dependent/matched one-way (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
groups) repeated statistical-analysis- statistical-analysis-
interval & normal should-i-
measures should-i-usestatistical- should-i-usestatistical-
usestatistical-
ANOVA analyses-using- analyses-using-
analyses-using-
stata/#1repanova) spss/#1repanova)
sas/#1repanova)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 4/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

y
Friedman statistical-analysis- statistical-analysis-
ordinal or interval should-i-
test should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#fried) spss/#fried)
sas/#fried)

SAS
Stata SPSS
(/sas/whatstat/what- (/
repeated (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
measures statistical-analysis- statistical-analysis-
categorical (2 categories) should-i-
logistic should-i-usestatistical- should-i-usestatistical-
usestatistical-
regression analyses-using- analyses-using-
analyses-using-
stata/#1replog) spss/#1replog)
sas/#1replog)

2 or more IVs SAS


(independent Stata SPSS
(/sas/whatstat/what- (/
groups) (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
factorial statistical-analysis- statistical-analysis-
interval & normal should-i-
ANOVA should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#factanov) spss/#factanov)
sas/#factanov)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
ordered statistical-analysis- st
statistical-analysis- statistical-analysis-
ordinal or interval logistic should-i-
should-i-usestatistical- should-i-usestatistical-
regression usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#orderedlogistic) spss/#orderedlogistic)
sas/#orderedlogistic) r/#

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
factorial statistical-analysis- st
statistical-analysis- statistical-analysis-
categorical (2 categories) logistic should-i-
should-i-usestatistical- should-i-usestatistical-
regression usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#faclogistic) spss/#faclogistic)
sas/#faclogistic)

1 interval IV SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 5/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

y
statistical-analysis- statistical-analysis-
interval & normal correlation should-i-
should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#corr) spss/#corr)
sas/#corr)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
simple linear statistical-analysis- statistical-analysis-
interval & normal should-i-
regression should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#simpreg) spss/#simpreg)
sas/#simpreg)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
non- statistical-analysis- st
statistical-analysis- statistical-analysis-
ordinal or interval parametric should-i-
should-i-usestatistical- should-i-usestatistical-
correlation usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#nonparr) spss/#nonparr)
sas/#nonparr)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
simple statistical-analysis- st
statistical-analysis- statistical-analysis-
categorical logistic should-i-
should-i-usestatistical- should-i-usestatistical-
regression usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#simplog) spss/#simplog)
sas/#simplog)

1 or more interval IVs interval & normal SAS


and/or 1 or more Stata SPSS
(/sas/whatstat/what- (/
categorical IVs (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
multiple statistical-analysis- statistical-analysis-
should-i-
regression should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#multreg) spss/#multreg)
sas/#multreg)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 6/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

y
analysis of statistical-analysis- statistical-analysis-
should-i-
covariance should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#ancova) spss/#ancova)
sas/#ancova)

categorical SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
multiple statistical-analysis- st
statistical-analysis- statistical-analysis-
logistic should-i-
should-i-usestatistical- should-i-usestatistical-
regression usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#logistic) spss/#logistic)
sas/#logistic)

SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
discriminant statistical-analysis- statistical-analysis-
should-i-
analysis should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#discrim) spss/#discrim)
sas/#discrim)

2+ 1 IV with 2 or more SAS


levels (independent Stata SPSS
(/sas/whatstat/what- (/
groups) (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
one-way statistical-analysis- statistical-analysis-
interval & normal should-i-
MANOVA should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#manova) spss/#manova)
sas/#manova)

2+ SAS
Stata SPSS
(/sas/whatstat/what- (/
multivariate (/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
multiple statistical-analysis- statistical-analysis-
interval & normal should-i-
linear should-i-usestatistical- should-i-usestatistical-
usestatistical-
regression analyses-using- analyses-using-
analyses-using-
stata/#mmreg) spss/#mmreg)
sas/#mmreg)

0 SAS
Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 7/8
6/19/2019 Choosing the Correct Statistical Test in SAS, Stata, SPSS and R

y
factor statistical-analysis- statistical-analysis-
interval & normal should-i-
analysis should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#factor) spss/#factor)
sas/#factor)

2 sets of 0 SAS
2+ Stata SPSS
(/sas/whatstat/what- (/
(/stata/whatstat/what- (/spss/whatstat/what-
statistical-analysis- st
canonical statistical-analysis- statistical-analysis-
interval & normal should-i-
correlation should-i-usestatistical- should-i-usestatistical-
usestatistical-
analyses-using- analyses-using-
analyses-using-
stata/#cancor) spss/#cancor)
sas/#cancor)

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.

Click here to report an error on this page or leave a comment

How to cite this page (https://stats.idre.ucla.edu/other/mult-pkg/faq/general/faq-how-do-i-cite-web-pages-and-programs-from-the-ucla-statistical-consulting-


group/)

© 2019 UC REGENTS TERMS OF USE & PRIVACY POLICY (http://www.ucla.edu/terms-of-use/) HOME (/) CONTACT (/contact)

https://stats.idre.ucla.edu/other/mult-pkg/whatstat/ 8/8

You might also like