搜档网
当前位置:搜档网 › spss,sas,stata比较

spss,sas,stata比较

spss,sas,stata比较
spss,sas,stata比较

三大统计软件:SAS、Stata与SPSS比较

2012-09-20 23:02:46

Strategically using General Purpose Statistics Packages:

A Look at Stata, SAS and SPSS

中文版(自英文版本翻译):

很多人曾问及SAS,Stata 和SPSS之间的不同,它们之中哪个是最好的。可以想到,每

个软件都有自己独特的风格,有自己的优缺点。本文对此做了概述,但并不是一个综合的比较。人们时常会对自己所使用的统计软件有特别的偏好,希望大多数人都能认同这是对这些软件真

实而公允的一个对比分析。

SAS

一般用法。SAS由于其功能强大而且可以编程,很受高级用户的欢迎。也正是基于此,它是最

难掌握的软件之一。使用SAS时,你需要编写SAS程序来处理数据,进行分析。如果在一个

程序中出现一个错误,找到并改正这个错误将是困难的。

数据管理。在数据管理方面,SAS是非常强大的,能让你用任何可能的方式来处理你的数据。

它包含SQL(结构化查询语言)过程,可以在SAS数据集中使用SQL查询。但是要学习并掌

握SAS软件的数据管理需要很长的时间,在Stata或SPSS中,完成许多复杂数据管理工作所

使用的命令要简单的多。然而,SAS可以同时处理多个数据文件,使这项工作变得容易。它可

以处理的变量能够达到32,768个,以及你的硬盘空间所允许的最大数量的记录条数。

统计分析。SAS能够进行大多数统计分析(回归分析,logistic回归,生存分析,方差分析,因子分析,多变量分析)。SAS的最优之处可能在于它的方差分析,混合模型分析和多变量分析,而它的劣势主要是有序和多元logistic回归(因为这些命令很难),以及稳健方法(它难以完成稳健回归和其他稳健方法)。尽管支持调查数据的分析,但与Stata比较仍然是相当有限的。

绘图功能。在所有的统计软件中,SAS有最强大的绘图工具,由SAS/Graph模块提供。然而,SAS/Graph模块的学习也是非常专业而复杂,图形的制作主要使用程序语言。SAS 8虽然可以

通过点击鼠标来交互式的绘图,但不象SPSS那样简单。

总结。SAS适合高级用户使用。它的学习过程是艰苦的,最初的阶段会使人灰心丧气。然而它

还是以强大的数据管理和同时处理大批数据文件的功能,得到高级用户的青睐。

Stata

一般用法。Stata以其简单易懂和功能强大受到初学者和高级用户的普遍欢迎。使用时可以每

次只输入一个命令(适合初学者),也可以通过一个Stata程序一次输入多个命令(适合高级

用户)。这样的话,即使发生错误,也较容易找出并加以修改。

数据管理。尽管Stata的数据管理能力没有SAS那么强大,它仍然有很多功能较强且简单的数

据管理命令,能够让复杂的操作变得容易。Stata主要用于每次对一个数据文件进行操作,难

以同时处理多个文件。随着Stata/SE的推出,现在一个Stata数据文件中的变量可以达到

32,768,但是当一个数据文件超越计算机内存所允许的范围时,你可能无法分析它。

统计分析。Stata也能够进行大多数统计分析(回归分析,logistic回归,生存分析,方差分析,因子分析,以及一些多变量分析)。Stata最大的优势可能在于回归分析(它包含易于使用的

回归分析特征工具),logistic回归(附加有解释logistic回归结果的程序,易用于有序和多元logistic回归)。Stata也有一系列很好的稳健方法,包括稳健回归,稳健标准误的回归,以及

其他包含稳健标准误估计的命令。此外,在调查数据分析领域,Stata有着明显优势,能提供

回归分析,logistic回归,泊松回归,概率回归等的调查数据分析。它的不足之处在于方差分析

