数据分析(SAS描述性统计分析过程).ppt

上传人:牧羊曲112 文档编号:6050159 上传时间:2023-09-18 格式:PPT 页数:33 大小:780.50KB
返回 下载 相关 举报
数据分析(SAS描述性统计分析过程).ppt_第1页
第1页 / 共33页
数据分析(SAS描述性统计分析过程).ppt_第2页
第2页 / 共33页
数据分析(SAS描述性统计分析过程).ppt_第3页
第3页 / 共33页
数据分析(SAS描述性统计分析过程).ppt_第4页
第4页 / 共33页
数据分析(SAS描述性统计分析过程).ppt_第5页
第5页 / 共33页
点击查看更多>>
资源描述

《数据分析(SAS描述性统计分析过程).ppt》由会员分享,可在线阅读,更多相关《数据分析(SAS描述性统计分析过程).ppt(33页珍藏版)》请在三一办公上搜索。

1、数据分析,SAS软件,描述性统计分析过程,信息学院 张建新2010.3-6.,几种描述性统计分析的SAS过程和作图过程,proc means,proc univariate proc corr,proc plot/proc gplot proc capability,proc means(1)Means过程的语句格式Means过程的主要控制语句如下:proc means 输入数据集名;,var,变量列表;,class 变量列表;,byfreq,变量列表;变量;,weight 变量;,id,变量列表;,output;run;,proc means(2),var语句规定要求计算简单描述性统计量的数

2、值变量的次序。,by语句按by语句定义的变量进行分组计算其相应的简单统计量,要求输入数据集已按by变量排序。class语句与by语句一样,可用class变量定义观测组,分别计算各组观测的描述统计量。输出格式与by不同且事先不需要按class变量排序。freq语句指定一个数值型的freq变量,它的值表示输入数据集中相应观测出现的频数。,weight语句规定一个weight变量,它的值表示相应观测的权数。,id语句在输出数据集中增加一个或几个附加变量,目的在于识别输出数据集里的观测。其值为生成这个观测的输入数据集中相应观测组里id变量具有的最大值。,n,t,cv,proc means(3)proc

3、 means语句中可用的统计量关键字,统计量名称,含义,统计量名称 含义,未丢失的观测个数,mode,众数,出现频数最高的数,nmissmeanstderrsumstdvarusscssskewnesskurtosis,丢失的观测个数算术平均均值的标准误差加权和标准偏差方差变异系数的百分数加权平方和关于均值偏差的加权平方和对称性的度量偏度对尾部陡平的度量峰度,sumwgtmaxminrangemedianprtclmlclmuclm,权数和最大值最小值极差,maxmin中间值总体均值等于0的t统计量t分布的双尾p值置信度上限和下限置信度下限置信度上限,proc means(4),output语

4、句中的选项。,输出数据集名。,统计量关键字=变量名列表规定在输出数据集中要包含的统计量并规定这些统计量在新数据集中的变量名。means过程对output语句的次数没有限制,可以使用几个output语句来创建内容不同的多个数据集。,N,proc means(5)SAS程序data examp1;input x;cards;70.4 72.0 76.5 74.3 76.5 77.6 67.3 72.0 75.0 74.373.5 79.5 73.5 74.7 65.0 76.5 81.6 75.4 72.7 72.767.2 76.5 72.7 70.4 77.2 68.8 67.3 67.3 6

5、7.3 72.775.8 73.5 75.0 72.7 73.5 73.5 72.7 81.6 70.3 74.373.5 79.5 70.4 76.5 72.7 77.2 84.3 75.0 76.5 70.4;proc means data=examp1 n mean cv skewness kurtosis range median;var x;run;输出,The MEANS Procedure,Analysis Variable:x,Mean,Variation,Skewness,Kurtosis,Range,Median,50 73.7460000 5.4083794 0.1540

6、111 0.3581179 19.3000000,73.5000000,proc univariate(1),单变量统计分析,对一组单指标实验数据进行分析常采用两种方法:,图示法包括茎叶图、盒型图和正态概率,图。,描述统计量包括矩、分位数、极端值和,頻数分布表。,proc univariate(2)Univariate过程的主要控制语句如下:proc univariate 输入数据集名;,varbyfreqweightid,变量列表变量列表变量;变量;变量列表,;,output;run;,proc univariate(3)Univariate过程的主要控制语句如下:proc univaria

