1、Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics回归分析线性回归曲线回归上节回顾2024/5/21 周二1Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics课程小结数据编码、变换、整理描述性统计分析均值比较相关分析回归分析推断统计20
2、24/5/21 周二2Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics描述性统计分析v图形描述 定性变量饼图条形图定量变量直方图茎叶图散点图箱图v数值描述 定性变量频数众数定量变量平均数中位数分位数方差(标准差)极差偏度(峰度)2024/5/21 周二3Shanghai University of International Business and EcnomicsShanghai University of
3、International Business and Ecnomics推断性统计(假设检验)参数检验与非参数检验T检验(均值有差异,概率有多少?)卡方检验(定性变量的关联强度检验)相关分析回归分析2024/5/21 周二4Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics如何选择恰当的统计检验方法变量类型定量(血压)定性(性别)所研究问题的类型关联比较影响因素数据的构成独立的配对的2024/5/21 周二5Shan
4、ghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics6第12讲SPSS数据可视化2024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics7基本概念2024/5/21 周二Shanghai University of Intern
5、ational Business and EcnomicsShanghai University of International Business and Ecnomics数据可视化是指数据的图形、图表化表示。借助几何图形可以形象的说明数据的特征和分布情况,借助统计图表可以精确、灵活的展现数据的各种特征。什么是数据可视化?2024/5/21 周二8Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics1.统计指标:能
6、精确、全面的呈现数据l统计指标分类2.统计表:能精确地呈现数据,但不够直观l基本表l定制表l表格的编辑3.统计图:能直观呈现数据,但精确度稍差数据展示途径2024/5/21 周二9Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics数据展示统计指标描述性统计指标就是用少量数值(称为描述统计量summarystatistic)概括大量数据。分类变量、连续变量有不同的描述指标体系。2024/5/21 周二10Shangh
7、ai University of International Business and EcnomicsShanghai University of International Business and Ecnomics分类变量分类变量统计描述常用指标:频数、频率、累计频数、累计频率比率:两个变量之比或部分占总体的比例2024/5/21 周二11Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics连续变量集中趋势Ce
8、ntral tendency(均数mean/中位数median/众数mode)离散趋势Dispersion tendency(全距Range/方差Variance/标准差std.Deviation等)分布特征(偏度skewness/峰度kurtosis)其他(percentile等)2024/5/21 周二12Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics统计表可从以下模块中生成:基本(Base)模块:如Rep
9、ort、Multiple Response表格(Table)模块定制表(Custom Table)多响应表(Multiple Response)数据展示统计表2024/5/21 周二13Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics定制表(Customtable)定制表过程功能与前面的基本相同,但是其指标界面的可视化程度更高、更易于操作。SPSS操作:分析Analyze-表tables-定制表customtab
10、les-进入“表格Table”选项卡,设置表格框架、汇总统计量等。2024/5/21 周二14Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomicsu表格框架的设置:将左边的变量框中的变量拖至右边合适的行列层位置 u汇总统计量的设置:单击选中分类变量,通过左下角:u 摘要统计量(Summary statistics)子对话框选择汇总统计量(如频数、频率等)、变更统计量值标签、格式(Format)等。u分类和总计(Cat
11、egories and totals)子对话框设定汇总量及亚分组 定制表(Customtable)2024/5/21 周二15Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomicsu其他设置:分析Analyze-表格tables-定制custom tables-进入其他选项卡:u检验统计量(Test statistics)选项卡:进行列联表的卡方检验,分组均值t检验等u标题(Titles)选项卡:与Basic tabl
12、es相同。注意,显示corner标题设定方法:u双击表格进入表格编辑窗口-格式(format)-表格属性(Table Properties)-行维数标签(row dimension lable)设为嵌套(nested)u选项(Options)卡:定义空单元格及缺失值的显示方式,数据列宽度等定制表(Customtable)2024/5/21 周二16Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics示例1数据文件em
13、ployee.sav利用定制表绘制不同性别工种的当前工资最大值172024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics示例1数据文件employee.sav利用定制表绘制不同性别工种的当前工资最大值182024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of Inte
14、rnational Business and Ecnomics数据展示统计图 2024/5/21 周二19Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics数据展示统计图“图形(Graphs)”菜单项:该菜单下的图表构建程序(Chart Builder)提供了可视化的图形生成器,它是一个画布式的全交互对话框,采用拖放方式操作。“分析(Analisys)”菜单项:对于一些和统计方法关联较密切,或者本身含有一定的统计分
15、析功能的图形,SPSS将其放置在分析菜单项下。2024/5/21 周二20Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics示例1利用条图分析不同职业对总信心指数平均水平的影响。数据CCSS_sample.sav212024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of Internat
16、ional Business and Ecnomics示例操作步骤1.选择“图形”“图标构建程序”菜单2.图库中选择条图组,将简单条图拖入画布3.职业S5拖入横轴4.将index1拖入纵轴5.确定6.进入图形编辑状态,选中类别分类轴,在属性的“类别”选项卡中,“排序依据”改为“统计”,“方向”改为“降序”,并“应用”222024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics示例2利用直方图考察城
17、市之间的总信心指数水平是否存在差异。数据CCSS_sample.sav232024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics示例2操作步骤1.选择“图形”“图标构建程序”菜单2.图库中选择直方图,将简单直方图拖入画布3.将Index1拖入画布的横轴中4.在元素属性对话框中选择“显示正态曲线”并应用5.在“group/points”中选中“rows panelvariable”6.将S0城市拖
18、入新增的panel中7.单击“选项”按钮242024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics252024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics如何选择合适的做图方式?变量的个数单变量
19、双变量多变量变量的尺度(类型)定类(无序)定序(有序)定距(连续性)2024/5/21 周二26Shanghai University of International Business and Ecnomics2024/5/21 周二27Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics一、描述单变量分布连续变量直方图(Histogram)箱式图(Boxplot)、茎叶图P-P图和Q-Q图(检验分布形态)分类变量
20、饼图(Pies Chart)条图(Bar Chart)帕累托图(Pareto Chart)单变量图指的是通过图形元素的位置高低、范围大小等来对某个变量的数值或类别分布情况进行展示,常用于描述、考察变量的分布类型。可分为:2024/5/21 周二28Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics292024/5/21 周二Shanghai University of International Business
21、and EcnomicsShanghai University of International Business and Ecnomics二、描述双变量分布连续的因变量简单条图(Bar Chart)(自变量分类)线图(Line)(自变量有序分类如时间序列数据)散点图(Scatter)(自变量连续)分类的因变量条图(Bar Chart)(自变量分类)顾名思义,绘制这类图形需要两个变量,而图形也主要是用于呈现这两个变量在数量上的联系方式。该类图形常用于对不同亚群的研究对象进行比较。2024/5/21 周二30Shanghai University of International Busines
22、s and EcnomicsShanghai University of International Business and Ecnomics条图(Bar Chart)线图(Line Chart)面积图(Area Chart)三、既适用于单变量,也适用于双变量2024/5/21 周二31Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics帕累托图ParetoChart用途以意大利经济学家V.Pareto的名字而命名
23、。主要用于绘制单个分类变量的频数(频率)分布,并且按各类别出现的频数多少排序。例3对SPSS自带数据“1991 U.S.General”中的“race”变量绘制帕累托图。2024/5/21 周二32Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics2024/5/21 周二33Shanghai University of International Business and EcnomicsShanghai Univ
24、ersity of International Business and Ecnomics用途用于描绘单个连续变量的频数分布,实际应用中常用于考察变量的分布是否服从正态分布。例4对SPSS自带数据“1991 U.S.General”中的“age”变量绘制直方图,并考察其是否服从正态分布。直方图(Histogram)2024/5/21 周二34Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics步骤1:点击“Graph
25、s”菜单2024/5/21 周二35Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics步骤2:点击“OK”2024/5/21 周二36Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics用途根据变量的累积概率对应于所指定的理论分布累积概率
26、绘制的散点图,可以直观地监测样本数据是否与某个概率分布的统计图形一致。例4对SPSS自带数据“1991 U.S.General”中的“edu”变量绘制P-P图,考察其是否服从正态分布。P-P图2024/5/21 周二37Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics步骤1:点击“Analyze”菜单2024/5/21 周二38Shanghai University of International Busine
27、ss and EcnomicsShanghai University of International Business and Ecnomics步骤2:点击“OK”,出现图1正态P-P图2024/5/21 周二39Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics横轴表示数据的实际累积概率纵轴表示正态分布的理论累积概率如果数据呈正态分布,则图中数据点应和理论直线(对角线)基本重合。从图1,我们可以发现数据点基本和
28、对角线重合,因此可以判断数据服从正态分布。对图1的结果说明2024/5/21 周二40Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics用途Q-Q图与P-P图的原理与用法基本一致,也可以用于分布的检验,所不同的是Q-Q图是根据变量数据分布的分位数对应于所指定分布的分位数绘图的统计图。例5对SPSS自带数据“1991 U.S.General”中的“edu”变量绘制Q-Q图,考察其是否服从正态分布。Q-Q图2024/5
29、/21 周二41Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics步骤1:点击“Analyze”菜单2024/5/21 周二42Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics步骤2:点击“OK”,出现图1正态Q-Q图2024/5/2
30、1 周二43Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics用途主要用于描述一个或多个分类变量与一个连续变量之间的关系。例6对SPSS自带数据“1991 U.S.General”中的“edu”变量和“race”变量绘制箱式图,即比较各个种族的教育程度。箱式图(Boxplot)2024/5/21 周二44Shanghai University of International Business and Ecnomi
31、csShanghai University of International Business and Ecnomics步骤1:点击“Graphs”菜单2024/5/21 周二45Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics步骤2:点击“Define”,进入定义框2024/5/21 周二46Shanghai University of International Business and EcnomicsSh
32、anghai University of International Business and Ecnomics步骤3:点击“OK”2024/5/21 周二47Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics线图(Line)用线段的升降来表示事物随时间的发展变化,实质上和条图没有区别,只是使用习惯不同而己简单(simple)线图:读书年限与个人收入的线图多线(multiple)图:按不同性别分别绘制的读书年限与个
33、人收入的线图2024/5/21 周二48Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics习题利用数据Employeedata.sav进行以下练习:(1)计算员工任职时间jobtime、起始工资salbegin、当前工资salary的平均数、标准差、四分位。(2)分别绘制这些变量分布直方图,并加载拟合正态曲线。(3)在同一个图上分不同性别制作beginning salary和current salary的线图。(4
34、)作beginning salary和current salary的散点图。并添加拟合线。2024/5/21 周二49Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics下节展望SPSS大作业502024/5/21 周二Shanghai University of International Business and EcnomicsShanghai University of International Business and Ecnomics51谢结束谢2024/5/21 周二Shanghai University of International Business and Ecnomics2024/5/21 周二52