和传统的多变量方法(多变量方差分析,判别分析等)。

绘图功能。正如SPSS,Stata能提供一些命令或鼠标点击的交互界面来绘图。与SPSS不同

的是它没有图形编辑器。在三种软件中,它的绘图命令的句法是最简单的,功能却最强大。图

形质量也很好,可以达到出版的要求。另外,这些图形很好的发挥了补充统计分析的功能,例如,许多命令可以简化回归判别过程中散点图的制作。

总结。Stata较好地实现了使用简便和功能强大两者的结合。尽管其简单易学,它在数据管理

和许多前沿统计方法中的功能还是非常强大的。用户可以很容易的下载到别人已有的程序,也

可以自己去编写,并使之与Stata紧密结合。

SPSS

一般用法。SPSS非常容易使用,故最为初学者所接受。它有一个可以点击的交互界面,能够

使用下拉菜单来选择所需要执行的命令。它也有一个通过拷贝和粘贴的方法来学习其“句法”语言,但是这些句法通常非常复杂而且不是很直观。

数据管理。SPSS有一个类似于Excel的界面友好的数据编辑器,可以用来输入和定义数据

(缺失值,数值标签等等)。它不是功能很强的数据管理工具(尽管SPS 11版增加了一些增

大数据文件的命令,其效果有限)。SPSS也主要用于对一个文件进行操作,难以胜任同时处

理多个文件。它的数据文件有4096个变量,记录的数量则是由你的磁盘空间来限定。

统计分析。SPSS也能够进行大多数统计分析(回归分析,logistic回归,生存分析,方差分析,因子分析,多变量分析)。它的优势在于方差分析(SPSS能完成多种特殊效应的检验)和多

变量分析(多元方差分析,因子分析,判别分析等),SPSS11.5版还新增了混合模型分析的

功能。其缺点是没有稳健方法(无法完成稳健回归或得到稳健标准误),缺乏调查数据分析(SPSS12版增加了完成部分过程的模块)。

绘图功能。SPSS绘图的交互界面非常简单,一旦你绘出图形,你可以根据需要通过点击来修改。这种图形质量极佳,还能粘贴到其他文件中(Word 文档或Powerpoint等)。SPSS也有

用于绘图的编程语句,但是无法产生交互界面作图的一些效果。这种语句比Stata语句难,但

比SAS语句简单(功能稍逊)。

总结。SPSS致力于简便易行(其口号是“真正统计,确实简单”),并且取得了成功。但是如

果你是高级用户,随着时间推移你会对它丧失兴趣。SPSS是制图方面的强手,由于缺少稳健

和调查的方法,处理前沿的统计过程是其弱项。

总体评价

每个软件都有其独到之处,也难免有其软肋所在。总的来说,SAS,Stata和SPSS是能够用

于多种统计分析的一组工具。通过 Stat/Transfer可以在数秒或数分钟内实现不同数据文件的转换。因此,可以根据你所处理问题的性质来选择不同的软件。举例来说,如果你想通过混合模

型来进行分析,你可以选择SAS;进行logistic回归则选择Stata;若是要进行方差分析,最佳

的选择当然是SPSS。假如你经常从事统计分析,强烈建议您把上述软件收集到你的工具包以

便于数据处理。

另外,详细对比请参见《金融建模分析工具比较》.

English Version:

SAS

General use. SAS is a package that many "power users" like because of its power and programmability. Because SAS is such a powerful package, it is also one of the most difficult

to learn. To use SAS, you write SAS programs that manipulate your data and perform your data analyses. If you make a mistake in a SAS program, it can be hard to see where the error occurred or how to correct it.

Data Management. SAS is very powerful in the area of data management, allowing you to manipulate your data in just about any way possible. SAS includes proc sql that allows you to perform sql queries on your SAS data files. However, it can take a long time to learn and understand data management in SAS and many complex data management tasks can be done using simpler commands in Stata or SPSS. However, SAS can work with many data