7、te 输入数据集名;,varbyfreqweightid,变量列表变量列表变量;变量;变量列表,;,output;run;,教材1.1例题 examp1_1(SAS程序),data examp1_1;input x;cards;,74.3 78.8 68.8 78.0 70.4 80.5 80.5 69.7 71.2 73.579.5 75.6 75.0 78.8 72.0 72.0 72.0 74.3 71.2 72.075.0 73.5 78.8 74.3 75.8 65.0 74.3 71.2 69.7 68.073.5 75.0 72.0 64.3 75.8 80.3 69.7 74.

8、3 73.5 73.575.8 75.8 68.8 76.5 70.4 71.2 81.2 75.0 70.4 68.070.4 72.0 76.5 74.3 76.5 77.6 67.3 72.0 75.0 74.373.5 79.5 73.5 74.7 65.0 76.5 81.6 75.4 72.7 72.767.2 76.5 72.7 70.4 77.2 68.8 67.3 67.3 67.3 72.775.8 73.5 75.0 72.7 73.5 73.5 72.7 81.6 70.3 74.373.5 79.5 70.4 76.5 72.7 77.2 84.3 75.0 76.5

9、 70.4;,proc univariate data=examp1_1;var x;run;,教材1.1例题 examp1_1(SAS结果1)The UNIVARIATE ProcedureVariable:xMoments,NMeanStd DeviationSkewness,100 Sum Weights73.66 Sum Observations3.94008153 Variance0.06007521 Kurtosis,100736615.52424240.03386864,Uncorrected SS,544116.46 Corrected SS,1536.9,Coeff Vari

10、ation 5.34901103 Std Error MeanBasic Statistical Measures,0.39400815,Location,Variability,Mean 73.66000 Std DeviationMedian 73.50000 VarianceMode 73.50000 Range,3.9400815.5242420.00000,Interquartile Range,4.60000,教材1.1例题 examp1_1(SAS结果2)The UNIVARIATE ProcedureQuantiles(Definition 5),Quantile100%Max

11、99%95%90%75%Q3,Estimate84.3082.9580.5079.1575.80,50%Median25%Q110%,73.5071.2068.40,5%1%0%Min,67.3064.6564.30,proc capability(能力分析过程),PROC CAPABILITY is designed for processcapability analysis,including:,Histograms(直方图)and comparative histograms.Cumulative distribution function plots(cdf plots)(累积分布函

12、数).,Quantile-quantile plots(Q-Q plots),probabilityplots,and probability-probability plots(P-P plots).These plots facilitate the comparison of a datadistribution with various theoretical distributions.Goodness-of-fit(拟合优度)tests for a variety ofdistributions including the normal.,Statistical intervals

13、(prediction,tolerance,andconfidence intervals)for a normal population.,教材1.2例题 examp1_4(SAS程序),data examp1_4;input x;cards;,74.3 78.8 68.8 78.0 70.4 80.5 80.5 69.7 71.2 73.579.5 75.6 75.0 78.8 72.0 72.0 72.0 74.3 71.2 72.075.0 73.5 78.8 74.3 75.8 65.0 74.3 71.2 69.7 68.073.5 75.0 72.0 64.3 75.8 80.3

14、 69.7 74.3 73.5 73.575.8 75.8 68.8 76.5 70.4 71.2 81.2 75.0 70.4 68.070.4 72.0 76.5 74.3 76.5 77.6 67.3 72.0 75.0 74.373.5 79.5 73.5 74.7 65.0 76.5 81.6 75.4 72.7 72.767.2 76.5 72.7 70.4 77.2 68.8 67.3 67.3 67.3 72.775.8 73.5 75.0 72.7 73.5 73.5 72.7 81.6 70.3 74.373.5 79.5 70.4 76.5 72.7 77.2 84.3

15、75.0 76.5 70.4;,proc capability data=examp1_4;,histogram x/normal(mu=est sigma=est);cdfplot/normal(mu=est sigma=est);qqplot x/normal(mu=est sigma=est);run;,教材1.2例题 examp1_4(SAS结果)The CAPABILITY ProcedureFitted Normal Distribution for xParameters for Normal DistributionParameter Symbol Estimate,Mean,

16、Mu,73.66,Std Dev Sigma 3.940082Quantiles for Normal Distribution-Quantile-Percent Observed Estimated1.0 64.6500 64.49405.0 67.3000 67.179110.0 68.4000 68.610625.0 71.2000 71.002550.0 73.5000 73.660075.0 75.8000 76.317590.0 79.1500 78.709495.0 80.5000 80.140999.0 82.9500 82.8260,教材1.2例题 examp1_4(SAS直

17、方图),教材1.2例题 examp1_4(SAS分布函数图),教材1.2例题 examp1_4(SAS qq图),教材1.2例题 examp1_6(SAS程序),data examp1_6;input x;cards;,74.3 78.8 68.8 78.0 70.4 80.5 80.5 69.7 71.2 73.579.5 75.6 75.0 78.8 72.0 72.0 72.0 74.3 71.2 72.075.0 73.5 78.8 74.3 75.8 65.0 74.3 71.2 69.7 68.073.5 75.0 72.0 64.3 75.8 80.3 69.7 74.3 73.

18、5 73.575.8 75.8 68.8 76.5 70.4 71.2 81.2 75.0 70.4 68.070.4 72.0 76.5 74.3 76.5 77.6 67.3 72.0 75.0 74.373.5 79.5 73.5 74.7 65.0 76.5 81.6 75.4 72.7 72.767.2 76.5 72.7 70.4 77.2 68.8 67.3 67.3 67.3 72.775.8 73.5 75.0 72.7 73.5 73.5 72.7 81.6 70.3 74.373.5 79.5 70.4 76.5 72.7 77.2 84.3 75.0 76.5 70.4

19、;,proc univariate data=examp1_6 plot;var x;run;,#,4,教材1.2例题 examp1_6(SAS结果),Stem Leaf,Boxplot,84 3838281 26680 35579 55578 088877 22676 555555575 0000000468888874 33333333773 5555555555572 0000000777777771 222270 3444444469 77768 0088867 233336665 0064 3,13334371491114835521,0|+-+|*-+-*|+-+|0,教材1.2例

20、题 examp1_8(SAS程序),data examp1_8;input x;cards;,25 45 50 54 55 61 64 68 72 75 75 78 79 81 83 8484 84 85 86 86 86 87 89 89 89 90 91 91 92 100;,proc univariate data=examp1_8 normal;run;,proc capability data=examp1_8 graphics noprint;histogram x/weibull vscale=proportion;run;,data delmin;,set examp1_8;,

21、if x=25 then delete;run;,proc capability data=delmin graphics noprint;histogram x/weibull vscale=proportion;cdfplot x/weibull;run;,2,教材1.2例题 examp1_8(SAS结果1)Tests for Normality,Test,-Statistic-,-p Value-,Shapiro-Wilk,W 0.863287,Pr W,0.0010,Kolmogorov-Smirnov D 0.195196,Pr D,0.0100,Cramer-von MisesAn

22、derson-Darling,W-Sq 0.295854A-Sq 1.593346,Pr W-Sq A-Sq 0.0050,结论:拒绝正态分布的假设Goodness-of-Fit Tests for Weibull Distribution,TestCramer-von Mises,-Statistic-W-Sq 0.2242363,DF,-p Value-Pr W-Sq 0.010,Anderson-Darling,A-Sq,1.2884219,Pr A-Sq 0.010,Chi-Square,Chi-Sq 24.8718882,3 Pr Chi-Sq 0.001,结论:拒绝Weibull分

23、布的假设Goodness-of-Fit Tests for Weibull Distribution,Test,-Statistic-,DF,-p Value-,Cramer-von MisesAnderson-DarlingChi-Square,W-Sq 0.16341872A-Sq 1.00500667Chi-Sq 5.22777090,Pr W-Sq 0.013Pr A-Sq Chi-Sq 0.073,结论:对于删去25的数据集,接受Weibull分布的假设,教材1.2例题 examp1_8(SAS结果2),proc corr(1),proc corr(相关分析过程)用于计算变量之间的相