files at once easing tasks that involve working with multiple files at once. SAS can handle enormous data files up to 32,768 variables and the number of records is generally limited to

the size of your hard disk.

Statistical Analysis. SAS performs most general statistical analyses (regression, logistic regression, survival analysis, analysis of variance, factor analysis, multivariate analysis). The greatest strengths of SAS are probably in its ANOVA, mixed model analysis and multivariate analysis, while it is probably weakest in ordinal and multinomial logistic regression (because these commands are especially difficult), robust methods (it is difficult to perform robust regression, or other kinds of robust methods). While there is some support for the analysis of survey data, it is quite limited as compared to Stata.

Graphics. SAS may have the most powerful graphic tools among all of the packages via

SAS/Graph. However, SAS/Graph is also very technical and tricky to learn. The graphs are created largely using syntax language; however, SAS 8 does have a point and click interface for creating graphs but it is not as easy to use as SPSS.

Summary. SAS is a package geared towards power users. It has a steep learning curve and can be frustrating at first. However, power users enjoy the its powerful data management and ability to work with numerous data files at once.

Stata

General Use. Stata is a package that many beginners and power users like because it is both easy to learn and yet very powerful. Stata uses one line commands which can be entered one command at a time (a mode favored by beginners) or can be entered many at a time in a

Stata program (a mode favored by power users). Even if you make a mistake in a Stata command, it is often easy to diagnose and correct the error.

Data Management. While the data management capabilities of Stata may not be quite as extensive as those of SAS, Stata has numerous powerful yet very simple data management commands that allows you to perform complex manipulations of your data with ease. However, Stata primarily works with one data file at a time so tasks that involve working with multiple files at once can be cumbersome. With the release of Stata/SE, you can now have up to 32,768 variables in a Stata data file but probably would not want to analyze a data file that exceeds the size of your computers memory.

Statistical Analysis . Stata performs most general statistical analyses (regression, logistic regression, survival analysis, analysis of variance, factor analysis, and some multivariate analysis). The greatest strengths of Stata are probably in regression (it has very easy to use regression diagnostic tools), logistic regression, (add on programs are available that greatly simplify the interpretation of logistic regression results, and ordinal logistic and multinomial logistic regressions are very easy to perform). Stata also has a very nice array of robust methods that are very easy to use, including robust regression, regression with robust standard errors, and many other estimation commands include robust standard errors as well. Stata also excels in the area of survey data analysis offering the ability to analyze survey data for regression, logistic regression, poisson regression, probit regression, etc…). The greatest weaknesses in this area would probably be in the area of analysis of variance and traditional mutivariate methods (e.g. manova, discriminant analysis, etc.).

Graphics. Like SPSS, Stata graphics can be created using Stata commands or using a point and click interface. Unlike SPSS, the graphs cannot be edited using a graph editor. The syntax of the graph commands is the easiest of the three packages and is also the most powerful. Stata graphs are high quality, publication quality graphs. In addition, Stata graphics are very functional for supplementing statistical analysis, for example there are numerous commands that simplify the creation of plots for regression diagnostics.

Summary. Stata offers a good combination of ease of use and power. While Stata is easy to learn, it also has very powerful tools for data management, many cutting edge statistical procedures, the ability to easily download programs developed by other users and the ability to create your own Stata programs that seamlessly become part of Stata.

SPSS

General use. SPSS is a package that many beginners enjoy because it is very easy to use. SPSS has a "point and click" interface that allows you to use pulldown menus to select commands that you wish to perform. SPSS does have a "syntax" language which you can learn by "pasting" the syntax from the point and click menus, but the syntax that is pasted is generally overly complicated and often unintuitive.