24、关系数,包括Pearson(皮尔逊)的乘积矩相关和加权乘积矩相关。还能产生三个非参数的关联测量:Spearman的秩相关,Kendall的tau-b和Hoeffding的相关性度量D。proc corr语句调用corr过程,且是唯一必须,的语句。如果只使用proc corr这一条的语句,过程计算输入数据集中所有数值变量之间的相关系数。其余语句是供选择的。,proc corr(2)proc corr过程一般由下列语句控制:,proc corrvarwithpartialweightfreqByrun;,data=数据集;变量列表;变量列表;变量列表;变量;变量;变量列表;,教材1.3例题 exa

25、mp1_9(SAS程序),data examp1_9;input x y;cards;,68 971 63 892 70 1125 6 8265 931 9 112 10 162 12 32120 315 30 375 33 462 27 35221 305 5 84 14 229 27 33217 185 53 703 62 872 65 740;,run;,proc corr data=examp1_9 pearson spearman cov;run;run;,x,y,N,x,y,教材1.3例题 examp1_9(SAS结果1)The CORR Procedure,2 Variables

26、:,x,y,Covariance Matrix,DF=19,x570.45007845.0789,y7845.0789112404.2632,Simple Statistics,Variable,20,Mean33.85000,Std Dev23.88410,Median27.00000,Minimum5.00000,Maximum70.00000,20,477.50000,335.26745 342.00000 82.00000,1125,x,y,x,y,教材1.3例题 examp1_9(SAS结果2)The CORR ProcedurePearson Correlation Coeffic

27、ients,N=20Prob|r|under H0:Rho=0,x1.000000.97971,y0.97971.00011.00000,|r|under H0:Rho=0,x1.000000.97366.0001,y0.97366.00011.00000,教材1.3例题 examp1_10(SAS程序),data exam1_10;input x1-x6;cards;,191 36 50 5 162 60189 37 52 2 110 60,156 33 54 15 225 73138 33 68 2 110 43;,proc corr data=exam1_10 cov pearson s

28、pearman;var x1-x6;run;,N,x5,20,教材1.3例题 examp1_10(SAS结果1),The CORR Procedure,6 Variables:,x1,x2,x3,x4,x5,x6,Covariance Matrix,DF=19(略)Simple Statistics,Variable,Mean,Std Dev,Median,Minimum,Maximum,x1,20,178.60000,24.69051 176.00000 138.00000 247.00000,x2x3x4,202020,35.4000056.100009.45000,3.201977.21

29、0375.28628,35.0000055.0000011.50000,31.0000046.000001.00000,46.0000074.0000017.00000,145.55000,62.56658 122.50000,50.00000 251.00000,x6,20,70.30000,51.27747,54.00000,25.00000 250.00000,教材1.3例题 examp1_10(SAS结果2),The CORR Procedure,6 Variables:x1,x2,x3,x4,x5,x6,Pearson Correlation Coefficients,N=20Pro

30、b|r|under H0:Rho=0,x1,x2,x3,x4,x5,x6,x1x2x3x4x5x6,1.000000.87024.0001-0.365760.1128-0.389690.0894-0.493080.0272-0.226300.3374,0.87024.00011.00000-0.352890.1270-0.552230.0116-0.645600.0021-0.191500.4186,-0.365760.1128-0.352890.12701.000000.150650.52610.225040.34010.034930.8838,-0.389690.0894-0.552230

31、.01160.150650.52611.000000.695730.00070.495760.0262,-0.493080.0272-0.645600.00210.225040.34010.695730.00071.000000.669210.0013,-0.226300.3374-0.191500.41860.034930.88380.495760.02620.669210.00131.00000,问题:变量之间的相关性如何?,教材1.3例题 examp1_10(SAS结果3),The CORR ProcedureSpearman Correlation Coefficients,N=20P

32、rob|r|under H0:Rho=0,x1,x2,x3,x4,x5,x6,x1x2x3x4x5x6,1.000000.81423.0001-0.370700.1076-0.380200.0982-0.577740.0076-0.199020.4002,0.81423.00011.00000-0.237700.3129-0.541900.0136-0.724730.0003-0.199400.3993,-0.370700.1076-0.237700.31291.000000.136620.56570.179240.44960.098410.6798,-0.380200.0982-0.541900.01360.136620.56571.000000.656200.00170.322630.1653,-0.577740.0076-0.724730.00030.179240.44960.656200.00171.000000.695210.0007,-0.199020.4002-0.199400.39930.098410.67980.322630.16530.695210.00071.00000,问题:变量之间的相关性如何?,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号