Data Management. SPSS has a friendly data editor that resembles Excel that allows you to enter your data and attributes of your data (missing values, value labels, etc.) However, SPSS does not have very strong data management tools (although SPSS version 11 added commands for reshaping data files from "wide" format to "long" format, and vice versa). SPSS primarily edits one data file at a time and is not very strong for tasks that involve working with multiple data files at once. SPSS data files can have 4096 variables and the number of records is limited only by your disk space.

Statistical Analysis. SPSS performs most general statistical analyses (regression, logistic regression, survival analysis, analysis of variance, factor analysis, and multivariate analysis). The greatest strengths of SPSS are in the area of analysis of variance (SPSS allows you to perform many kinds of tests of specific effects) and multivariate analysis (e.g. manova, factor analysis, discriminant analysis) and SPSS 11 has added some capabilities for analyzing mixed models. The greatest weakness of SPSS are probably in the absence of robust methods (we know of no abilities to perform robust regression or to obtain robust standard errors), the absence of survey data analysis (we know of no tools in this area).

Graphics. SPSS has a very simple point and click interface for creating graphs and once you create graphs they can be extensively customized via its point and click interface. The graphs are very high quality and can be pasted into other documents (e.g. word documents or powerpoint). SPSS does have a syntax language for creating graphs but many of the features in the point and click interface are not available via the syntax language. The syntax language is more complicated than the language provided by Stata, but probably simpler (but less powerful) than the SAS language.

Summary. SPSS focuses on ease of use (their motto is "real stats, real easy", and it

succeeds in this area. But if you intend to use SPSS as a power user, you may outgrow it over time. SPSS is strong in the area of graphics, but weak in more cutting edge statistical procedures lacking in robust methods and survey methods.

Overall Summary

Each package offers its own unique strengths and weaknesses. As a whole, SAS, Stata and SPSS form a set of tools that can be used for a wide variety of statistical analyses. With

Stat/Transfer it is very easy to convert data files from one package to another in just a matter of seconds or minutes. Therefore, there can be quite an advantage to switching from one analysis package to another depending on the nature of your problem. For example, if you were performing analyses using mixed models you might choose SAS, but if you were doing logistic regression you might choose Stata, and if you were doing analysis of variance you might choose SPSS. If you are frequently performing statistical analyses, we would strongly urge you to consider making each one of these packages part of your toolkit for data analysis.

用SPSS进行单因素方差分析和多重比较

方差分析 方差分析可以用来检验来多个均值之间差异的显著性,可以看成是两样本t检验的扩展。统计学原理中涉及的方差分析主要包括单因素方差分析、两因素无交互作用的方差分析和两因素有交互作用的方差分析三种情况。虽然Excel可以进行这三种类型的方差分析,但对数据有一些限制条件,例如不能有缺失值,在两因素方差分析中各个处理要有相等的重复次数等;功能上也有一些不足,例如不能进行多重比较。而在方差分析方面SPSS的功能特别强大,很多输出结果已经超出了统计学原理的范围。 用SPSS检验数据分布的正态性 方差分析需要以下三个假设条件:(1)、在各个总体中因变量都服从正态分布;(2)、在各个总体中因变量的方差都相等;(3)、各个观测值之间是相互独立的。 在SPSS中我们很方便地对前两个条件进行假设检验。同方差性检验一般与方差分析一起进行,这一小节我们只讨论正态性的检验问题。 [例7.4] 检验生兴趣对考试成绩的影响的例子中各组数据的正态性。 在SPSS中输入数据(或打开数据文件),选择Analyze→Descriptive Statistics→Explore,在Explore对话框中将统计成绩作为因变量,兴趣作为分类变量(Fator),单击Plots按钮,选中“Histogram”复选框和“Normality plots with Test”,单击“Continue”按钮,在单击主对话框中的“OK”,可以得到分类别的描述统计信息。从数据的茎叶图、直方图和箱线图都可以对数据分布的正态性做出判断,由于这些内容前面已经做过讲解,这里就不再进一步说明了。 图7-2 用Expore过程进行正态性检验 top↑

spss教程第二章均值比较检验与方差分析要点

第二章均值比较检验与方差分析 在经济社会问题的研究过程中,常常需要比较现象之间的某些指标有无显著差异,特别当考察的样本容量n比较大时,由随机变量的中心极限定理知,样本均值近似地服从正态分布。所以,均值的比较检验主要研究关于正态总体的均值有关的假设是否成立的问题。 ◆本章主要内容: 1、单个总体均值的 t 检验(One-Sample T Test); 2、两个独立总体样本均值的 t 检验(Independent-Sample T Test); 3、两个有联系总体均值均值的 t 检验(Paired-Sample T Test); 4、单因素方差分析(One-Way ANOVA); 5、双因素方差分析(General Linear Model Univariate)。 ◆假设条件:研究的数据服从正态分布或近似地服从正态分布。 在Analyze菜单中,均值比较检验可以从菜单Compare Means,和General Linear Model得出。如图2.1所示。 图2.1 均值的比较菜单选择项 §2.1 单个总体的t 检验(One-Sample T Test)分析 单个总体的 t 检验分析也称为单一样本的 t 检验分析,也就是检验单个变量的均值是否与假定的均数之间存在差异。如将单个变量的样本均值与假定的常数相比较,通过检验得出预先的假设是否正确的结论。

例1:根据2002年我国不同行业的工资水平(数据库SY-2),检验国有企业的职工平均年工资收入是否等于10000元,假设数据近似地服从正态分布。 首先建立假设:H0:国有企业工资为10000元; H1:国有企业职工工资不等于10000元 打开数据库SY-2,检验过程的操作按照下列步骤: 1、单击Analyze →Compare Means →One-Sample T Test,打开One-Sample T Test 主对话框,如图2.2所示。 图2.2 一个样本的t检验的主对话框 2、从左边框中选中需要检验的变量(国有单位)进入检验框中。 3、在Test Value框中键入原假设的均值数10000。 4、单击Options按钮,得到Options对话框(如图2.3),选项分别是置信度(默认项是95%)和缺失值的处理方式。选择后默认值后返回主对话框。 图2.3 一个样本t检验的Options对话框 5、单击OK,得输出结果。如表2.1所示。 表2.1(a).数据的基本统计描述 One-Sample Statistics

spss第五章,两总体均值比较

第5章两总体均值比较 Means:两个总体均值的比较 One samples T Test:单样本T检验 Independent –Samples T Test:独立样本T检验 Paried-Samples T Test:配对样本T检验 One –Way ANOV A:单因素方差分析 5.1单样本T检验 单样本检验是检验样本均值与已知总体均值是否存在差异。统计的前提是样本总体服从正态分布。 spss将自动计算t值(自己理解意思) 例5.1 分析某班级学生高考数学成绩与全国的平均成绩70分之间

是否存在显著性差异。数据如下:85 74 86 95 86 82 75 78 88 86 98 56 64 63 80 ----Analyze----Computer Means----One Sample T Test 红色部分填(输入已知的总体均数------此题在Tset Value中写70) -------点击options后出现如下: exclude case analysis by analysis:带有缺失值的观测值(当它与分析有关时才被剔除,它为默认状态) exclude cases listwise:表示剔除带有缺失值的所有观测值 -------设置置信度,默认95%。------continue -------回到前一个对话框------单击“OK” 结果如表5.1 5.2 独立样本T检验(使用表5.2)

----Analyze----Computer Means----Indenpendent Sample T Test ------如下图选择数据 ------单击“define groups”---并在“Groups 1“中输入“1”在“Groups 2“中输入“2”

SPSS 3均值检验

平均数比较 Means过程用于统计分组变量的的基本统计量。这些基本统计量包括:均值(Mean)、标准差(Standard Deviation)、观察量数目(Number of Cases)、方差(Variance)。Means 过程还可以列出方差表和线性检验结果。 [例子] 调查了棉铃虫百株卵量在暴雨前后的数量变化,统计暴雨前和暴雨后的统计量,其数据如下: 暴雨前 110 115 133 133 128 108 110 110 140 104 160 120 120 暴雨后 90 116 101 131 110 88 92 104 126 86 114 88 112 该数据保存在“DATA4-1.SAV”文件中。 1)准备分析数据 在数据编辑窗口输入分析的数据,如图4-2所示。或者打开需要分析的数据文件“DATA4-1.SAV”。 图4-2 数据窗口

2)启动分析过程 在SPSS主菜单中依次选择“Analyze→Compare Means→Means”。出现对话框如图4-3。 图4-3 Means设置窗口 3)设置分析变量 从左边的变量列表中选中“百株卵量”变量后,点击变量选择右拉按钮,该变量就进入到因子变量列表“Dependent List:”框里,用户可以从左边变量列表里选择一个或多个变量进行统计。 从左边的变量列表中选中“调查时候”变量,点击“Independent List”框左边的右拉按钮,该变量就进入分组变量“Independent List”框里,用户可以从左边变量列表里选择一个或多个分组变量。 多个分组变量既可放在一层,又可放在不同层。利用图中的“Previous”和“Next”按钮可以在不同层之间切换。 4)选择输出统计量

SPSS-比较均值-独立样本T检验 案例解析

SPSS-比较均值-独立样本T检验案例解析 2011-08-26 14:55 在使用SPSS进行单样本T检验时,很多人都会问,如果数据不符合正太分布,那还能够进行T检验吗?而大样本,我们一般会认为它是符合正太分布的,在鈡型图看来,正太分布,基本左右是对称的,一般具备两个参数,数学期望和标准方差,即:N(p, Q) 如果你的样本数非常少,一般需要进行正太分布检验,检验的方法网上很多,我就不说了 下面以“雄性老鼠和雌性老鼠分别注射了某种毒素,经过观察分析,进行随机取样,查看最终老鼠是否活着。 问题:很多人认为,雄性老鼠和雌性老鼠分别注射毒液后,雌性老鼠存活下来的数量会比雄性老鼠多? 我们将通过进行统计分析来认证这个假设是否成立。 下面进行参数设置:a 代表:雄性老鼠 b代表:雌性老鼠 tim 代表:生存时间,即指经过多长时间后,去查看结果 0 代表:结果死亡 1 代表:结果活着 随机抽取的样本,如下所示:

打开SPSS- 分析---检验均值---独立样本T检验,如下图所示:

将你要分析的变量,移入右边的框内,再将你要进行分组的变量移入“分组变量”框内,“组别group()里面的两个参数,不能够随意设置,必须要跟样本里面的数字一致 点击确定后,分析结果,如下所示: 从组统计量可以看出,雄性老鼠的存活下来的均值为0.73,但是雌性老鼠存活下来的均值为1.00,很明显,雌性老是存活下来的个数明显比雄性老鼠多,但是一般我们不看这个结果,为什么?因为样本不够大,如果将样本升至10000个?也许这个均值将会发生变化,不具备统计学意义, 我们一般只看独立样本检验的结果。 独立样本检验,提供了两种方法:levene检验和均值T检验两种方法 Levene检验主要用来检验原假设条件是否成立,(即:假设方差相等和方差不相等两种情况)如果SIG>0.05,证明假设成立,不能够拒绝原假设,如果 SIG<0.05,证明假设不成立,拒绝原假设。 进行levene检验结果判断是第一步,从上图,可以看出 sig<0.05 方差相等的假设不成立,所以看第二行,方差不相等的情况 sig=0.082>0.05 即说明 P 值大于显著性水平,不应该拒绝原假设:即指:雌性老鼠和雄性老鼠在注射毒液后,存活下来的个数没有显著的差异

相关主题